-
Notifications
You must be signed in to change notification settings - Fork 35
/
WP-Grab.pl
128 lines (114 loc) · 3.41 KB
/
WP-Grab.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/usr/bin/perl
#WordPress Grab Info
#Coded By Mohamed Riahi 08/20/2017
#don't Change my Fucking Rights
#[Detect User]
#[Detect Version]
#[Detect Theme]
#[Detect Plugins]
use if $^O eq "MSWin32", Win32::Console::ANSI;
use Term::ANSIColor;
use LWP::UserAgent;
use HTTP::Request::Common qw(GET);
use URI::URL;
use Getopt::Long;
$ua = LWP::UserAgent->new(keep_alive => 1);
$ua->agent("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31");
$ua->timeout (10);
GetOptions(
"u=s" => \$site,
);
unless ($site) { help(); }
if ($site) { banner(); }
sub banner() {
print q(
____ ,
/---.'.__ ____//
'--.\ /.---'
_______ \\ //
/.------.\ \| .'/ ______
// ___ \ \ ||/|\ // _/_----.\__
|/ /.-.\ \ \:|< >|// _/.'..\ '--'
// \'. | \'.|.'/ /_/ / \\
// \ \_\/" ' ~\-'.-' \\
// '-._| :H: |'-.__ \\
// {/'==='\}'-._\ ||
|| \\ \|
|| \\ '
|/ \\
||
WP Grab Info v2 ||
Coded BY Mohamed Riahi \\
'
);
print color('bold red')," [";
print color('bold green'),"+";
print color('bold red'),"] ";
print color('bold white'),"$site\n";
user();
Version();
Theme();
Plugin();
}
sub help() {
print color('bold white')," Usage: perl WP-Grab.pl -u http://website.com/";
}
#################### GET USER ####################
sub user(){
$user = $site . '/?author=1';
$getuser = $ua->get($user)->content;
if($getuser =~/author\/(.*?)\//){
print color('bold red')," [";
print color('bold green'),"+";
print color('bold red'),"] ";
print color('bold white'),"User: $1\n";
}else{
print color('bold red')," [";
print color('bold green'),"+";
print color('bold red'),"] ";
print color('bold white'),"Can't Get Username\n";
}
}
#################### GET VERSION ####################
sub Version(){
$getversion = $ua->get($site)->content;
if($getversion =~/content="WordPress (.*?)"/) {
print color('bold red')," [";
print color('bold green'),"+";
print color('bold red'),"] ";
print color('bold white'),"Version: $1\n";
}else{
print color('bold red')," [";
print color('bold green'),"+";
print color('bold red'),"] ";
print color('bold white'),"Can't Get Version\n";
}
}
#################### GET THEME ####################
sub Theme(){
$getheme = $ua->get($site)->content;
if($getheme =~/\/themes\/(.*?)\//){
print color('bold red')," [";
print color('bold green'),"+";
print color('bold red'),"] ";
print color('bold white'),"Theme: $1\n";
}else{
print color('bold red')," [";
print color('bold green'),"+";
print color('bold red'),"] ";
print color('bold white'),"Can't Get Theme\n";
}
}
#################### GET PLUGINs ####################
sub Plugin(){
$getplugin = $ua->get($site)->content;
my %seen;
while($getplugin =~m/\/wp-content\/plugins\/(.*?)\//g){
$plu=$1;
next if $seen{$plu}++; # already seen
print color('bold red')," [";
print color('bold green'),"+";
print color('bold red'),"] ";
print color('bold white'),"Plugin: $plu \n";
}
}