Clean up style
parent
378375c822
commit
a950ecc345
|
@ -43,7 +43,7 @@ module Exploit::Remote::HttpServer
|
||||||
register_advanced_options([
|
register_advanced_options([
|
||||||
OptAddress.new('URIHOST', [false, 'Host to use in URI (useful for tunnels)']),
|
OptAddress.new('URIHOST', [false, 'Host to use in URI (useful for tunnels)']),
|
||||||
OptPort.new('URIPORT', [false, 'Port to use in URI (useful for tunnels)']),
|
OptPort.new('URIPORT', [false, 'Port to use in URI (useful for tunnels)']),
|
||||||
OptBool.new('SendRobots', [ false, "Return a robots.txt file if asked for one", false]),
|
OptBool.new('SendRobots', [false, 'Return a robots.txt file if asked for one', false])
|
||||||
])
|
])
|
||||||
|
|
||||||
# Used to keep track of resources added to the service manager by
|
# Used to keep track of resources added to the service manager by
|
||||||
|
@ -181,22 +181,22 @@ module Exploit::Remote::HttpServer
|
||||||
end
|
end
|
||||||
|
|
||||||
if datastore['SendRobots']
|
if datastore['SendRobots']
|
||||||
add_robots_resource()
|
add_robots_resource
|
||||||
end
|
end
|
||||||
|
|
||||||
add_resource(uopts)
|
add_resource(uopts)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_robots_resource()
|
def add_robots_resource
|
||||||
proc = Proc.new do |cli, req|
|
proc = Proc.new do |cli, req|
|
||||||
self.cli = cli
|
self.cli = cli
|
||||||
send_robots(cli, req)
|
send_robots(cli, req)
|
||||||
end
|
end
|
||||||
|
|
||||||
vprint_status("Adding hardcoded uri /robots.txt")
|
vprint_status('Adding hardcoded URI /robots.txt')
|
||||||
begin
|
begin
|
||||||
add_resource({'Path' => "/robots.txt", 'Proc' => proc})
|
add_resource('Path' => '/robots.txt', 'Proc' => proc)
|
||||||
rescue RuntimeError => e
|
rescue RuntimeError => e
|
||||||
print_warning(e.message)
|
print_warning(e.message)
|
||||||
end
|
end
|
||||||
|
@ -629,9 +629,9 @@ module Exploit::Remote::HttpServer
|
||||||
# Sends a canned robots.txt file
|
# Sends a canned robots.txt file
|
||||||
#
|
#
|
||||||
def send_robots(cli, request)
|
def send_robots(cli, request)
|
||||||
print_status("sending robots.txt")
|
print_status('Sending robots.txt')
|
||||||
robots = create_response(200, 'Success')
|
robots = create_response(200, 'Success')
|
||||||
robots['Content-Type'] = "text/plain"
|
robots['Content-Type'] = 'text/plain'
|
||||||
|
|
||||||
robots.body = %Q{\
|
robots.body = %Q{\
|
||||||
User-agent: *
|
User-agent: *
|
||||||
|
|
Loading…
Reference in New Issue