mirror of
https://github.com/mouna23/OSINT-with-LLM.git
synced 2026-02-12 12:42:44 +00:00
72 lines
2.1 KiB
Python
72 lines
2.1 KiB
Python
from recon.domain_recon import get_whois, search_shodan, check_domain_virustotal, check_ssl
|
|
from recon.email_recon import search_breaches
|
|
from recon.ip_recon import check_ip
|
|
from llm.llm_analysis import summarize_domain, summarize_email, summarize_ip
|
|
from utils.format import save_report, is_ip, is_email, is_domain
|
|
|
|
# Email data logic
|
|
def get_email_data(email):
|
|
print(f"[+] Recon on: {email}")
|
|
subs = search_breaches(email)
|
|
return subs
|
|
|
|
# Domain data logic
|
|
def get_domain_data(domain):
|
|
print(f"[+] Recon on: {domain}")
|
|
whois = get_whois(domain)
|
|
if not whois:
|
|
whois = "Not found"
|
|
shodandata = search_shodan(domain)
|
|
if not shodandata:
|
|
shodandata = "Not found"
|
|
virustotal_status = check_domain_virustotal(domain)
|
|
if not virustotal_status:
|
|
virustotal_status = "Not found"
|
|
certificate = check_ssl(domain)
|
|
if not certificate:
|
|
certificate = "Not found"
|
|
raw_data = (
|
|
f"WHOIS:\n{whois}\n\n"
|
|
f"Shodan:\n{shodandata}\n\n"
|
|
f"SSL check:\n{certificate}\n\n"
|
|
f"Virustotal status:\n{virustotal_status}"
|
|
)
|
|
return raw_data
|
|
|
|
def get_ip_data(ip):
|
|
result = check_ip(ip)
|
|
return result
|
|
|
|
###############
|
|
# Entry point
|
|
##############
|
|
def run(target):
|
|
valid_format = True
|
|
if is_email(target):
|
|
raw_data = get_email_data(target)
|
|
summary = summarize_email(raw_data)
|
|
|
|
elif is_ip(target):
|
|
raw_data = get_ip_data(target) # We'll add this next
|
|
summary = summarize_ip(raw_data)
|
|
|
|
elif is_domain(target):
|
|
raw_data = get_domain_data(target)
|
|
summary = summarize_domain(raw_data)
|
|
else:
|
|
valid_format = False
|
|
print("\nInvalid target format. Please provide a valid email, IP, or domain.")
|
|
|
|
if valid_format:
|
|
#print("\n[FINAL SUMMARY]:\n", summary) # this prints to console
|
|
save_report(summary) # this writes to report.md
|
|
print("\n[+] Report saved to reports/report.md")
|
|
|
|
# CLI entry
|
|
if __name__ == "__main__":
|
|
import sys
|
|
if len(sys.argv) != 2:
|
|
print("Usage: python main.py <email_or_domain_or_ip>")
|
|
else:
|
|
run(sys.argv[1])
|