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

 

 


Tema destacado: Usando Git para manipular el directorio de trabajo, el índice y commits (segunda parte)


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP) (Moderador: kub0x)
| | | |-+  [C#] King Spam 0.2
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [C#] King Spam 0.2  (Leído 1,560 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[C#] King Spam 0.2
« en: 17 Octubre 2014, 16:09 pm »

Un simple programa estilo consola en C# para hacer spam en un canal IRC desde un archivo de texto con el spam a enviar.

El codigo :

Código
  1. // King Spam 0.2
  2. // (C) Doddy Hackman 2014
  3.  
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Text;
  7.  
  8. using System.IO;
  9. using System.Net;
  10. using System.Net.Sockets;
  11. using System.Text.RegularExpressions;
  12.  
  13. namespace kingspam
  14. {
  15.    class Program
  16.    {
  17.  
  18.        static string[] usuarios;
  19.  
  20.        static StreamReader leer_datos;
  21.        static StreamWriter mandar_datos;
  22.  
  23.        static void printear_logo(string texto)
  24.        {
  25.  
  26.            Console.ForegroundColor = ConsoleColor.Red;
  27.            Console.WriteLine(texto);
  28.            Console.ResetColor();
  29.  
  30.        }
  31.  
  32.        static void printear(string texto)
  33.        {
  34.  
  35.            Console.ForegroundColor = ConsoleColor.Green;
  36.            Console.WriteLine(texto);
  37.            Console.ResetColor();
  38.  
  39.        }
  40.  
  41.        static void printear_especial(string texto)
  42.        {
  43.  
  44.            Console.ForegroundColor = ConsoleColor.Yellow;
  45.            Console.WriteLine(texto);
  46.            Console.ResetColor();
  47.  
  48.        }
  49.  
  50.        static string print_form(string texto)
  51.        {
  52.  
  53.            Console.ForegroundColor = ConsoleColor.Green;
  54.            Console.Write(texto);
  55.            Console.ResetColor();
  56.  
  57.            Console.ForegroundColor = ConsoleColor.Cyan;
  58.            string resultado = Console.ReadLine();
  59.            Console.ResetColor();
  60.  
  61.            return resultado;
  62.  
  63.        }
  64.  
  65.        static void Main(string[] args)
  66.        {
  67.  
  68.            printear_logo("\n-- == KingSpam 0.2 == --\n\n");
  69.  
  70.            string host_irc = print_form("[+] Host : ");
  71.            string port_irc = print_form("\n[+] Port : ");
  72.            string canal_irc = print_form("\n[+] Channel : ");
  73.            string nick_irc = print_form("\n[+] Nickname : ");
  74.            string file_spam = print_form("\n[+] Filename with spam : ");
  75.            string timeout = print_form("\n[+] Timeout : ");
  76.  
  77.            if (File.Exists(file_spam))
  78.            {
  79.                string[] spam_lista_now = System.IO.File.ReadAllLines(file_spam);
  80.                List<string> spam_lista = new List<string> {""};
  81.                foreach (string agregar in spam_lista_now)
  82.                {
  83.                    spam_lista.Add(agregar);
  84.                }
  85.  
  86.                NetworkStream conexion;
  87.                TcpClient irc;
  88.  
  89.                string host = host_irc;
  90.                string nickname = nick_irc;
  91.                string canal = canal_irc;
  92.                string code = "";
  93.  
  94.                printear_especial("\n[+] Connecting ...\n");
  95.  
  96.                try
  97.                {
  98.  
  99.                    irc = new TcpClient(host, Convert.ToInt32(port_irc));
  100.                    conexion = irc.GetStream();
  101.                    leer_datos = new StreamReader(conexion);
  102.                    mandar_datos = new StreamWriter(conexion);
  103.  
  104.                    mandar_datos.WriteLine("NICK " + nickname);
  105.                    mandar_datos.Flush();
  106.  
  107.                    mandar_datos.WriteLine("USER " + nickname + " 1 1 1 1");
  108.                    mandar_datos.Flush();
  109.  
  110.                    mandar_datos.WriteLine("JOIN " + canal);
  111.                    mandar_datos.Flush();
  112.  
  113.                    printear("[+] Online ...");
  114.  
  115.  
  116.                }
  117.  
  118.                catch
  119.                {
  120.                    printear("\n[-] Error\n");
  121.                }
  122.  
  123.                while (true)
  124.                {
  125.                    while ((code = leer_datos.ReadLine()) != null)
  126.                    {
  127.  
  128.                        Match regex = Regex.Match(code, "PING(.*)", RegexOptions.IgnoreCase);
  129.                        if (regex.Success)
  130.                        {
  131.                            string te_doy_pong = "PONG " + regex.Groups[1].Value;
  132.                            mandar_datos.WriteLine(te_doy_pong);
  133.                            mandar_datos.Flush();
  134.                        }
  135.  
  136.                        regex = Regex.Match(code, ":(.*) 353 (.*) = (.*) :(.*)", RegexOptions.IgnoreCase);
  137.                        if (regex.Success)
  138.                        {
  139.                            string usuarios_lista = regex.Groups[4].Value;
  140.                            usuarios = usuarios_lista.Split(' ');
  141.                            printear("\n[+] Users Found : " + usuarios.Length + "\n");
  142.                            foreach (string usuario in usuarios)
  143.                            {
  144.                                printear("[+] User : " + usuario);
  145.                            }
  146.                            printear_especial("\n[+] Spammer Online\n");
  147.  
  148.                            while (true)
  149.                            {
  150.  
  151.                                System.Threading.Thread.Sleep(Convert.ToInt32(timeout) * 1000);
  152.  
  153.                                var azar = new Random();
  154.                                int pos = azar.Next(spam_lista.Count);
  155.                                string mensaje = spam_lista[pos];
  156.  
  157.                                if (mensaje != "")
  158.                                {
  159.                                    mandar_datos.WriteLine("PRIVMSG" + " " + canal + " " + mensaje);
  160.                                    mandar_datos.Flush();
  161.                                }
  162.  
  163.                                foreach (string usuario in usuarios)
  164.                                {
  165.                                    if (usuario != nick_irc)
  166.                                    {
  167.                                        if (spam_lista[pos] != "")
  168.                                        {
  169.                                            mandar_datos.WriteLine("PRIVMSG" + " " + usuario + " " + mensaje);
  170.                                            mandar_datos.Flush();
  171.                                        }
  172.                                    }
  173.                                }
  174.                            }
  175.  
  176.                        }
  177.  
  178.  
  179.                    }
  180.  
  181.                }
  182.  
  183.            }
  184.            else
  185.            {
  186.                printear_especial("[-] Error loading file");
  187.            }
  188.  
  189.            Console.ReadLine();
  190.  
  191.        }
  192.    }
  193. }
  194.  
  195. // The End ?
  196.  

Imagenes :





Si lo quieren bajar lo pueden hacer de aca.


En línea

Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.788



Ver Perfil
Re: [C#] King Spam 0.2
« Respuesta #1 en: 17 Octubre 2014, 16:35 pm »

Poniendome a Trollear en el canal IRC no oficial de ElHacker.net en 3, 2, 1...

Nos vemos! :P

PD: Una app muy útil para traviesos como yo xD


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
King of the road
Juegos y Consolas
Cadacher 0 1,536 Último mensaje 20 Abril 2004, 15:37 pm
por Cadacher
Pronostican auge del spam por confirmación y del micro-spam
Noticias
wolfbcn 0 1,673 Último mensaje 10 Enero 2013, 18:33 pm
por wolfbcn
[Delphi] Spam King 0.2
Programación General
BigBear 0 1,477 Último mensaje 14 Junio 2013, 19:04 pm
por BigBear
[Perl] King Spam 1.0
Scripting
BigBear 1 1,940 Último mensaje 16 Mayo 2015, 05:09 am
por scott_
Evony - The King's Return
Software
Gaheru 0 1,776 Último mensaje 1 Febrero 2021, 04:58 am
por Gaheru
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines