-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
200 lines (116 loc) · 4.29 KB
/
Copy pathmain.py
File metadata and controls
200 lines (116 loc) · 4.29 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
"""
===========================================================
PhishSentinel
Main Application
===========================================================
"""
from colorama import init, Fore
from scanners.url_scanner import URLScanner
from scanners.website_scanner import WebsiteScanner
from scanners.email_scanner import EmailScanner
from scanners.domain_scanner import DomainScanner
from scanners.file_scanner import FileScanner
from utils.logger import log_scan, log_error
from utils.cli import (
print_banner,
print_menu,
print_result,
pause,
)
# Initialize Colorama
init(autoreset=True)
# ==========================================================
# Main Application
# ==========================================================
def main():
while True:
print()
print_banner()
print_menu()
choice = input(Fore.CYAN + "Enter your choice: ").strip()
# --------------------------------------------------
# Exit
# --------------------------------------------------
if choice == "0":
print()
print(Fore.GREEN + "Thank you for using PhishSentinel!")
print(Fore.GREEN + "Stay Safe!")
break
# --------------------------------------------------
# URL Scanner
# --------------------------------------------------
elif choice == "1":
target = input("\nEnter URL: ").strip()
try:
result = URLScanner(target).scan()
log_scan(result)
print_result(result)
except Exception as error:
log_error(error)
print(Fore.RED + f"\nError: {error}")
pause()
# --------------------------------------------------
# Website Scanner
# --------------------------------------------------
elif choice == "2":
target = input("\nEnter Website URL: ").strip()
try:
result = WebsiteScanner(target).scan()
log_scan(result)
print_result(result)
except Exception as error:
log_error(error)
print(Fore.RED + f"\nError: {error}")
pause()
# --------------------------------------------------
# Email Scanner
# --------------------------------------------------
elif choice == "3":
target = input("\nEnter .eml file path: ").strip()
try:
result = EmailScanner(target).scan()
log_scan(result)
print_result(result)
except Exception as error:
log_error(error)
print(Fore.RED + f"\nError: {error}")
pause()
# --------------------------------------------------
# Domain Scanner
# --------------------------------------------------
elif choice == "4":
target = input("\nEnter Domain or URL: ").strip()
try:
result = DomainScanner(target).scan()
log_scan(result)
print_result(result)
except Exception as error:
log_error(error)
print(Fore.RED + f"\nError: {error}")
pause()
# --------------------------------------------------
# File Scanner
# --------------------------------------------------
elif choice == "5":
target = input("\nEnter File Path: ").strip()
try:
result = FileScanner(target).scan()
log_scan(result)
print_result(result)
except Exception as error:
log_error(error)
print(Fore.RED + f"\nError: {error}")
pause()
# --------------------------------------------------
# Invalid Choice
# --------------------------------------------------
else:
print()
print(Fore.RED + "Invalid choice!")
print(Fore.RED + "Please enter a number between 0 and 5.")
pause()
# ==========================================================
# Entry Point
# ==========================================================
if __name__ == "__main__":
main()