Skip to content

Commit 29b3021

Browse files
committed
Land rapid7#8149, Add -h for the check command
2 parents 4e6cf58 + 1c3c2ec commit 29b3021

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

lib/msf/ui/console/module_command_dispatcher.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ def check_multiple(hosts)
122122
# Checks to see if a target is vulnerable.
123123
#
124124
def cmd_check(*args)
125+
if args.first =~ /^\-h$/i
126+
cmd_check_help
127+
return
128+
end
129+
125130
ip_range_arg = args.shift || mod.datastore['RHOSTS'] || framework.datastore['RHOSTS'] || ''
126131
opt = Msf::OptAddressRange.new('RHOSTS')
127132

@@ -162,6 +167,32 @@ def cmd_check(*args)
162167
end
163168
end
164169

170+
def cmd_check_help
171+
print_line('Usage: check [option] [IP Range]')
172+
print_line
173+
print_line('Options:')
174+
print_line('-h You are looking at it.')
175+
print_line
176+
print_line('Examples:')
177+
print_line('')
178+
print_line('Normally, if a RHOST is already specified, you can just run check.')
179+
print_line('But here are different ways to use the command:')
180+
print_line
181+
print_line('Against a single host:')
182+
print_line('check 192.168.1.123')
183+
print_line
184+
print_line('Against a range of IPs:')
185+
print_line('check 192.168.1.1-192.168.1.254')
186+
print_line
187+
print_line('Against a range of IPs loaded from a file:')
188+
print_line('check file:///tmp/ip_list.txt')
189+
print_line
190+
print_line('Multi-threaded checks:')
191+
print_line('1. set THREADS 10')
192+
print_line('2. check')
193+
print_line
194+
end
195+
165196
def report_vuln(instance)
166197
framework.db.report_vuln(
167198
workspace: instance.workspace,

0 commit comments

Comments
 (0)