1- const INFORMATIONAL = ' INFORMATIONAL' ;
2- const LOW = ' LOW' ;
3- const MEDIUM = ' MEDIUM' ;
4- const HIGH = ' HIGH' ;
1+ const INFORMATIONAL = " INFORMATIONAL" ;
2+ const LOW = " LOW" ;
3+ const MEDIUM = " MEDIUM" ;
4+ const HIGH = " HIGH" ;
55/**
66 * Sorts Nikto findings into Categories
77 *
88 * @param {string } category
99 */
1010function categorize ( { id } ) {
1111 if ( id === 999957 ) {
12- return [ ' X-Frame-Options Header' , LOW ] ;
13- } else if ( id === 'X-XSS-Protection' ) {
14- return [ ' X-XSS-Protection' , LOW ] ;
12+ return [ " X-Frame-Options Header" , LOW ] ;
13+ } else if ( id === 999102 ) {
14+ return [ " X-XSS-Protection" , LOW ] ;
1515 } else if ( id === 999100 ) {
16- return [ ' Uncommon Header' , INFORMATIONAL ] ;
16+ return [ " Uncommon Header" , INFORMATIONAL ] ;
1717 } else if ( id === 999103 ) {
18- return [ ' X-Content-Type-Options Header' , INFORMATIONAL ] ;
18+ return [ " X-Content-Type-Options Header" , INFORMATIONAL ] ;
1919 } else if ( id === 521000 ) {
20- return [ ' Path Traversal' , HIGH ] ;
20+ return [ " Path Traversal" , HIGH ] ;
2121 } else if ( id >= 600000 && id < 700000 ) {
22- return [ ' Outdated Software' , MEDIUM ] ;
22+ return [ " Outdated Software" , MEDIUM ] ;
2323 } else if ( id >= 800000 && id < 900000 ) {
24- return [ ' Identified Software' , INFORMATIONAL ] ;
24+ return [ " Identified Software" , INFORMATIONAL ] ;
2525 } else if ( id >= 0 && id < 100000 ) {
26- return [ ' Potential Vulnerability' , HIGH ] ;
26+ return [ " Potential Vulnerability" , HIGH ] ;
2727 } else if ( id >= 500017 && id < 600000 ) {
28- return [ ' Identified Software' , INFORMATIONAL ] ;
28+ return [ " Identified Software" , INFORMATIONAL ] ;
2929 } else if ( id >= 300000 && id < 400000 ) {
30- return [ ' Embedded Device' , INFORMATIONAL ] ;
30+ return [ " Embedded Device" , INFORMATIONAL ] ;
3131 }
3232
33- return [ ' Nikto Finding' , INFORMATIONAL ] ;
33+ return [ " Nikto Finding" , INFORMATIONAL ] ;
3434}
3535
3636async function parse ( { host, ip, port : portString , banner, vulnerabilities } ) {
@@ -42,14 +42,14 @@ async function parse({ host, ip, port: portString, banner, vulnerabilities }) {
4242 const [ category , severity ] = categorize ( { id : niktoId } ) ;
4343
4444 // We can only guess at this point. Nikto doesn't tell use anymore :(
45- const protocol = port === 443 || port === 8443 ? ' https' : ' http' ;
45+ const protocol = port === 443 || port === 8443 ? " https" : " http" ;
4646
4747 return {
4848 name : msg ,
4949 description : null ,
5050 category,
5151 location : `${ protocol } ://${ host } ${ url } ` ,
52- osi_layer : ' NETWORK' ,
52+ osi_layer : " NETWORK" ,
5353 severity,
5454 attributes : {
5555 ip_address : ip ,
0 commit comments