#!/usr/bin/perl # DomainScan v0.2 # Copyright Chartreuse 2008 # use strict; use LWP::UserAgent; use HTTP::Request::Common; my $i=0; $SIG{INT} = \&ForcedDie; sub ForcedDie { $SIG{INT} = \&ForcedDie; print "\a\n.Killed.\n"; print "$i URL's Scanned!\n"; exit(0); } my $BrowserName='ScanAgent'; my $agent=LWP::UserAgent->new(agent=>"$BrowserName"); print "=======================================\n"; print "|| DomainScan || V0.2 By: Chartreuse ||\n"; print "=======================================\n"; print "\n"; #getdictfile(); print "Enter URL to scan, Place a single asterisk\n"; print "in the spot you wish to scan. Only one spot\n"; print "can be scanned at a time.\n"; print "--> "; my $url=; chomp($url); if($url !~ /\Q*\E/) #Check if Url has no astrisk if it does not treat it as a single url check { &singleurl;exit(0); } &multiurl; sub multiurl { print "Enter Dictionary File Name\n"; print "-->"; my $dict=; my $tempurl; my $word; my $result; chomp($dict); open(DICTF, $dict) || die(error(1)); while () #Cycles through each line of the file { $tempurl=$url; #Reset Temporary URL $word=$_; chomp ($word); #Get the current word $tempurl =~ s/\Q*\E/$word/; $result=$agent->request(GET $tempurl); if ($result->is_success) { print "$tempurl Exists\n"; } $i=$i+1; } print "\n$i Domains Scanned!\n"; close(DICTF); exit(1); } sub error { my ($a) = @_; print "\n\n"; if ($a eq 1) { print "Error 1: File not Found, Please restart appication.\n"; exit(1); } exit(1); } sub singleurl { chomp($url); my $result=$agent->request(GET $url); if ($result->is_success) { print "$url Exists\n"; } else { print "$url Does Not Exist\n"; } }