Allow minrank to be specified via -R

git-svn-id: file:///home/svn/framework3/trunk@7952 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2009-12-23 03:53:16 +00:00
parent 86f1616d24
commit dde54bf99c
1 changed files with 5 additions and 1 deletions

View File

@ -397,6 +397,7 @@ class Db
code = :bind code = :bind
mjob = 5 mjob = 5
regx = nil regx = nil
minrank = nil
port_inc = [] port_inc = []
port_exc = [] port_exc = []
@ -438,6 +439,8 @@ class Db
port_exc = Rex::Socket.portspec_crack(args.shift) port_exc = Rex::Socket.portspec_crack(args.shift)
when '-m' when '-m'
regx = args.shift regx = args.shift
when '-R'
minrank = args.shift
when '-h','--help' when '-h','--help'
print_status("Usage: db_autopwn [options]") print_status("Usage: db_autopwn [options]")
print_line("\t-h Display this help text") print_line("\t-h Display this help text")
@ -449,6 +452,7 @@ class Db
print_line("\t-r Use a reverse connect shell") print_line("\t-r Use a reverse connect shell")
print_line("\t-b Use a bind shell on a random port (default)") print_line("\t-b Use a bind shell on a random port (default)")
print_line("\t-q Disable exploit module output") print_line("\t-q Disable exploit module output")
print_line("\t-R [rank] Only run modules with a minimal rank")
print_line("\t-I [range] Only exploit hosts inside this range") print_line("\t-I [range] Only exploit hosts inside this range")
print_line("\t-X [range] Always exclude hosts inside this range") print_line("\t-X [range] Always exclude hosts inside this range")
print_line("\t-PI [range] Only exploit hosts with these ports open") print_line("\t-PI [range] Only exploit hosts with these ports open")
@ -459,7 +463,7 @@ class Db
end end
end end
minrank = framework.datastore['MinimumRank'] || 'manual' minrank = minrank || framework.datastore['MinimumRank'] || 'manual'
if ! RankingName.values.include?(minrank) if ! RankingName.values.include?(minrank)
print_error("MinimumRank invalid! Possible values are (#{RankingName.sort.map{|r|r[1]}.join("|")})") print_error("MinimumRank invalid! Possible values are (#{RankingName.sort.map{|r|r[1]}.join("|")})")
wlog("MinimumRank invalid, ignoring", 'core', LEV_0) wlog("MinimumRank invalid, ignoring", 'core', LEV_0)