#!/usr/bin/perl
#code with warnings
use warnings;
#scoping
use strict;
# load modules for capture();
use Crypt::SSLeay;
use LWP::UserAgent;
#declre global variables;
my ($file,$choice, $correct,$curr_status,$octetone,$octettwo,$octetthree,$octetfour, $ipmin, $ipmax,$addy,$title);
#shouts
system("clear");
print "Welcome to IP Sniffer\n";
print "Coded by neutrin0 && Cyn1c4L\n";
print "Sh0utz (neutrin0): m1ndctrl,AJK,rustblade, jimmiejaz, hypatia, Phoenix ,perl monks,, #to2600 cr3w!\n";
print "Sh0utz (Cyn1c4L): Rustblade, AJK, Intruder, H0lli/IO (bwahahahaha, let's get serious), Distrust, Hypatia, #hackcanada, #to2600 cr3w!\n";print "neutrin0 and Cyn1c4L";print "\n";sleep(3);#collect ip informationwhile ($correct == 0){system("clear");#this variable is used to display current status$curr_status = "x.x.x.y-z\n";#Prompts for octet-sequence one octet at a timeprint $curr_status;print "Please Enter First Octet: ";$octetone = ;chop $octetone;#Clears the screensystem("clear");$curr_status = "$octetone.x.x.y-z\n";print $curr_status;
print "Please Enter Second Octet: ";
$octettwo = ;
system("clear");
$curr_status ="$octetone.$octettwo.x.y-z\n";
print $curr_status;
print "Please Enter Third Octet: ";
$octetthree = ;
chop $octetthree;
system("clear");
$curr_status ="$octetone.$octettwo.$octetthree.y-z\n";
print $curr_status;
print "Please Enter Scan Beginning Range: ";
$ipmin = ;
chop $ipmin;
print "Please Enter Scan Ending Range: ";
$ipmax = ;
chop $ipmax;
system("clear");
#BASS
$curr_status ="$octetone.$octettwo.$octetthree.$ipmin-$ipmax\n";
print $curr_status;
print "Is This Correct? (Y/N) ";
$correct = ;
if ($correct=~/y|Y/){
$correct = 1;
}else{
$correct = 0;
}}
$addy=$curr_status;
iterate($addy, $ipmin, $ipmax);
sub iterate{
#declare local target ip and range iterator
my ($ipscan, $x);
#mathch and capture octets
$addy=~/^(\d*)\.(\d*)\.(\d*).(.*)$/;
for $x(($ipmin-1)...($ipmax-1)){
$x++;
$ipscan="$1.$2.$3.$x";
print "Scanning $ipscan\n";
capture($ipscan,$addy);
}}
sub capture{
#create a local instance of $addy
my $ipscan;
($ipscan,$addy)= shift @_;
$addy="http://".$ipscan;
my $ua = LWP::UserAgent->new;
$ua->timeout('15');
my $response = $ua->get($addy);
if ($response->is_success) {
my $page=$response->content;
captured($page,$addy);
}else{
print " $addy fails \n" ;
}}
sub captured{
my ($page,$addy) =shift @_;
my $line;
my $title;
my @lines=split /\n/, $page;
for $line(@lines){
if ($line=~/\(.*)\<\/TITLE\>/mig){
$title=$1;
}}
print " $title\n";
}
#logpage($addy,$title);
#logbcm($addy,$title)};
sub logpage{
($addy,$title)=pop @_;
print "$addy";
print "$title\n";
print "Logging address...\n";
my $file="phoenix";
open(LOG,">>$file")or die "Could not open LOG file:$!";
print LOG "$addy:$title "or die "Could not write to LOG file";;
}