From 841507d6cf2dbf2bbc4cbc5d7e726b30a075519c Mon Sep 17 00:00:00 2001 From: Nathan Bolam Date: Sun, 22 Dec 2019 12:57:13 +1100 Subject: [PATCH] no message --- dist/http/cwmp/index.js | 6 +++--- package.json | 2 +- src/http/cwmp/index.coffee | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dist/http/cwmp/index.js b/dist/http/cwmp/index.js index 9767012..0659f35 100644 --- a/dist/http/cwmp/index.js +++ b/dist/http/cwmp/index.js @@ -91,6 +91,7 @@ response = function(res) { 'SOAPServer': 'ACSServer' }; code = 404; + data = null; if (res.name && (methods[res.name] != null)) { if (res.id == null) { res.id = '1690d26c77f0000'; @@ -103,14 +104,13 @@ response = function(res) { } } else if (finished) { code = 204; - data = null; headers['Connection'] = "close"; headers['Content-Length'] = 0; console.log('<<< EMPTY RESPONSE'); - console.dir([headers, data]); } + console.dir([code, headers, data]); res.writeHead(code, headers); - return res.end(data); + res.end(data); }; module.exports = function(url) { diff --git a/package.json b/package.json index b84fc09..b942517 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tch-exploit", - "version": "2.0.0-rc2", + "version": "2.0.0-rc3", "main": "dist/index.js", "bin": "dist/index.js", "scripts": { diff --git a/src/http/cwmp/index.coffee b/src/http/cwmp/index.coffee index 80a844f..985c8f8 100644 --- a/src/http/cwmp/index.coffee +++ b/src/http/cwmp/index.coffee @@ -84,6 +84,7 @@ response = (res) -> 'SOAPServer' : 'ACSServer' code = 404 + data = null if res.name and methods[res.name]? res.id ?= '1690d26c77f0000' @@ -98,17 +99,19 @@ response = (res) -> else if finished code = 204 - data = null headers['Connection'] = "close" headers['Content-Length'] = 0 console.log '<<< EMPTY RESPONSE' - console.dir [ headers, data ] + + console.dir [ code, headers, data ] res.writeHead code, headers res.end data + return + module.exports = (url) -> (req, res) -> COOKIE_REGEX = /\s*([a-zA-Z0-9\-_]+?)\s*=\s*"?([a-zA-Z0-9\-_]*?)"?\s*(,|;|$)/g