Skip to content

Commit ac79cc9

Browse files
OJbusterb
authored andcommitted
Fix up header string generation in transports
1 parent f6e9b12 commit ac79cc9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/msf/core/payload/transport_config.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,15 @@ def transport_config_reverse_named_pipe(opts={})
8383

8484
def get_custom_headers(ds)
8585
headers = ""
86-
headers << "Host: #{ds['HttpHost']}\r\n" if ds['HttpHost']
87-
headers << "Cookie: #{ds['HttpCookie']}\r\n" if ds['HttpCookie']
88-
headers << "Referer: #{ds['HttpReferer']}\r\n" if ds['HttpReferer']
86+
headers << "Host: #{ds['HttpHeaderHost']}\r\n" if ds['HttpHeaderHost']
87+
headers << "Cookie: #{ds['HttpHeaderCookie']}\r\n" if ds['HttpHeaderCookie']
88+
headers << "Referer: #{ds['HttpHeaderReferer']}\r\n" if ds['HttpHeaderReferer']
89+
90+
if headers.length > 0
91+
headers
92+
else
93+
nil
94+
end
8995
end
9096

9197
def timeout_config(opts={})

0 commit comments

Comments
 (0)