module BeEF
module Extension
module Xssrays
module RegisterHttpHandler
BeEF::API::Registrar.instance.register(BeEF::Extension::Xssrays::RegisterHttpHandler, BeEF::API::Server, 'mount_handler')
def self.mount_handler(beef_server)
beef_server.mount('/xssrays', BeEF::Extension::Xssrays::Handler.new)
beef_server.mount('/api/xssrays', BeEF::Extension::Xssrays::XssraysRest.new)
end
end
module RegisterPreHookCallback
BeEF::API::Registrar.instance.register(BeEF::Extension::Xssrays::RegisterPreHookCallback, BeEF::API::Server::Hook, 'pre_hook_send')
def self.pre_hook_send(hooked_browser, body, _params, _request, _response)
return if hooked_browser.nil?
xssrays = BeEF::Extension::Xssrays::API::Scan.new
xssrays.start_scan(hooked_browser, body)
end
end
end
end
end