(self, domain)
| 12582 | return {"Status": f" Shodan error: {e}"} |
| 12583 | |
| 12584 | def build_ip_graph(self, domain): |
| 12585 | domain = self._domain_only(domain) |
| 12586 | info = self.analyze_domain_advanced(domain) |
| 12587 | ips = [] |
| 12588 | ips_v4 = info.get(" Indirizzi IPv4 (A)", "") |
| 12589 | ips_v6 = info.get(" Indirizzi IPv6 (AAAA)", "") |
| 12590 | if ips_v4 and ips_v4 != "Record non trovato": |
| 12591 | ips += [x.strip() for x in str(ips_v4).split(",") if x.strip()] |
| 12592 | if ips_v6 and ips_v6 != "Record non trovato": |
| 12593 | ips += [x.strip() for x in str(ips_v6).split(",") if x.strip()] |
| 12594 | ips = list(dict.fromkeys(ips)) # unique preserve order |
| 12595 | |
| 12596 | nodes_dict = {} |
| 12597 | edges = [] |
| 12598 | dom_id = f"dom:{domain}" |
| 12599 | nodes_dict[dom_id] = {"id": dom_id, "label": domain, "shape": "box", "color": {"background": "#0d1326", "border": "#00e5ff"}, "font": {"color": "#ffffff"}} |
| 12600 | |
| 12601 | for ip in ips[:30]: |
| 12602 | ip_id = f"ip:{ip}" |
| 12603 | nodes_dict[ip_id] = {"id": ip_id, "label": ip, "shape": "dot", "size": 18, "color": {"background": "#3b82f6", "border": "#00e5ff"}, "font": {"color": "#ffffff"}} |
| 12604 | edges.append({"from": dom_id, "to": ip_id, "color": {"color": "#00e676"}, "arrows": "to"}) |
| 12605 | |
| 12606 | services, _ = self.scan_ip_services(ip) |
| 12607 | for s in services[:20]: |
| 12608 | svc_id = f"svc:{ip}:{s['port']}" |
| 12609 | nodes_dict[svc_id] = {"id": svc_id, "label": f"{s['service']}:{s['port']}", "shape": "ellipse", "color": {"background": "#070a13", "border": "#1e293b"}, "font": {"color": "#94a3b8", "size": 10}} |
| 12610 | edges.append({"from": ip_id, "to": svc_id, "color": {"color": "#3b82f6"}, "arrows": "to"}) |
| 12611 | |
| 12612 | return {"domain": domain, "ips": ips, "nodes": list(nodes_dict.values()), "edges": edges} |
| 12613 | |
| 12614 | def holehe_scan(self, email, module_timeout=4.0, total_timeout=18, max_results=80): |
| 12615 | email = (email or "").strip() |
no test coverage detected