#!/usr/bin/perl # # This is a ordinary CGI scanner, the only # differance is that it read CGI vulns from # a database file which can be used to your # advantage if would like to scan for certain # CGI flaws you can put it in a file and the # scanner would attemp them. # # syntax: # # -p : specifies port. # -h : specifies host. # -d : specifies what file should be used as database. # -m : specifies if the scanner should mass scan. # -l : specifies if the scanner should log the scan. # # Example: # # perl cscan.pl -p 80 -h 127.0.0.1 -d cgi.database -l blah.log : Example of single scan # perl cscan.pl -p 80 -m 127.0.0.1-255 -d cgi.database -l blah.log : Example of mass scan # # if -d is specified with out a database file it will use defualt db. # # That pretty much somes it up. Enjoy! # # Greets: NtWaK0, izik, sagi, Psydal, v0id, websk8ter, BrainStorm # RobBbot, GhQst, cr0n, NicotineX, omnis, skills, manipulat0r; # CraiK, antisane, JW23, Pneuma, wyze1, w3stside, ES!, *uNF* # # For more advance CGI scanning I recommend using 'Whisker' by rfp # its a nice and powerfull. # # Any comments or improvements mail me. Btw I thought I would write # a nice decent looking code. =P # Seelan@comstat.co.za # Iceburg. # ComStat Security. # Http://secruity.comstat.co.za - Http://www.comstat.co.za use Socket; use Getopt::Std; getopts("p:h:d:l:m:", \%args); print "::::::::::::::::::::::::::::::::::::::::\n"; print ":: Cscan.pl - CGI scanner by Iceburg ::\n"; print ":: ComStat Security ::\n"; print ":: http://security.comstat.co.za ::\n"; print "::::::::::::::::::::::::::::::::::::::::\n"; if (!defined $args{h} && !defined $args{m}) { print qq~ -p = specifies port. -h = specifies host. -d = specifies what file should be used as database. -l = specifies if the scanner should log the scan. -m = specifies if the scanner should mass scan. Check the script for Example scans. ~; exit;} $log=0; $port=$args{p}; if (defined $args{d}) { if ($args{d} != 0) { $file = "cgi.ls"; } else { $file=$args{d} } open(DB, $file) || die "Can't open database."; @cgilist = ; close (DB); } if (defined $args{l}) { $log=1; open(LOG, ">>$args{l}") || die "Cannot open log file."; print LOG <; ($http,$code,$blah) = split(/ /,$check); if($code == 200) { print "Found!\n"; if ($log) {print LOG "$sl - Found!\n";} } else { print "Not Found!\n"; } close(SOCK); } sub error { $error = shift(@_); print "Error - $error\n"; exit; }