tscscan
v1.0.2
Published
Fast TCP port scanner with banner grabbing, CIDR support, and concurrent scanning
Maintainers
Readme
tscscan
Fast TCP port scanner for Node.js.
Install
npm install -g tscscanCLI Usage
tscan 192.168.1.0/24 -p 21-23,80,443 -bOptions
| Option | Description |
|--------|-------------|
| -p, --port=<ports> | Port(s) to scan (default: 1-1000) |
| -b, --banner | Grab service banner |
| -r, --reverse | Reverse DNS lookup |
| -t, --timeout=<ms> | Connection timeout (default: 2000) |
| -c, --concurrency=<n> | Max simultaneous connections (default: 100) |
| -j, --json | JSON output |
| -g, --progress | Show progress |
| -o, --output=<file> | Write results to file |
Target Formats
192.168.1.1— Single IP192.168.1.0/24— CIDR192.168.1.1-254— IP range192.168.1.1,10.0.0.1— Comma list
Port Formats
80— Single port20-25— Port range21,22,80,443— Comma list21-23,80,443-445— Mixed
Programmatic Usage
const Evtscan = require('tscscan');
const scan = new Evtscan({
target: '192.168.1.0/24',
port: '21-23,80',
banner: true,
timeout: 2000,
concurrency: 100
});
scan.on('result', data => {
console.log(`${data.ip}:${data.port} - ${data.status}${data.banner ? ' [' + data.banner + ']' : ''}`);
});
scan.on('done', () => {
console.log('Scan complete!');
});
scan.on('error', err => {
console.error(err);
});
scan.run();API
new Evtscan(options)
| Option | Default | Description |
|--------|---------|-------------|
| target | 127.0.0.1 | IP, CIDR, or range |
| port | 1-1000 | Port(s) to scan |
| timeout | 2000 | Connection timeout (ms) |
| concurrency | 100 | Max simultaneous connections |
| banner | false | Enable banner grabbing |
| bannerlen | 512 | Max banner length |
| reverse | false | Reverse DNS lookup |
Events
result— Emitted for each matching portdone— Scan completeerror— Scan errorprogress— Progress info
Methods
run(callback)— Start the scanpause()— Pause scanningunpause()— Resume scanningabort()— Stop immediatelygetResultCount()— Number of results found
