@roflsec/fail2scan 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/daemon.js +2 -4
- package/package.json +1 -1
package/bin/daemon.js
CHANGED
|
@@ -4,7 +4,7 @@ const fs = require('fs'), path = require('path'), os = require('os');
|
|
|
4
4
|
const { execFile, spawn } = require('child_process');
|
|
5
5
|
const { promisify } = require('util');
|
|
6
6
|
const execFileP = promisify(execFile);
|
|
7
|
-
require('dotenv').config({ quiet:true})
|
|
7
|
+
require('dotenv').config({ quiet:true });
|
|
8
8
|
const IPGeolocationAPI = require("ip-geolocation-api-javascript-sdk");
|
|
9
9
|
|
|
10
10
|
const geoApi = new IPGeolocationAPI(process.env.IPGEO_API_KEY, true);
|
|
@@ -14,7 +14,6 @@ const getGeo = async (ip) => {
|
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
// -------------------- CLI / CONFIG --------------------
|
|
19
18
|
const argv = process.argv.slice(2);
|
|
20
19
|
const getArg = (k,d) => { for(let i=0;i<argv.length;i++){const a=argv[i]; if(a===k&&argv[i+1]) return argv[++i]; if(a.startsWith(k+'=')) return a.split('=')[1]; } return d; };
|
|
@@ -57,7 +56,6 @@ const STATE=loadState();
|
|
|
57
56
|
|
|
58
57
|
// -------------------- IP extraction --------------------
|
|
59
58
|
function extractIpFromLine(line){
|
|
60
|
-
// garde ton extracteur d’origine (IPv4 + IPv6)
|
|
61
59
|
const v4 = line.match(/\b(?:\d{1,3}\.){3}\d{1,3}\b/);
|
|
62
60
|
if(v4&&v4[0]) return v4[0];
|
|
63
61
|
const v6 = line.match(/\b([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}\b/);
|
|
@@ -65,7 +63,7 @@ function extractIpFromLine(line){
|
|
|
65
63
|
return null;
|
|
66
64
|
}
|
|
67
65
|
|
|
68
|
-
// -------------------- nmap helpers
|
|
66
|
+
// -------------------- nmap helpers --------------------
|
|
69
67
|
function spawnOneNmap(args, outFile) {
|
|
70
68
|
return new Promise((resolve, reject) => {
|
|
71
69
|
const proc = spawn('nmap', args, { stdio: ['ignore', 'pipe', 'pipe'] });
|
package/package.json
CHANGED