-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadminfinder.pl
88 lines (75 loc) · 1.87 KB
/
adminfinder.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
use strict;
use warnings;
use 5.010;
use HTTP::Tiny;
use Switch;
use Term::ANSIColor;
my ($target, $wordlist) = @ARGV;
my ($url) = $target =~ m|^( .*?\. [^/]+ )|x;
my $Client = HTTP::Tiny->new();
my @found = ();
system("clear");
title();
if (not defined $target) {
print "USAGE: \n\tperl adminfinder.pl {TARGET_URI} {WORDLIST}\n\n";
exit;
}
if(not defined $wordlist) {
$wordlist = "wordlist.txt";
}
open my $info, $wordlist or die("Error: Unable to open the file " .$wordlist);
while(my $line = <$info>) {
$line =~ s/\R//g;
my $url2 = "http://" . $url . "/" . $line;
my $response = $Client->get($url2);
switch($response->{status}) {
case 200 {
push(@found, $url2);
print color("bold green");
print $url2 . " is valid!\n";
print color("reset");
}
case 403 {
push(@found, $url2);
print color("bold red");
print $url2 . " is forbidden!\n";
print color("reset");
}
case 500 {
print color("red");
print $url . " responded with internal server error!\n";
print color("reset");
}
case 401 {
push(@found, $url2);
print color("yellow");
print $url2 . " is asking for authentication!\n";
print color("reset");
}
case 404 {
print color("red");
print $url2 . " not found!\n";
print color("reset");
}
else {
print color("yellow");
print $url2 . " responded with status code: " . $response->{status} . "\n";
print color("reset");
}
}
}
print "Valid Pages\n------------------------------------------\n";
while(my $entry = <@found>) {
print $entry . "\n";
}
sub title {
print color("magenta");
print "#################################################\n";
print color("yellow");
print "# Admin Panel Sniffer #\n";
print "# Written by Nightmare #\n";
print color("magenta");
print "#################################################\n";
print color("reset");
return;
}