Aluf

Perl spam bot

Jan 20th, 2015
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.49 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. # This program uses Proc::Queue, install it like this: perl -MCPAN -e 'install Proc::Queue'
  4. # Perl for windows: http://activestate.com/activeperl
  5. # Greetz: ibanez, WAR-GOD, peanuter, krupt, exon, ntwak0, inv
  6. # Flames: aroo, nenolod, all of dronebl, irc-security
  7. # I was going to keep this private, but since my name is constantly
  8. # being slandered by asshats planning to "remove my internetz"
  9. # and such, I figured I'll share this to see if irc-security can
  10. # stop them all.
  11. # I told you asshats to stop slandering my name. Now reap what you sow muthafuckaz.
  12. # -ep0ch
  13. # NOTE: This program reads from a file called 'servers.txt' in the same directory
  14. # the file should look like this:
  15. # irc.whatever.org:6667
  16. # irc.irc-security.com:7000
  17. # Line after line.
  18. #Again, education use only.
  19.  
  20. # Things to configure:
  21.  
  22. $nickname = "WOOHOO";
  23. $user = "OOHOOW";
  24. $usernumber = 10;
  25. $processes = 10;
  26. $message = qq(Your msg goes here, obviously.); #our spam message
  27.  
  28. #End of configuration
  29.  
  30. use Proc::Queue;
  31. use IO::Socket;
  32. Proc::Queue::size($processes);
  33.  
  34. die "Usage: $0 <servers list>\n" unless $ARGV[0];
  35. open (DUMP, $ARGV[0]) or die("Could not open servers list.");
  36. foreach $line (<DUMP>) {
  37. chomp($line);
  38. push (@dump, $line);
  39. }
  40. close(DUMP);
  41.  
  42. foreach $element (@dump) {
  43. my $pid = fork;
  44. if ($pid) {
  45. push(@forked, $pid);
  46. }
  47. elsif ($pid == 0) {
  48. server($element);
  49. exit(0);
  50. }
  51. else {
  52. die "couldnt fork: $!\n";
  53. }
  54. }
  55.  
  56. sub server {
  57. $input = shift;
  58. ($server_ip, $server_port) = split(/:/, $input);
  59. &connect();
  60. }
  61.  
  62. sub connect {
  63. print "* Connecting to $server_ip on port $server_port\n";
  64. $sock = IO::Socket::INET->new(
  65. PeerAddr => "$server_ip",
  66. PeerPort => $server_port,
  67. Proto => 'tcp' );
  68. while ($stuff = <$sock>) {
  69. #print $stuff;
  70. if ($stuff =~ /(NOTICE AUTH)/) {
  71. print $sock "NICK $nickname\r\nUSER $user $user $user $user\r\n";
  72. }
  73. if ($stuff =~ /^PING/) {
  74. print $sock "PONG :" . (split(/ :/, $stuff))[1];
  75. }
  76. if ($stuff =~ /(376|422)/) {
  77. print $sock "LIST\r\n";
  78. }
  79. if ($stuff =~ /:(.*?) 322 (.*?) (.*?) (.*?) :/) {
  80. my $chan = $3;
  81. my $users = $4;
  82. if ($users > $usernumber) {
  83. push(@channels, $chan);
  84. }
  85. }
  86. while (@channels > $count) {
  87. sleep(2);
  88. print $sock "JOIN $channels[$count]\r\n";
  89. print $sock "PRIVMSG $channels[$count] :$message\r\n";
  90. print $sock "PART $channels[$count]\r\n";
  91. print "Sent spam to $channels[$count] on server $server_ip\n";
  92. $count++;
  93. }
  94. }
  95. }
Advertisement
Add Comment
Please, Sign In to add comment