Skip to content

Commit a2a75ff

Browse files
committed
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.
1 parent ed1ed5d commit a2a75ff

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/metasploit/framework/jtr/cracker.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ def show_command
199199
# This method tries to identify the correct version of the pre-shipped
200200
# JtR binaries to use based on the platform.
201201
#
202-
# @return [NilClass] if the correct bianry could not be determined
202+
# @return [NilClass] if the correct binary could not be determined
203203
# @return [String] the path to the selected binary
204204
def select_shipped_binary
205205
cpuinfo_base = ::File.join(Msf::Config.data_directory, "cpuinfo")
206-
runpath = nil
206+
run_path = nil
207207
if File.directory?(cpuinfo_base)
208208
data = nil
209209

@@ -215,11 +215,11 @@ def select_shipped_binary
215215
end
216216
case data
217217
when /sse2/
218-
run_path ||= "run.win32.sse2/john.exe"
218+
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.win32.sse2", "john.exe")
219219
when /mmx/
220-
run_path ||= "run.win32.mmx/john.exe"
220+
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.win32.mmx", "john.exe")
221221
else
222-
run_path ||= "run.win32.any/john.exe"
222+
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.win32.any", "john.exe")
223223
end
224224
when /x86_64-linux/
225225
fname = "#{cpuinfo_base}/cpuinfo.ia64.bin"
@@ -229,9 +229,9 @@ def select_shipped_binary
229229
end
230230
case data
231231
when /mmx/
232-
run_path ||= "run.linux.x64.mmx/john"
232+
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.linux.x64.mmx", "john")
233233
else
234-
run_path ||= "run.linux.x86.any/john"
234+
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.linux.x86.any", "john")
235235
end
236236
when /i[\d]86-linux/
237237
fname = "#{cpuinfo_base}/cpuinfo.ia32.bin"
@@ -241,15 +241,15 @@ def select_shipped_binary
241241
end
242242
case data
243243
when /sse2/
244-
run_path ||= "run.linux.x86.sse2/john"
244+
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.linux.x86.sse2", "john")
245245
when /mmx/
246-
run_path ||= "run.linux.x86.mmx/john"
246+
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.linux.x86.mmx", "john")
247247
else
248-
run_path ||= "run.linux.x86.any/john"
248+
run_path ||= ::File.join(Msf::Config.data_directory, "john", "run.linux.x86.any", "john")
249249
end
250250
end
251251
end
252-
runpath
252+
run_path
253253
end
254254

255255

0 commit comments

Comments
 (0)