You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/msf/core/handler/reverse_http.rb
+12-9Lines changed: 12 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,7 @@ def initialize(info = {})
53
53
OptString.new('MeterpreterServerName',[false,'The server header that the handler will send in response to requests','Apache']),
54
54
OptAddress.new('ReverseListenerBindAddress',[false,'The specific IP address to bind to on the local system']),
55
55
OptInt.new('ReverseListenerBindPort',[false,'The port to bind to on the local system if different from LPORT']),
56
+
OptBool.new('OverrideRequestHost',[false,'Forces clients to connect to LHOST:LPORT instead of keeping original payload host',false]),
56
57
OptString.new('HttpUnknownRequestResponse',[false,'The returned HTML response body when the handler receives a request that is not from a payload','<html><body><h1>It works!</h1></body></html>'])
57
58
],Msf::Handler::ReverseHttp)
58
59
end
@@ -92,13 +93,15 @@ def listener_uri
92
93
# addresses.
93
94
#
94
95
# @return [String] A URI of the form +scheme://host:port/+
95
-
defpayload_uri
96
-
ifipv6?
97
-
callback_host="[#{datastore['LHOST']}]"
96
+
defpayload_uri(req)
97
+
ifreqandreq.headersandreq.headers['Host']and not datastore['OverrideRequestHost']
0 commit comments