1.1.0 • Published 7 years ago
service-scanner v1.1.0
service-scanner
Scan for services in a network of IP addresses. Currently supports only HTTP services on a Class C network.
Usage
const scan = require('service-scanner')
const options = { ... }
scan(options)
The options
object can have the following properties:
limit
: Number of hosts to find before stopping the scan. Defaults to1
.port
: Port number to connect at. Defaults to 80.path
: Path where to look for the signature. Defaults to/
.startIp
: IP Address to start scanning from (inclusive). Defaults to192.168.0.0
.endIp
: IP Address to stop scanning at (inclusive). Defaults to192.168.255.255
.signature
: String or array of possible strings. Defaults to an empty string.scanInterval
: How fast to scan. Defaults to10
(ms).requestTimeout
: How long to wait till a request to the service timesout. Defaults to10
(ms).found
: Function to execute when a service is found - optional.notFound
: Function to execute when a service was not found on a host - optional.scanComplete
: function to execute when the scan is completed - optional.
Example
const scan = require('service-scanner')
const options = {
port: 3000,
path: '/secret',
startIp: '192.168.0.1',
endIp: '192.168.0.255',
signature: ['apple', 'secret-app'],
found: function(ip) {
console.log('FOUND:', ip)
},
scanComplete: function() {
console.log('Scan completed!')
}
}
scan(options)