Nginx vulnerability scanner perl code #! Usrbinperl-wuseLWP; useLWP: ConnCache; my $ browserLWP: UserAgent-new; $ browser-timeout (15); my $ conncacheLWP: ConnCache-new; $ browser-conn_cache ($ conncache); # use the list first, and read it again without saving the list in Notepad
Nginx vulnerability scanner perl code
#! Usr/bin/perl-w
Use LWP;
Use LWP: ConnCache;
My $ browser = LWP: UserAgent-> new;
$ Browser->TimeOut (15 );
My $ conNcAche = LWP: ConnCache-> new;
$ Browser-> conn_cache ($ conncache );
# Use the list first. If you do not use NotePad to save the list, read the list and then scan it.
My @BbsList1;
Push @ bbslist1, http://bbs.xxx.com/robots.txt;
Push @ bbslist1, http://bbs.yyy.com/robots.txt;
Push @ bbslist1, 'HTTP: // bbs.pctutu.com/robots.txt ';
Push @ bbslist1, 'HTTP: // bbs.yahoo.cn/robots.txt ';
# Server: nginx/0.8.13
# Content-Type: tExT/html
Print ttNginx vulnerability scanner nn;
Foreach my $ url (@ bbslist1 ){
Print is currently scanning: $ urLn;
My $ response = $ browser-> get ($ url );
$ Response-> is _SuCcess or say (FailEdTo get '$ url': n, $ response->StatUs_line );
My $ servertype = $ response-> server;
Print $ servertypen;
If ($ servertype = ~ /Nginx /){
My $ typeold = $ response-> content_type;
Print $ typeoldn;
My $ url2 = $ url. '/xysky.Php';
My $ response2 = $ browser-> get ($ url2 );
$ Response2-> is_success or say (Failed to get '$ url2': n, $ response-> status_line );
My $ typenew = $ response2-> content_type;
Print $ typenewn;
If ($ typeold eq $ typenew ){
Print site $ url no vulnerability found. nn;
} ELsE {
Print site $ url this vulnerability exists. nn;
}
} Else {
The print site is not nginx, Sorry! Nn;
}
}