Commit 140ae7fb authored by CompileNix's avatar CompileNix

minor code style changes

parent 4b7cb7b5
'use strict'
let Netmask = require('netmask').Netmask
const Netmask = require('netmask').Netmask
let FtpScanner = require('./lib/FtpScanner.js')
let outfile = 'tmp.html'
......@@ -8,11 +8,11 @@ let countOfParalellJobWorker = 400
let ipAddressBlock = new Netmask('151.217.0.0/16') // CCC Event IPv4 Subnet
let ipAddresses = []
ipAddressBlock.forEach((ip) => {
ipAddresses.push(ip)
})
for (const addr of ipAddressBlock) {
ipAddressBlock.push(addr)
}
let ftpScanner = new FtpScanner(ipAddresses, outfile, undefined)
let ftpScanner = new FtpScanner(ipAddresses, /** outFileHtml */ outfile, /** outFileJson */ undefined)
ftpScanner.WriteOutputHeaderHtml('compilenix.org', 'ftpscan', 'archive')
for (var i = countOfParalellJobWorker; i > 0; i--) {
......
......@@ -132,14 +132,14 @@ class FtpScanner {
this.StartProcessingOfNextJob()
})
tcpSocket.on('data', (data) => {
tcpSocket.on('data', data => {
data = encoder.htmlEncode(String(data))
if (tcpSocket.remoteAddress !== undefined) {
if (firstLine) {
firstLine = false
firstLineData = data
firstLineDataHtmlEncoded = encoder.htmlEncode(String(firstLineData))
firstLineDataHtmlEncoded = encoder.htmlEncode(String(firstLineData)) // TODO: double html encode?
}
if (data.startsWith('227 Entering Passive Mode')) {
......@@ -164,7 +164,7 @@ class FtpScanner {
tcpSocketPassiveMode.destroy()
})
tcpSocketPassiveMode.on('data', (dataHtmlEncoded) => {
tcpSocketPassiveMode.on('data', dataHtmlEncoded => {
gotDirectoryListing = true
dataHtmlEncoded = encoder.htmlEncode(String(dataHtmlEncoded))
this.AddOutputFtpServer(tcpSocket.remoteAddress, dataHtmlEncoded)
......@@ -173,7 +173,7 @@ class FtpScanner {
this.StartProcessingOfNextJob()
})
tcpSocketPassiveMode.connect(port, serverIpAddress, () => {})
tcpSocketPassiveMode.connect(port, serverIpAddress, () => { })
}
}
......
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