metasploit-framework/scripts/resource/wmap_autotest.rc

73 lines
2.1 KiB
Plaintext

# wmap-autoscan.rc
# Author: m-1-k-3 (Web: http://www.s3cur1ty.de / Twitter: @s3cur1ty_de)
# This Metasploit RC-File could be used to analyse webapps automatically
# first you should use the crawler module or autocrawler resource file
# for learning the application
<ruby>
#wmap profile - set it to nil if you would not use any profile
#profile = nil
profile = "#{Msf::Config.install_root}/data/wmap/wmap_sample_profile.txt"
if (framework.datastore['THREADS'] == nil) #default to 50 Threads
run_single("setg THREADS 50")
end
#we look in the global datastore for a global VERBOSE option and use it
if (framework.datastore['VERBOSE'] == "true")
verbose = 1
else
verbose = 0
end
if (framework.plugins.to_s !~ /Wmap/)
print_line("loading the wmap plugin ...")
run_single("load wmap")
end
# Test and see if we have a database connected
begin
framework.db.hosts
rescue ::ActiveRecord::ConnectionNotEstablished
print_error("Database connection isn't established")
return
end
framework.db.hosts.each do |host|
host.services.each do |serv|
next if not serv.host
next if (serv.state != ServiceState::Open)
next if (serv.name !~ /http/)
if(verbose == 1)
print_line("")
print_line("====================================")
print_line("IP #{host.address}")
print_line("OS #{host.os_name}")
print_line("Servicename #{serv.name}")
print_line("Service Port #{serv.port.to_i}")
print_line("Service Protocol #{serv.proto}")
print_line("====================================")
print_line("")
end
print_line("available sites:")
run_single("wmap_sites -l")
print_line("site which will get analyzed:")
run_single("wmap_sites -s #{host.address}:#{serv.port}")
run_single("wmap_targets -t #{host.address}:#{serv.port}")
print_line("defined target:")
run_single("wmap_targets -l")
if(profile != nil)
run_single("wmap_run -e #{profile}")
else
run_single("wmap_run -e")
end
run_single("wmap_targets -c")
print_line("")
print_line("finished analysing the webservern on IP #{host.address.to_s}, Port: #{serv.port.to_s}")
print_line("")
end
end
</ruby>