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)


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


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[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


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Delphi] HTTP FingerPrinting 0.1
Programación General
BigBear 0 1,545 Último mensaje 22 Junio 2013, 17:19 pm
por BigBear
[Perl Tk] HTTP FingerPrinting 0.1
Scripting
BigBear 0 2,668 Último mensaje 14 Septiembre 2013, 00:36 am
por BigBear
Visitantes de la web de la Casa Blanca blancos de software canvas fingerprinting
Noticias
Mister12 0 1,084 Último mensaje 24 Julio 2014, 20:58 pm
por Mister12
[Ruby] HTTP FingerPrinting 0.2
Scripting
BigBear 0 1,525 Último mensaje 12 Julio 2015, 17:27 pm
por BigBear
[Java] HTTP FingerPrinting 0.2
Java
BigBear 0 1,560 Último mensaje 5 Febrero 2016, 15:11 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines