Skip to content

Commit 9ede2c2

Browse files
author
HD Moore
committed
Lands rapid7#4429 by fixing windows/messagebox with EXITFUNC=none
2 parents 85ec71b + 2c0c732 commit 9ede2c2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/payloads/singles/windows/messagebox.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,19 @@ def generate
8686
call [ebp+8] ;ExitProcess/Thread(0)
8787
EOS
8888

89-
# if exit is set to seh, overrule
89+
# if exit is set to seh or none, overrule
9090
if datastore['EXITFUNC'].upcase.strip == "SEH"
9191
# routine to exit via exception
9292
doexit = <<EOS
9393
xor eax,eax
9494
call eax
9595
EOS
9696
getexitfunc = ''
97+
elsif datastore['EXITFUNC'].upcase.strip == "NONE"
98+
doexit = <<-EOS
99+
nop
100+
EOS
101+
getexitfunc = ''
97102
end
98103

99104
# Generate code to get ptr to Title
@@ -232,6 +237,7 @@ def generate
232237
push 0x41206c6c
233238
push 0x642e3233
234239
push 0x72657375 ;user32.dll
240+
xor bl,bl ;make sure we have a null byte
235241
mov [esp+0xA],bl ;null byte
236242
mov esi,esp ;put pointer to string on top of stack
237243
push esi

0 commit comments

Comments
 (0)