We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab63cae commit 27876a9Copy full SHA for 27876a9
lib/msf/core/exploit/cmdstager/http.rb
@@ -27,9 +27,25 @@ def start_service(opts = {})
27
end
28
29
def on_request_uri(cli, request)
30
- if request['User-Agent'] =~ /^(?:Wget|curl)/
+ client = cli.peerhost
31
+
32
+ if (user_agent = request.headers['User-Agent'])
33
+ client << " (#{user_agent})"
34
+ end
35
36
+ print_status("Client #{client} requested #{request.raw_uri}")
37
38
+ if stager_instance.respond_to?(:user_agent)
39
+ agent_regex = stager_instance.user_agent
40
+ else
41
+ agent_regex = /.*/
42
43
44
+ if user_agent =~ agent_regex
45
+ print_status("Sending payload to #{client}")
46
send_response(cli, exe)
47
else
48
+ print_status("Sending 404 to #{client}")
49
send_not_found(cli)
50
51
0 commit comments