Land #13426, Msf::Exploit::CmdStager::HTTP fixes
This commit is contained in:
@@ -9,7 +9,7 @@ module Msf
|
||||
module Exploit::CmdStager
|
||||
|
||||
include Msf::Exploit::EXE
|
||||
include Msf::Exploit::CmdStager::Http
|
||||
include Msf::Exploit::CmdStager::HTTP
|
||||
|
||||
# Constant for stagers - used when creating an stager instance.
|
||||
STAGERS = {
|
||||
|
||||
@@ -4,7 +4,7 @@ require 'msf/core/exploit/tcp_server'
|
||||
require 'msf/core/exploit/http/server'
|
||||
|
||||
module Msf::Exploit::CmdStager
|
||||
module Http
|
||||
module HTTP
|
||||
|
||||
include Msf::Exploit::Remote::HttpServer
|
||||
|
||||
@@ -36,19 +36,20 @@ module Http
|
||||
|
||||
print_status("Client #{client} requested #{request.uri}")
|
||||
|
||||
# NOTE: stager_instance is from Msf::Exploit::CmdStager
|
||||
if stager_instance.respond_to?(:user_agent)
|
||||
agent_regex = stager_instance.user_agent
|
||||
else
|
||||
agent_regex = /.*/
|
||||
end
|
||||
|
||||
if user_agent =~ agent_regex
|
||||
print_status("Sending payload to #{client}")
|
||||
send_response(cli, self.exe)
|
||||
else
|
||||
unless user_agent =~ agent_regex
|
||||
print_status("Sending 404 to #{client}")
|
||||
send_not_found(cli)
|
||||
end
|
||||
|
||||
print_status("Sending payload to #{client}")
|
||||
send_response(cli, exe) # NOTE: exe is from Msf::Exploit::CmdStager
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user