@@ -343,46 +343,46 @@ def cracker_version
343
343
# @return [Array] An array set up for {::IO.popen} to use
344
344
def john_crack_command
345
345
cmd_string = binary_path
346
- cmd = [ cmd_string , '--session=' + cracker_session_id , '--nolog' ]
346
+ cmd = [ cmd_string , '--session=' + cracker_session_id , '--nolog' ]
347
347
348
348
if config . present?
349
- cmd << ( "--config=" + config )
349
+ cmd << ( "--config=" + config )
350
350
else
351
- cmd << ( "--config=" + john_config_file )
351
+ cmd << ( "--config=" + john_config_file )
352
352
end
353
353
354
354
if pot . present?
355
- cmd << ( "--pot=" + pot )
355
+ cmd << ( "--pot=" + pot )
356
356
else
357
- cmd << ( "--pot=" + john_pot_file )
357
+ cmd << ( "--pot=" + john_pot_file )
358
358
end
359
359
360
360
if fork . present? && fork > 1
361
- cmd << ( "--fork=" + fork . to_s )
361
+ cmd << ( "--fork=" + fork . to_s )
362
362
end
363
363
364
364
if format . present?
365
- cmd << ( "--format=" + format )
365
+ cmd << ( "--format=" + format )
366
366
end
367
367
368
368
if wordlist . present?
369
- cmd << ( "--wordlist=" + wordlist )
369
+ cmd << ( "--wordlist=" + wordlist )
370
370
end
371
371
372
372
if incremental . present?
373
- cmd << ( "--incremental=" + incremental )
373
+ cmd << ( "--incremental=" + incremental )
374
374
end
375
375
376
376
if rules . present?
377
- cmd << ( "--rules=" + rules )
377
+ cmd << ( "--rules=" + rules )
378
378
end
379
379
380
380
if max_runtime . present?
381
- cmd << ( "--max-run-time=" + max_runtime . to_s )
381
+ cmd << ( "--max-run-time=" + max_runtime . to_s )
382
382
end
383
383
384
384
if max_length . present?
385
- cmd << ( "--max-len=" + max_length . to_s )
385
+ cmd << ( "--max-len=" + max_length . to_s )
386
386
end
387
387
388
388
cmd << hash_path
@@ -395,16 +395,16 @@ def john_crack_command
395
395
# @return [Array] An array set up for {::IO.popen} to use
396
396
def hashcat_crack_command
397
397
cmd_string = binary_path
398
- cmd = [ cmd_string , '--session=' + cracker_session_id , '--logfile-disable' ]
398
+ cmd = [ cmd_string , '--session=' + cracker_session_id , '--logfile-disable' ]
399
399
400
400
if pot . present?
401
- cmd << ( "--potfile-path=" + pot )
401
+ cmd << ( "--potfile-path=" + pot )
402
402
else
403
- cmd << ( "--potfile-path=" + john_pot_file )
403
+ cmd << ( "--potfile-path=" + john_pot_file )
404
404
end
405
405
406
406
if format . present?
407
- cmd << ( "--hash-type=" + jtr_format_to_hashcat_format ( format ) )
407
+ cmd << ( "--hash-type=" + jtr_format_to_hashcat_format ( format ) )
408
408
end
409
409
410
410
if optimize . present?
@@ -433,33 +433,33 @@ def hashcat_crack_command
433
433
# wouldn't be tested inside of MSF since most users are using the MSF modules for word list and easy cracks.
434
434
# Anything of length where this would cut off is most likely being done independently (outside MSF)
435
435
436
- cmd << ( "-O" )
436
+ cmd << ( "-O" )
437
437
end
438
438
439
439
if incremental . present?
440
- cmd << ( "--increment" )
440
+ cmd << ( "--increment" )
441
441
if increment_length . present?
442
- cmd << ( "--increment-min=" + increment_length [ 0 ] . to_s )
443
- cmd << ( "--increment-max=" + increment_length [ 1 ] . to_s )
442
+ cmd << ( "--increment-min=" + increment_length [ 0 ] . to_s )
443
+ cmd << ( "--increment-max=" + increment_length [ 1 ] . to_s )
444
444
else
445
445
# anything more than max 4 on even des took 8+min on an i7.
446
446
# maybe in the future this can be adjusted or made a variable
447
447
# but current time, we'll leave it as this seems like reasonable
448
448
# time expectation for a module to run
449
- cmd << ( "--increment-max=4" )
449
+ cmd << ( "--increment-max=4" )
450
450
end
451
451
end
452
452
453
453
if rules . present?
454
- cmd << ( "--rules-file=" + rules )
454
+ cmd << ( "--rules-file=" + rules )
455
455
end
456
456
457
457
if attack . present?
458
- cmd << ( "--attack-mode=" + attack )
458
+ cmd << ( "--attack-mode=" + attack )
459
459
end
460
460
461
461
if max_runtime . present?
462
- cmd << ( "--runtime=" + max_runtime . to_s )
462
+ cmd << ( "--runtime=" + max_runtime . to_s )
463
463
end
464
464
465
465
cmd << hash_path
@@ -470,7 +470,7 @@ def hashcat_crack_command
470
470
471
471
# must be last
472
472
if wordlist . present?
473
- cmd << ( wordlist )
473
+ cmd << ( wordlist )
474
474
end
475
475
cmd
476
476
end
@@ -486,14 +486,14 @@ def each_cracked_password
486
486
#
487
487
# @return [String] the path to the default john.conf file
488
488
def john_config_file
489
- ::File . join ( ::Msf ::Config . data_directory , "jtr" , "john.conf" )
489
+ ::File . join ( ::Msf ::Config . data_directory , "jtr" , "john.conf" )
490
490
end
491
491
492
492
# This method returns the path to a default john.pot file.
493
493
#
494
494
# @return [String] the path to the default john.pot file
495
495
def john_pot_file
496
- ::File . join ( ::Msf ::Config . config_directory , "john.pot" )
496
+ ::File . join ( ::Msf ::Config . config_directory , "john.pot" )
497
497
end
498
498
499
499
# This method is a getter for a random Session ID for the cracker.
@@ -513,14 +513,14 @@ def show_command
513
513
514
514
pot_file = pot || john_pot_file
515
515
if cracker =='hashcat'
516
- cmd = [ cmd_string , "--show" , "--potfile-path=#{ pot_file } " , "--hash-type=#{ jtr_format_to_hashcat_format ( format ) } " ]
516
+ cmd = [ cmd_string , "--show" , "--potfile-path=#{ pot_file } " , "--hash-type=#{ jtr_format_to_hashcat_format ( format ) } " ]
517
517
elsif cracker =='john'
518
- cmd = [ cmd_string , "--show" , "--pot=#{ pot_file } " , "--format=#{ format } " ]
518
+ cmd = [ cmd_string , "--show" , "--pot=#{ pot_file } " , "--format=#{ format } " ]
519
519
520
520
if config
521
521
cmd << "--config=#{ config } "
522
522
else
523
- cmd << ( "--config=" + john_config_file )
523
+ cmd << ( "--config=" + john_config_file )
524
524
end
525
525
end
526
526
cmd << hash_path
0 commit comments