mirror of
https://github.com/mouna23/OSINT-with-LLM.git
synced 2026-07-30 18:51:36 +02:00
first commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
def save_report(text, path="reports/report.md"):
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
with open(path, "w", encoding="utf-8") as f:
|
||||
f.write(text)
|
||||
#print(f"[+] Report saved to {path}")
|
||||
|
||||
# Helper to detect input type
|
||||
def is_email(target):
|
||||
return re.match(r"[^@]+@[^@]+\.[^@]+", target)
|
||||
|
||||
def is_ip(target):
|
||||
return re.match(r"\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b", target)
|
||||
|
||||
def is_domain(target):
|
||||
# domain regex (RFC 1035 simplified)
|
||||
domain_regex = r"^(?!-)([a-zA-Z0-9-]{1,63}\.)+[A-Za-z]{2,}$"
|
||||
return re.match(domain_regex, target) is not None
|
||||
Reference in New Issue
Block a user