-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpdirb.plx
executable file
·47 lines (40 loc) · 1.48 KB
/
pdirb.plx
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
#!/usr/bin/env perl
use v5.34;
use HTTP::Tiny;
use Getopt::Long;
use Term::ANSIColor qw(:constants);
my $usage = "usage: $0 -w [wordlist] -u [url]\n";
GetOptions (
'url=s' => \my $target,
'wordlist=s' => \my $wordlist,
'help' => sub {print $usage and exit 0},
) or die $usage;
my $logo =
"
▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄
█ █ ██ █ ▄ █ █ ▄ █
█ ▄ █ ▄ █ █ █ █ █ █ █▄█ █
█ █▄█ █ █ █ █ █ █▄▄█▄█ █
█ ▄▄▄█ █▄█ █ █ ▄▄ █ ▄ █
█ █ █ █ █ █ █ █ █▄█ █
█▄▄▄█ █▄▄▄▄▄▄██▄▄▄█▄▄▄█ █▄█▄▄▄▄▄▄▄█
";
print BLUE, $logo, RESET;
print BLUE, "[\$] website url : ", RESET;
defined($target) ? print "$target\n" : chomp($target = <>);
print BLUE, "[\$] wordlist path: ", RESET;
defined($wordlist) ? print "$wordlist\n" : chomp($wordlist = <>);
print "\n";
open my $WORDLIST, '<', $wordlist
or die RED, "[!] $!\n";
while(my $line = <$WORDLIST>) {
chomp $line;
# add '/' if it's a directory
$line .= $line =~ /\.[^\.]*$/ ? '' : '/' ;
my $res = HTTP::Tiny->new->get("$target/$line");
if($res->{success}) {
print GREEN, "[✔] $target/$line\n", RESET;
} else {
print RED, "[x] $target/$line\n", RESET;
}
}