0.1.1 • Published 8 years ago

net-scan v0.1.1

Weekly downloads
13
License
MIT
Repository
github
Last release
8 years ago

Net scan

  • scan port
  • scan ip

Installation

npm install net-scan -g

CLI

npm test
scan -h github.com -r 1~1000

Output:

scan host: github.com ports 1~1000
port 80 is open
scanning [                    ] 0% 1/1000 	port 22 is open
scanning [                    ] 0% 2/1000 	port 443 is open
scanning [====================] 100% 1000/1000 	
ports scan: 5245ms
open ports: [ 80, 22, 443 ]

Example

Range scan

var scan = require('net-scan');

console.time('ports scan');
scan.port({
	host: 'github.com',
	start: 1,
	end: 1000,
	timeout: 2000,
	queue: 1000
}, function(err, result) {    
	console.timeEnd('ports scan');
	console.log('open ports:', result);
});

Output

ports scan: 2232ms
open ports: [ 22, 80, 443 ]

Ports scan

var scan = require('net-scan');

console.time('ports scan');
scan.port({
	host: 'github.com',
	ports: [20, 21, 22, 80, 443, 3306, 27017],
	timeout: 2000
}, function(err, result) {    
	console.timeEnd('ports scan');
	console.log('open ports:', result);
});

Output

ports scan: 2015ms
open ports: [ 443, 22, 80 ]

Listener

console.time('ports scan');
scan.port({
		host: 'github.com',
		start: 1,
		end: 1000,
		timeout: 2000,
		queue: 1000
	})
	.on('open', function(port) {
		console.log('found port open', port);
	})
	.on('end', function(port) {
		console.timeEnd('ports scan');
		console.log('scan port over');
	});

Output

found port open 22
found port open 80
found port open 443
ports scan: 2243ms
scan port over

Todo

  • scan array ips
  • add command.js op
0.1.1

8 years ago

0.1.0

9 years ago

0.0.1

9 years ago

0.0.0

10 years ago