File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -14,14 +14,22 @@ port scanner utility
1414
1515### Usage
1616
17+ * ` connectionOpts ` is a direct pass in to
18+ [ ` net.createConnection(<opts>) ` ] ( https://nodejs.org/api/net.html#net_socket_connect_options_connectlistener )
19+
1720```
1821import PortScanner from '@mi-sec/port-scanner';
1922
2023const scan = new PortScanner( {
2124 host: '192.168.1.0/24',
2225 ports: [ 22 ],
23- timeout: 100,
24- attemptToIdentify: true
26+ timeout: 1000, // optional
27+ debug: false, // optional
28+ onlyReportOpen: true, // optional
29+ bannerGrab: true, // optional
30+ identifyService: true, // optional
31+ attemptToIdentify: true, // optional
32+ connectionOpts: {} // optional*
2533} );
2634
2735const data = [];
Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ class PortScanner extends EventEmitter
258258 Array . isArray ( this . opts . ports ) ? this . opts . ports : [ this . opts . ports ] :
259259 [ ...commonPorts . keys ( ) ] ;
260260
261- this . opts . timeout = this . opts . timeout || 500 ;
261+ this . opts . timeout = this . opts . timeout || 1000 ;
262262
263263 this . opts . debug = this . opts . hasOwnProperty ( 'debug' ) ? this . opts . debug : false ;
264264 this . opts . onlyReportOpen = this . opts . hasOwnProperty ( 'onlyReportOpen' ) ? this . opts . onlyReportOpen : true ;
@@ -273,7 +273,7 @@ class PortScanner extends EventEmitter
273273 ! this . opts . debug || console . log ( ` debug: ${ this . opts . debug } ` ) ;
274274 ! this . opts . debug || console . log ( ` onlyReportOpen: ${ this . opts . onlyReportOpen } ` ) ;
275275 ! this . opts . debug || console . log ( ` bannerGrab: ${ this . opts . bannerGrab } ` ) ;
276- ! this . opts . debug || console . log ( ` attemptToIdentify : ${ this . opts . attemptToIdentify } ` ) ;
276+ ! this . opts . debug || console . log ( ` identifyService : ${ this . opts . identifyService } ` ) ;
277277
278278 this . result = new LightMap ( ) ;
279279
You can’t perform that action at this time.
0 commit comments