static public void data_NewDNSDomain(object sender, EventArgs e) { // Nuevo dominio DNS extraido if (sender is DomainsItem) { DomainsItem domain = (DomainsItem)sender; //Solo se hace fingerPrinting a los dominios principales y alternativos List <string> mainDomains = new List <string>(); if (string.IsNullOrEmpty(Program.data.Project.Domain)) { return; } bool existeFP = false; for (int fpI = 0; fpI < domain.fingerPrinting.Count(); fpI++) { FingerPrinting fp = domain.fingerPrinting[fpI]; if (fp is DNS) { existeFP = true; } } if (existeFP) // Si ya existe un fp previo de DNS, no se vuelve a realizar { return; } FingerPrinting fprinting = new DNS(domain.Domain); fprinting.FingerPrintingFinished += new EventHandler(AsociateFingerPrinting); Thread t = new Thread(new ThreadStart(fprinting.GetVersion)); t.IsBackground = true; Program.data.tasker.AddTask(new FOCA.TaskManager.TaskFOCA(t, null, "Fingerprinting DNS (" + domain.Domain + ":53)")); } }
public static void fprinting_FingerPrintingError(object sender, EventArgs e) { FingerPrinting fp = (FingerPrinting)sender; Log l = new Log(Log.ModuleType.FingingerPrinting, "Error fingerprinting " + fp.Host + ":" + fp.Port, Log.LogType.error); Program.LogThis(l); }
static public void data_NewMXDomain(object sender, EventArgs e) { // Nuevo dominio MX extraido if (sender is DomainsItem domain) { //Solo se hace fingerPrinting a los dominios principales y alternativos List <string> mainDomains = new List <string>(); if (string.IsNullOrEmpty(Program.data.Project.Domain)) { return; } mainDomains.Add(Program.data.Project.Domain); mainDomains.AddRange(Program.data.Project.AlternativeDomains); if (!mainDomains.Any(D => domain.Domain.EndsWith(D))) { return; } bool existeFP = false; for (int fpI = 0; fpI < domain.fingerPrinting.Count; fpI++) { FingerPrinting fp = domain.fingerPrinting[fpI]; if (fp is SMTP) { existeFP = true; } } if (existeFP) // Si ya existe un fp previo de SMTP, no se vuelve a realizar { return; } FingerPrinting fprinting = new SMTP(domain.Domain, 25); fprinting.FingerPrintingFinished += new EventHandler(AsociateFingerPrinting); Thread t = new Thread(new ThreadStart(fprinting.GetVersion)); t.IsBackground = true; Program.data.tasker.AddTask(new FOCA.TaskManager.TaskFOCA(t, null, "Fingerprinting SMTP (" + domain.Domain + ":25)")); } }
static public void data_NewWebDomain(object sender, EventArgs e) { // Nuevo dominio web extraido if (sender is DomainsItem) { DomainsItem domain = (DomainsItem)sender; //Solo se hace fingerPrinting a los dominios principales y alternativos List <string> mainDomains = new List <string>(); mainDomains.Add(Program.data.Project.Domain); mainDomains.AddRange(Program.data.Project.AlternativeDomains); if (!mainDomains.Any(D => domain.Domain.EndsWith(D))) { return; } bool existeFP = false; for (int fpI = 0; fpI < domain.fingerPrinting.Count(); fpI++) { FingerPrinting fp = domain.fingerPrinting[fpI]; if (fp is HTTP) { existeFP = true; } } if (existeFP) // Si ya existe un fp previo de HTTP, no se vuelve a realizar { return; } // Se hace el fingerprinting por HOST/80/443 y IP/80/443 // FP por HOST:80 FingerPrinting fprintingHost = new HTTP(domain.Domain, "/", 80, false); fprintingHost.FingerPrintingFinished += new EventHandler(AsociateFingerPrinting); fprintingHost.FingerPrintingError += new EventHandler(fprinting_FingerPrintingError); Thread tHost = new Thread(new ThreadStart(fprintingHost.GetVersion)); tHost.IsBackground = true; Program.data.tasker.AddTask(new FOCA.TaskManager.TaskFOCA(tHost, null, "Fingerprinting HTTP (" + domain.Domain + ":80)")); // FP por HOST:443 SSL fprintingHost = new HTTP(domain.Domain, "/", 443, true); fprintingHost.FingerPrintingFinished += new EventHandler(AsociateFingerPrinting); fprintingHost.FingerPrintingError += new EventHandler(fprinting_FingerPrintingError); tHost = new Thread(new ThreadStart(fprintingHost.GetVersion)); tHost.IsBackground = true; Program.data.tasker.AddTask(new FOCA.TaskManager.TaskFOCA(tHost, null, "Fingerprinting HTTPS (" + domain.Domain + ":443)")); try { // FP por IP:80 string ip = Program.data.GetResolutionIPs(domain.Domain)[0].Ip; FingerPrinting fprintingIP = new HTTP(ip, "/", 80, false); fprintingIP.FingerPrintingFinished += new EventHandler(AsociateFingerPrinting); fprintingIP.FingerPrintingError += new EventHandler(fprinting_FingerPrintingError); Thread tIP = new Thread(new ThreadStart(fprintingIP.GetVersion)); tIP.IsBackground = true; Program.data.tasker.AddTask(new FOCA.TaskManager.TaskFOCA(tIP, null, "Fingerprinting HTTP (" + ip + ":80)")); // FP por IP:443 SSL ip = Program.data.GetResolutionIPs(domain.Domain)[0].Ip; fprintingIP = new HTTP(ip, "/", 443, true); fprintingIP.FingerPrintingFinished += new EventHandler(AsociateFingerPrinting); fprintingIP.FingerPrintingError += new EventHandler(fprinting_FingerPrintingError); tIP = new Thread(new ThreadStart(fprintingIP.GetVersion)); tIP.IsBackground = true; Program.data.tasker.AddTask(new TaskManager.TaskFOCA(tIP, null, "Fingerprinting HTTPS (" + ip + ":443)")); } catch { } } }