mirror of
				https://github.com/gnh1201/welsonjs.git
				synced 2025-10-30 20:41:18 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			757 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			757 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| ////////////////////////////////////////////////////////////////////////
 | |
| // NMAP interface API
 | |
| ////////////////////////////////////////////////////////////////////////
 | |
| 
 | |
| var client = require("lib/catproxy");
 | |
| 
 | |
| 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;
 | |
|     }
 | |
| };
 | |
| 
 | |
| exports.PortScanner = PortScanner;
 | |
| 
 | |
| exports.VERSIONINFO = "NMAP interface version 0.2";
 | |
| exports.AUTHOR = "abuse@catswords.net";
 | |
| exports.global = global;
 | |
| exports.require = global.require;
 |