Fix typo and full path issue

Previously, the JtR library was prepending the path to data/john/ for
shipped bins; without it, modules weren't finding the executables.
bug/bundler_fix
James Lee 2014-07-21 17:58:27 -05:00
parent ed1ed5d5a4
commit a2a75ffb03
No known key found for this signature in database
GPG Key ID: 2D6094C7CEA0A321
1 changed files with 11 additions and 11 deletions

View File

@ -199,11 +199,11 @@ module Metasploit
# This method tries to identify the correct version of the pre-shipped
# JtR binaries to use based on the platform.
#
# @return [NilClass] if the correct bianry could not be determined
# @return [NilClass] if the correct binary could not be determined
# @return [String] the path to the selected binary
def select_shipped_binary
cpuinfo_base = ::File.join(Msf::Config.data_directory, "cpuinfo")
runpath = nil
run_path = nil
if File.directory?(cpuinfo_base)
data = nil
@ -215,11 +215,11 @@ module Metasploit
end
case data
when /sse2/
run_path ||= "run.win32.sse2/john.exe"
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.win32.sse2", "john.exe")
when /mmx/
run_path ||= "run.win32.mmx/john.exe"
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.win32.mmx", "john.exe")
else
run_path ||= "run.win32.any/john.exe"
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.win32.any", "john.exe")
end
when /x86_64-linux/
fname = "#{cpuinfo_base}/cpuinfo.ia64.bin"
@ -229,9 +229,9 @@ module Metasploit
end
case data
when /mmx/
run_path ||= "run.linux.x64.mmx/john"
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.linux.x64.mmx", "john")
else
run_path ||= "run.linux.x86.any/john"
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.linux.x86.any", "john")
end
when /i[\d]86-linux/
fname = "#{cpuinfo_base}/cpuinfo.ia32.bin"
@ -241,15 +241,15 @@ module Metasploit
end
case data
when /sse2/
run_path ||= "run.linux.x86.sse2/john"
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.linux.x86.sse2", "john")
when /mmx/
run_path ||= "run.linux.x86.mmx/john"
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.linux.x86.mmx", "john")
else
run_path ||= "run.linux.x86.any/john"
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.linux.x86.any", "john")
end
end
end
runpath
run_path
end