-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgdb_analyze.sh
More file actions
35 lines (25 loc) · 979 Bytes
/
Copy pathgdb_analyze.sh
File metadata and controls
35 lines (25 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# GDB script to analyze NGINX CVE-2026-42945 vulnerability
# Create GDB script
cat > /tmp/gdb_nginx.py << 'EOF'
import gdb
import os
class NGINXHeapAnalyzer(gdb.Command):
"""Analyze NGINX heap for CVE-2026-42945"""
def __init__(self):
super(NGINXHeapAnalyzer, self).__init__("analyze_heap", gdb.COMMAND_USER)
def invoke(self, arg, from_tty):
# Get memory maps
gdb.execute("info proc mappings")
# Look for palloc pool structures
gdb.execute("x/100gx $rsp")
# Check for rewrite module structures
gdb.execute("info registers")
NGINXHeapAnalyzer()
# Set breakpoint on rewrite module
# gdb.execute("break ngx_http_rewrite_handler")
# gdb.execute("break ngx_http_script_regex_start_code")
print("GDB script loaded. Use 'analyze_heap' to analyze heap.")
EOF
# Run GDB with the script
docker exec nginx-cve-2026-42945 gdb -batch -x /tmp/gdb_nginx.py -p 12 2>&1 | head -100