mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-09 05:06:04 +00:00
Merge pull request #118 from gnh1201/catproxy-nmap
NMAP support with Caterpillar Proxy
This commit is contained in:
commit
3e67209ae8
|
@ -1,11 +1,13 @@
|
||||||
// catproxy.js
|
// catproxy.js
|
||||||
// Caterpillar Proxy Integration for WelsonJS framework
|
// Caterpillar Proxy Integration for WelsonJS framework
|
||||||
// https://github.com/gnh1201/welsonjs
|
// https://github.com/gnh1201/welsonjs
|
||||||
// https://github.com/gnh1201/caterpillar
|
|
||||||
var JSONRPC2 = require("lib/jsonrpc2");
|
var JSONRPC2 = require("lib/jsonrpc2");
|
||||||
|
|
||||||
function CatProxyClient(url) {
|
function CatProxyClient(url) {
|
||||||
var env = {"target": url, "method": ""};
|
var env = {
|
||||||
|
"target": "http://localhost:5555/jsonrpc2", // Check this: https://github.com/gnh1201/caterpillar
|
||||||
|
"method": ""
|
||||||
|
};
|
||||||
|
|
||||||
this.set_env = function(k, v) {
|
this.set_env = function(k, v) {
|
||||||
env[k] = v || null;
|
env[k] = v || null;
|
||||||
|
@ -54,6 +56,10 @@ function CatProxyClient(url) {
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof url !== "undefined") {
|
||||||
|
this.set_env(url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function create(url) {
|
function create(url) {
|
||||||
|
@ -63,7 +69,7 @@ function create(url) {
|
||||||
exports.create = create;
|
exports.create = create;
|
||||||
exports.CatProxyClient = CatProxyClient;
|
exports.CatProxyClient = CatProxyClient;
|
||||||
|
|
||||||
exports.VERSIONINFO = "Caterpillar Proxy Integration (caterpillar.js) version 0.1.4";
|
exports.VERSIONINFO = "Caterpillar Proxy Integration (caterpillar.js) version 0.1.5";
|
||||||
exports.AUTHOR = "abuse@catswords.net";
|
exports.AUTHOR = "abuse@catswords.net";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
30
lib/nmap.js
30
lib/nmap.js
|
@ -1,14 +1,28 @@
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// NMAP API
|
// NMAP interface API
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
var NMAPObject = function() {
|
var client = require("lib/catproxy");
|
||||||
this.binPath = "bin\\32bit\\nmap-7.92\\nmap.exe";
|
|
||||||
|
|
||||||
this.start = function() {
|
var PortScanner = function(binpath, url) {
|
||||||
var cmd = [];
|
this.url = url;
|
||||||
// .. todo ..
|
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;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.NMAPObject = NMAPObject;
|
exports.PortScanner = PortScanner;
|
||||||
|
|
||||||
|
exports.VERSIONINFO = "NMAP interface version 0.2";
|
||||||
|
exports.AUTHOR = "abuse@catswords.net";
|
||||||
|
exports.global = global;
|
||||||
|
exports.require = global.require;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user