#!usr/bin/ruby
#KingSpam 0.4
#Coded By Doddy H
require "socket"
$nicks = ["ruben","negro jose","rasputin","juancho"]
def head()
print "\n\n == -- KingSpam 0.4 -- ==\n\n"
end
def uso()
print "\n<ul class="bbc_list"><li type="square"> Sintax : #{$0} <host> <channel> <spam list>\n"[/li][/list]
end
def copyright()
print "\n\n(C) Doddy Hackman 2012\n\n"
end
def read_file(file)
array = []
File.open(file, "r") do |lineas|
while (linea = lineas.gets)
array.push(linea)
end
end
return array
end
def load(host,canal,spam_list)
print "\n</li><li type="square"> Connecting ...\n"[/li][/list]
begin
irc = TCPSocket.open(host,"6667")
rescue
print "\n[-] Error\n"
else
lineas = read_file(spam_list)
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</li><li type="square"> Online\n"[/li][/list]
while 1
code = irc.recv(9999)
#print code+"\n"
if code=~/PING (.*)/
irc.print "PONG #{$1}\n"
end
if code=~/:(.*) 353 (.*) = (.*) <img src="https://underc0de.org/foro/Smileys/default/sad.gif" alt=":(" title="Triste" class="smiley" />.*)/
nicks_found = $4
nicks = nicks_found.split(" ")
end
print "\n</li><li type="square"> The party started\n\n"[/li][/list]
while 1
sleep(20) # 1 minute
texto = lineas[rand(lineas.size)]
print "</li><li type="square"> Spamming channel #{canal}\n"[/li][/list]
irc.print "PRIVMSG #{canal} #{texto}\n"
nicks.flatten.each do |nick|
if nick!=nick_azar
nick = nick.sub("+","")
nick = nick.sub("@","")
print "</li><li type="square"> Spam User : "+nick+"\n"[/li][/list]
irc.print "PRIVMSG #{nick} #{texto}\n"
end
end
end
end
end
end
head()
host = ARGV[0]
canal = ARGV[1]
spam_list = ARGV[2]
if !host and !canal and !spam_list
uso()
else
load(host,canal,spam_list)
end
copyright()
# The End ?