RAPTOR provides autonomous crash analysis for C/C++ binaries using debugger integration and deterministic replay. The system extracts crash context, classifies vulnerability types, and assesses exploitability.
Crash analysis combines debugger traces, disassembly, memory layout analysis, and symbol resolution for comprehensive crash understanding.
def _detect_asan_binary(self) -> bool: """Detect if binary was compiled with AddressSanitizer.""" result = subprocess.run( ["nm", str(self.binary)], capture_output=True, text=True ) asan_symbols = [ "__asan_", "__sanitizer", "__asan_report", "__asan_handle" ] for symbol in asan_symbols: if symbol in result.stdout: return True return False
AddressSanitizer: heap-buffer-overflow on address 0x602000000015 at pc 0x00000040123cREAD of size 1 at 0x602000000015 thread T0 #0 0x40123b in process_data /src/server.c:145 #1 0x401456 in main /src/server.c:2340x602000000015 is located 0 bytes to the right of 5-byte region [0x602000000010,0x602000000015)allocated by thread T0 here: #0 0x7f8b4c in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10c4c) #1 0x40115e in allocate_buffer /src/server.c:89
# Go back 100 steps from crashreverse-next 100# Now step forward to see execution leading to crashnextnextprint bufferx/20xb buffer
# View stack tracebt# Go up to last application frame (before ASan runtime)upupup# Set breakpoint at that locationbreak *$pc# Reverse to last app instruction before ASanreverse-continue# Now step forwardnextprint *ptr
Automatic classification based on signals and context:
def classify_crash_type(self, context: CrashContext) -> str: """Classify crash type based on available information.""" signal = context.signal.lower() if signal in ["11", "sigsegv"]: # Segmentation fault - analyze further memory_region = context.binary_info.get("memory_region", "") if "heap" in memory_region: return "heap_overflow" elif "stack" in memory_region: return "stack_overflow" elif context.crash_address in ["0x0", "0x00000000"]: return "null_pointer_dereference" else: return "memory_access_violation" elif signal in ["6", "sigabrt"]: if context.binary_info.get("asan_enabled") == "true": return "asan_detected_bug" elif "double free" in context.stack_trace.lower(): return "double_free" else: return "abort_signal" # ... more classifications
# Stack hash for deduplicationstack_hash = hashlib.sha256( '|'.join(function_names[:10]).encode()).hexdigest()[:16]# Group by hashunique_crashes = defaultdict(list)for crash in all_crashes: unique_crashes[crash.stack_hash].append(crash)