[Ruby] IRC Spam 0.2

Iniciado por BigBear, 11 Febrero 2012, 23:05 PM

0 Miembros y 1 Visitante están viendo este tema.

BigBear

Un simple programa para hacer Spam en un canal de IRC.

Código (ruby) [Seleccionar]

#!usr/bin/ruby
#IRC Spam 0.2
#Coded By Doddy H

$nicks = ["ruben","negro jose","rasputin","juancho"]
$spam = ["hola","chau","hasta","nunca"]

def head()
  print "\n\n == -- IRC Spam 0.2 -- ==\n\n"
end

def uso()
  print "\n[+] Sintax : #{$0} <host> <channel>\n"
end

def copyright()
  print "\n\n(C) Doddy Hackman 2012\n\n"
end

def load(host,canal)
  begin
    irc = TCPSocket.open(host,6667)
  rescue
    print "\n\n[-] Error\n\n"
  else
    nick_azar = $nicks[rand($nicks.size)]
    irc.print "NICK "+nick_azar+"\r\n"
    irc.print "USER "+nick_azar+" 1 1 1 1\r\n"
    irc.print "JOIN #{canal}\r\n"
    print "\n\n[+] Online\n\n"
    while 1
      code = irc.recv(666)

      if (code=~/PING (.*)/)
        irc.print "PONG #{$1}\n"
      end
      print "\n[+] The party started\n"
      while 1
        sleep(60) # 1 minute
        texto = $spam[rand($spam.size)]
        irc.print "PRIVMSG #{canal} #{texto}\n"
      end
    end
  end
end

head()

host = ARGV[0]
canal = ARGV[1]

if !host and !canal
  uso()
else
  load(host,canal)
end

copyright()

# ¿ The End ?