13 Years of Service
24%
Code:
>#! /usr/bin/perl -w
#########################################
# > Admin Panel Finder. #
#########################################
# Version: 2.1 #
# Author: @mvrech #
#########################################
#########################################
# Includes, uses and vars
#########################################
use strict;
use Encode;
use warnings;
use Getopt::Std;
use HTTP::Request;
use HTTP::Response;
use LWP::UserAgent;
use HTML::LinkExtor;
use Term::ANSIColor qw(:constants);
#########################################
my %options=();
getopts("f:t:p:T:c:hv", \%options);
my $proxy = $options{p};
my $archive = $options{f};
my (@path, @is_found, @db, @filter);
my $file;
my $cooldown = '0';
my $timeout = '30';
#########################################
# Filters and Desing
#########################################
system("clear");
if ($options{h}){
&help;
}
if ($options{v}){
&version;
}
if (not defined $options{t}){
&help;
}
if (not defined $options{f}){
&help;
}
$timeout = $options{T} if defined $options{T};
$cooldown = $options{c} if defined $options{c};
#########################################
open(ESTATICAS, 'foreach(){
push(@path, $_);
chomp;
}
close(ESTATICAS);
#########################################
my $target = $options{t};
if ($target !~ /^http:/){
$target = 'http://'.$target;
}
if ($target !~ /\/$/){
$target .= '/';
}
#########################################
system ("clear");
print BLUE, "[-] looking for the panel.\n", RESET;
print BOLD YELLOW, "[+] target: ", RESET, "$target\n";
print BOLD YELLOW, "[+] timeout: ", RESET, "$timeout\n";
if (not defined $proxy){
print BOLD YELLOW, "[+] proxy: ", RESET, "no proxy.\n";
}else{
print BOLD YELLOW, "[+] proxy: ", RESET, "$proxy.\n";
}
print BLUE, "[-] please wait.\n\n", RESET;
#########################################
my $ua = LWP::UserAgent->new(
agent => 'Mozilla/5.0 (Windows NT 6.2; rv:9.0.1) Gecko/20100101 Firefox/9.0.1',
timeout => $timeout
);
if ($proxy){
if ($proxy !~ /^http:/) {
$proxy = 'http://'.$proxy;
}
$ua->proxy('http', $proxy);
}
#########################################
&panel_search($target);
my $i = @is_found;
if($i){
print "-"x80;
&file_quest;
}else{
print BOLD RED, "[-] Sorry no matches.\n", RESET;
print "-"x80;
&crawler_quest;
$i = @is_found;
if(!$i){
print BOLD RED, "[-] Sorry no matches.\n", RESET;
exit();
}else{
&file_quest;
}
}
#########################################
# Subs
#########################################
sub panel_search{
foreach my $tmp(@path){
my $url = $_[0].$tmp;
my $req = HTTP::Request->new(GET=>$url);
my $res = $ua->request($req);
if(($res->content !~ //) &&
( $res->content =~ m/type=["']password["']/i ||
$res->content =~ m/type=password/i
)){
print BOLD RED, "\t[!] Found: ", RESET, "\t$url";
push (@is_found, $url."\n");
}
sleep($cooldown);
}
print "\n";
}
#########################################
sub file_quest{
print BLUE, "[-] you would like to save the results to a file? [y/N]: ", RESET;
chop(my $choice = );
if($choice =~ /^y/){
print BLUE, "[-] write the filename: ", RESET;
chop($file = );
open (LOGS, '>>', $file) || die "Cannot create $file file: $!";
foreach my $tmp(@is_found){
print LOGS $tmp;
}
close LOGS;
print BLUE, "[-] $file created successfully.\n", RESET;
exit();
}elsif( $choice =~ /^n/){
print "[-] ok.\n";
exit();
}else{
print BOLD RED"[-] this is not a valid option.\n\n", RESET;
&file_quest;
}
}
#########################################
sub crawler_quest{
print CYAN, "[-] you would like using a web crawler to find your panel? [y/N]: ", RESET;
chop(my $choice = );
if ($choice =~ /^y/i){
system("clear");
print BLUE, "[-] starting crawler search.\n[-] Wait a few minutes.\n\n", RESET;
&do_crawler($target);
}elsif ($choice =~ /^n/i){
print BLUE, "[-] ok.\n", RESET;
exit();
}else{
print BOLD RED, "[-] this is not a valid option.\n\n", RESET;
&crawler_quest;
}
}
#########################################
sub do_crawler{
my $is_site = $_[0];
push(@db, $is_site);
$is_site =~ /www.(.+?)\./;
$is_site = $1;
print BLUE, "[-] crawling all url's.\n\n", RESET;
while (@db) {
my $page = shift @db;
my $req = HTTP::Request->new(GET => $page);
my $res = $ua->request($req);
if ($res->is_error()) {printf "%s\n", $res->status_line;}
my $contents = $res->content();
my ($page_parser) = HTML::LinkExtor->new(undef, $page);
$page_parser->parse(decode_utf8($contents))->eof;
my @links = $page_parser->links;
foreach my $url(@links) {
if (($$url[2] =~ /$is_site/) && ($$url[2] !~ /.gif$/) && ($$url[2] !~ /.jpg$/) && ($$url[2] !~ /.png$/) && ($$url[2] !~ /.css$/) && ($$url[2] !~ /.jpeg$/) && ($$url[2] !~ /.txt$/) && ($$url[2] !~ /.ico$/) && ($$url[2] !~ /.g$/) && ($$url[2] !~ /^mailto/) ){
LOOP: {
foreach my $test (@filter){
if ($test eq $$url[2]){
last LOOP;
}
}
&crawl_panel($$url[2]);
push @db, $$url[2];
push @filter, $$url[2];
}
}
}
}
}
#########################################
sub crawl_panel{
my $tmp = $_[0];
my $req = HTTP::Request->new(GET=>$tmp);
my $res = $ua->request($req);
if(($res->content !~ //) &&
( $res->content =~ m/type=["']password["']/i ||
$res->content =~ m/type=password/i
)){
print BOLD RED, "\t[!] Found: ", RESET, "\t$tmp\n";
push (@is_found, $tmp."\n");
}
sleep($cooldown);
}
#########################################
sub version{
print BOLD RED, '
[+] visit: ',BOLD WHITE, 'lemonslab.wordpress.com', RESET BLUE,'
_______ __
| | |__|.----.-----.--.--.-----.
| | || __|__ --| | |__ --|
|___|___|__||____'; #chunky
print BOLD YELLOW,' Panel Finder 2.1 ',RESET BLUE, '|
', BOLD YELLOW, ' ',RESET BLUE, '
Hicsus Panel Finder 2.1
> created and devolped by ', BOLD YELLOW '@mvrech', RESET,"\n\n\a";
exit();
}
#########################################
sub help{
print BLUE, "[-] Welcome to 2.2 version of panel finder.\n", RESET;
print BLUE, "[-] you can stop the program using ctrl + C :D\n", RESET;
print BLUE, "[-]", RESET, " usage: perl $0 ", GREEN, "[OPTIONS]"."\n\n", RESET;
print "\t-t \ttarget url.\n";
print "\t-f \tstatics file.\n";
print "\t-c \tdefine a cooldown, in seconds. [ optional ].\n";
print "\t-T \tset a timeout. [default value is 30].\n";
print "\t-p \tdefine a HTTP proxy. [ optional ].\n";
print "\t-h \tshow this menu.\n\n";
print "\tExemple:\n", BOLD YELLOW, "[~]", RESET, " perl $0 -t www.victim.com -f panels.txt"."\n\n";
print BLUE, "[-]", RESET, " created and devolped by ", BOLD YELLOW, "\@mvrech\n\a", RESET;
exit();
}
#########################################