Add -h for the check command

Because even I don't remember what it can do anymore.
bug/bundler_fix
wchen-r7 2017-03-24 11:47:36 -05:00
parent 92c0748447
commit 1c3c2ecdc6
1 changed files with 31 additions and 0 deletions

View File

@ -122,6 +122,11 @@ module ModuleCommandDispatcher
# Checks to see if a target is vulnerable. # Checks to see if a target is vulnerable.
# #
def cmd_check(*args) def cmd_check(*args)
if args.first =~ /^\-h$/i
cmd_check_help
return
end
ip_range_arg = args.shift || mod.datastore['RHOSTS'] || framework.datastore['RHOSTS'] || '' ip_range_arg = args.shift || mod.datastore['RHOSTS'] || framework.datastore['RHOSTS'] || ''
opt = Msf::OptAddressRange.new('RHOSTS') opt = Msf::OptAddressRange.new('RHOSTS')
@ -162,6 +167,32 @@ module ModuleCommandDispatcher
end end
end end
def cmd_check_help
print_line('Usage: check [option] [IP Range]')
print_line
print_line('Options:')
print_line('-h You are looking at it.')
print_line
print_line('Examples:')
print_line('')
print_line('Normally, if a RHOST is already specified, you can just run check.')
print_line('But here are different ways to use the command:')
print_line
print_line('Against a single host:')
print_line('check 192.168.1.123')
print_line
print_line('Against a range of IPs:')
print_line('check 192.168.1.1-192.168.1.254')
print_line
print_line('Against a range of IPs loaded from a file:')
print_line('check file:///tmp/ip_list.txt')
print_line
print_line('Multi-threaded checks:')
print_line('1. set THREADS 10')
print_line('2. check')
print_line
end
def report_vuln(instance) def report_vuln(instance)
framework.db.report_vuln( framework.db.report_vuln(
workspace: instance.workspace, workspace: instance.workspace,