Nginx vulnerability scanner perl code

Source: Internet
Author: User
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;
}
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.