Fix #8685, Check nil condition for #wordlist_file in jtr modules

JTR modules should never assume there is always a database
connected while using #wordlist_file, considering a database is
an optional component for Framework.

Fix #8685
bug/bundler_fix
wchen-r7 2017-07-10 11:18:20 -05:00
parent 2ee6df66cf
commit fe360e3e2a
6 changed files with 30 additions and 0 deletions

View File

@ -32,6 +32,11 @@ class MetasploitModule < Msf::Auxiliary
# generate our wordlist and close the file handle # generate our wordlist and close the file handle
wordlist = wordlist_file wordlist = wordlist_file
unless wordlist
print_error('This module cannot run without a database connected. Use db_connect to connect to a database.')
return
end
wordlist.close wordlist.close
print_status "Wordlist file written out to #{wordlist.path}" print_status "Wordlist file written out to #{wordlist.path}"
cracker.wordlist = wordlist.path cracker.wordlist = wordlist.path

View File

@ -31,6 +31,11 @@ class MetasploitModule < Msf::Auxiliary
# generate our wordlist and close the file handle # generate our wordlist and close the file handle
wordlist = wordlist_file wordlist = wordlist_file
unless wordlist
print_error('This module cannot run without a database connected. Use db_connect to connect to a database.')
return
end
wordlist.close wordlist.close
print_status "Wordlist file written out to #{wordlist.path}" print_status "Wordlist file written out to #{wordlist.path}"
cracker.wordlist = wordlist.path cracker.wordlist = wordlist.path

View File

@ -46,6 +46,11 @@ class MetasploitModule < Msf::Auxiliary
# generate our wordlist and close the file handle # generate our wordlist and close the file handle
wordlist = wordlist_file wordlist = wordlist_file
unless wordlist
print_error('This module cannot run without a database connected. Use db_connect to connect to a database.')
return
end
wordlist.close wordlist.close
print_status "Wordlist file written out to #{wordlist.path}" print_status "Wordlist file written out to #{wordlist.path}"
cracker.wordlist = wordlist.path cracker.wordlist = wordlist.path

View File

@ -33,6 +33,11 @@ class MetasploitModule < Msf::Auxiliary
# generate our wordlist and close the file handle # generate our wordlist and close the file handle
wordlist = wordlist_file wordlist = wordlist_file
unless wordlist
print_error('This module cannot run without a database connected. Use db_connect to connect to a database.')
return
end
wordlist.close wordlist.close
print_status "Wordlist file written out to #{wordlist.path}" print_status "Wordlist file written out to #{wordlist.path}"
cracker.wordlist = wordlist.path cracker.wordlist = wordlist.path

View File

@ -32,6 +32,11 @@ class MetasploitModule < Msf::Auxiliary
# generate our wordlist and close the file handle # generate our wordlist and close the file handle
wordlist = wordlist_file wordlist = wordlist_file
unless wordlist
print_error('This module cannot run without a database connected. Use db_connect to connect to a database.')
return
end
wordlist.close wordlist.close
print_status "Wordlist file written out to #{wordlist.path}" print_status "Wordlist file written out to #{wordlist.path}"
cracker.wordlist = wordlist.path cracker.wordlist = wordlist.path

View File

@ -36,6 +36,11 @@ class MetasploitModule < Msf::Auxiliary
# generate our wordlist and close the file handle # generate our wordlist and close the file handle
wordlist = wordlist_file wordlist = wordlist_file
unless wordlist
print_error('This module cannot run without a database connected. Use db_connect to connect to a database.')
return
end
wordlist.close wordlist.close