Commit 8febf7f8 authored by CompileNix's avatar CompileNix

Set tcp socket read limit to one buffer

parent ff9263f1
......@@ -32,6 +32,7 @@ class FtpScanner {
let header = "<html>\n" +
"<head>\n" +
"<title>" + targetDomain + " - ftpScan</title>\n" +
"<style type=\"text/css\">body{font-family:monospace;} .fileListEntry{background-color:#ececec;}</style>\n" +
"</head>\n" +
"<body>\n" +
"<h1>Scan started at: " + new Date().toUTCString() + "</h1>\n" +
......@@ -92,7 +93,7 @@ class FtpScanner {
* @param {string} data
*/
AddOutputFtpServer(ipAddress, data) {
this.AppendHtmlToOutputFile("<b><a href=\"ftp://" + ipAddress + "/\" target=\"_blank\">" + ipAddress + "</a></b><pre>" + data + "</pre>\n");
this.AppendHtmlToOutputFile("<b><a href=\"ftp://" + ipAddress + "/\" target=\"_blank\">" + ipAddress + "</a></b><pre class=\"fileListEntry\">" + data + "</pre>\n");
}
ProcessJob() {
......@@ -120,6 +121,7 @@ class FtpScanner {
case "EHOSTUNREACH":
case "ECONNRESET":
case "ENOPROTOOPT":
case "ENETUNREACH":
break;
default:
console.log(error);
......@@ -167,6 +169,7 @@ class FtpScanner {
dataHtmlEncoded = encoder.htmlEncode(String(dataHtmlEncoded));
this.AddOutputFtpServer(tcpSocket.remoteAddress, dataHtmlEncoded);
tcpSocketPassiveMode.end();
tcpSocketPassiveMode.destroy();
this.StartProcessingOfNextJob();
});
......@@ -175,6 +178,8 @@ class FtpScanner {
}
this.StartProcessingOfNextJob();
tcpSocket.end();
tcpSocket.destroy();
});
tcpSocket.on("close", () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment