Apply patch for disabling console logging of DNS requests

git-svn-id: file:///home/svn/framework3/trunk@5621 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2008-08-08 21:20:25 +00:00
parent 83248c3d60
commit eae5315ab7
1 changed files with 23 additions and 5 deletions

View File

@ -45,7 +45,14 @@ class Auxiliary::Server::FakeDNS < Msf::Auxiliary
[ [
OptAddress.new('SRVHOST', [ true, "The local host to listen on.", '0.0.0.0' ]), OptAddress.new('SRVHOST', [ true, "The local host to listen on.", '0.0.0.0' ]),
OptPort.new('SRVPORT', [ true, "The local port to listen on.", 53 ]), OptPort.new('SRVPORT', [ true, "The local port to listen on.", 53 ]),
OptAddress.new('TARGETHOST', [ false, "The address that all names should resolve to", nil ]) OptAddress.new('TARGETHOST', [ false, "The address that all names should resolve to", nil ]),
], self.class)
register_advanced_options(
[
OptBool.new('LogConsole', [ false, "Determines whether to log all request to the console", true]),
OptBool.new('LogDatabase', [ false, "Determines whether to log all request to the database", false]),
], self.class) ], self.class)
end end
@ -64,8 +71,16 @@ class Auxiliary::Server::FakeDNS < Msf::Auxiliary
@port = datastore['SRVPORT'].to_i @port = datastore['SRVPORT'].to_i
# LOG REQUESTS? @log_console = false
@log_requests = false @log_database = false
if (datastore['LogConsole'].to_s.match(/^(t|y|1)/i))
@log_console = true
end
if (datastore['LogDatabase'].to_s.match(/^(t|y|1)/i))
@log_database = true
end
# MacOS X workaround # MacOS X workaround
::Socket.do_not_reverse_lookup = true ::Socket.do_not_reverse_lookup = true
@ -157,9 +172,12 @@ class Auxiliary::Server::FakeDNS < Msf::Auxiliary
lst << "UNKNOWN #{tc_s}" lst << "UNKNOWN #{tc_s}"
end end
} }
print_status("DNS #{addr[3]}:#{addr[1]} XID #{request.id} (#{lst.join(", ")})")
if(@log_requests) if(@log_console)
print_status("DNS #{addr[3]}:#{addr[1]} XID #{request.id} (#{lst.join(", ")})")
end
if(@log_database)
report_note( report_note(
:host => addr[3], :host => addr[3],
:type => "dns_lookup", :type => "dns_lookup",