welsonjs/lib/nmap.js

29 lines
757 B
JavaScript
Raw Permalink Normal View History

2022-02-28 10:33:54 +00:00
////////////////////////////////////////////////////////////////////////
2024-07-04 05:57:20 +00:00
// NMAP interface API
2022-02-28 10:33:54 +00:00
////////////////////////////////////////////////////////////////////////
2024-07-04 05:57:20 +00:00
var client = require("lib/catproxy");
2022-02-28 10:33:54 +00:00
2024-07-04 05:57:20 +00:00
var PortScanner = function(binpath, url) {
this.url = url;
this.binpath = binpath;
this.scan = function(hosts) {
var worker = client.create(url);
worker.set_method("scan_ports_by_hosts");
var result = worker.exec({
"binpath": this.binpath,
"hosts": hosts
});
return result;
}
2022-02-28 10:33:54 +00:00
};
2024-07-04 05:57:20 +00:00
exports.PortScanner = PortScanner;
exports.VERSIONINFO = "NMAP interface version 0.2";
exports.AUTHOR = "abuse@catswords.net";
exports.global = global;
exports.require = global.require;