-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
68 lines (55 loc) · 2.11 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# main.py
from search import DossierBuilder
def get_additional_terms() -> list:
"""Get additional search terms from user"""
terms = []
print("\nEnter additional search terms (press Enter without text to finish):")
while True:
term = input("Additional term (or Enter to finish): ").strip()
if not term:
break
terms.append(term)
return terms
def main():
print("OSINT Dossier Builder")
print("--------------------")
# Get main query
main_query = input("Enter main target identifier (username/email/etc): ").strip()
if not main_query:
print("Error: Main query cannot be empty")
return
# Get additional search terms
additional_terms = get_additional_terms()
# Get optional site restriction
site = input("\nEnter specific site to search (optional, e.g. twitter.com): ").strip() or None
try:
# Initialize dossier builder
builder = DossierBuilder()
# Perform search
print("\nSearching...")
if additional_terms:
print(f"Main query: {main_query}")
print(f"Additional terms: {', '.join(additional_terms)}")
results = builder.search(main_query, additional_terms, site)
if not results:
print("No results found.")
return
# Save raw data
raw_file = builder.save_raw_data(results, main_query, additional_terms)
if not raw_file:
print("Error: Failed to save raw data")
return
# Generate dossier
print("\nGenerating dossier...")
dossier_path = builder.generate_dossier(raw_file, main_query, additional_terms)
if dossier_path:
print(f"\nDossier successfully generated: {dossier_path}")
print("\nDone!")
else:
print("\nError: Failed to generate dossier")
except KeyboardInterrupt:
print("\nOperation cancelled by user")
except Exception as e:
print(f"\nAn error occurred: {str(e)}")
if __name__ == "__main__":
main()