-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
executable file
·171 lines (145 loc) · 5.46 KB
/
app.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
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
# app.py
import sys
from time import sleep
from modules.active_ports import ActivePortsMonitor
from modules.connections import ConnectionsMonitor
from modules.fuzzer import Fuzzer
from modules.network_monitor import NetworkTrafficMonitor
from modules.process_stats import ProcessStats
from modules.utils import clear_screen
def main():
while True:
clear_screen()
print("Welcome to AgreatFuzzer")
print("Select an option:")
print("1) Monitoring")
print("2) Fuzzing")
print("3) Exit")
choice = input("Enter your choice: ")
if choice == "1":
monitoring_menu()
elif choice == "2":
fuzzing_menu()
elif choice == "3":
print("Exiting.")
sys.exit(0)
else:
print("Invalid choice. Please try again.")
def monitoring_menu():
while True:
clear_screen()
print("Monitoring Menu:")
print("1) Monitor Network Traffic")
print("2) Monitor Active Connections")
print("3) Monitor Active Ports")
print("4) Display Process Information")
print("5) Back to Main Menu")
choice = input("Enter your choice: ")
if choice == "1":
monitor_network_traffic()
elif choice == "2":
monitor_active_connections()
elif choice == "3":
monitor_active_ports()
elif choice == "4":
display_process_information()
elif choice == "5":
break
else:
print("Invalid choice. Please try again.")
def fuzzing_menu():
while True:
clear_screen()
print("Fuzzing Menu:")
print("1) Mutation-based Fuzzing")
print("2) Generation-based Fuzzing")
print("3) Dictionary-based Fuzzing")
print("4) Hybrid Fuzzing")
print("5) Back to Main Menu")
choice = input("Enter your choice: ")
if choice == "1":
mutation_fuzzing()
elif choice == "2":
generation_fuzzing()
elif choice == "3":
dictionary_fuzzing()
elif choice == "4":
hybrid_fuzzing()
elif choice == "5":
break
else:
print("Invalid choice. Please try again.")
# Monitoring functions
def monitor_network_traffic():
try:
pid = int(input("Enter the PID to monitor network traffic: "))
interval = int(input("Enter the update interval in seconds: "))
network_monitor = NetworkTrafficMonitor(pid)
while True:
sleep(interval)
clear_screen()
network_monitor.display_network_traffic(interval)
except KeyboardInterrupt:
print("Stopping network traffic monitoring.")
input("Press Enter to return to the Monitoring Menu.")
except Exception as e:
print(f"An error occurred: {e}")
input("Press Enter to return to the Monitoring Menu.")
def monitor_active_connections():
pid = int(input("Enter the PID to monitor active connections: "))
connections_monitor = ConnectionsMonitor(pid)
try:
while True:
clear_screen()
connections_monitor.display_connections()
except KeyboardInterrupt:
print("Stopping connections monitoring.")
input("Press Enter to return to the Monitoring Menu.")
def monitor_active_ports():
pid = int(input("Enter the PID to monitor active ports: "))
active_ports_monitor = ActivePortsMonitor(pid)
try:
while True:
clear_screen()
active_ports_monitor.display_active_ports()
except KeyboardInterrupt:
print("Stopping active ports monitoring.")
input("Press Enter to return to the Monitoring Menu.")
def display_process_information():
pid = int(input("Enter the PID to display process information: "))
process_stats = ProcessStats(pid)
process_stats.display_process_info()
input("Press Enter to return to the Monitoring Menu.")
# Fuzzing functions
def mutation_fuzzing():
target_ip = input("Enter the target IP address: ")
target_port = int(input("Enter the target port: "))
protocol = input("Enter the protocol (TCP/UDP/ICMP): ").upper()
iterations = int(input("Enter the number of iterations: "))
fuzzer = Fuzzer()
fuzzer.mutation_based_fuzzing(target_ip, target_port, protocol, iterations)
input("Press Enter to return to the Fuzzing Menu.")
def generation_fuzzing():
target_ip = input("Enter the target IP address: ")
target_port = int(input("Enter the target port: "))
protocol = input("Enter the protocol (TCP/UDP/ICMP): ").upper()
iterations = int(input("Enter the number of iterations: "))
fuzzer = Fuzzer()
fuzzer.generation_based_fuzzing(target_ip, target_port, protocol, iterations)
input("Press Enter to return to the Fuzzing Menu.")
def dictionary_fuzzing():
target_ip = input("Enter the target IP address: ")
target_port = int(input("Enter the target port: "))
protocol = input("Enter the protocol (TCP/UDP/ICMP): ").upper()
wordlist_file = input("Enter the path to the wordlist file: ")
iterations = int(input("Enter the number of iterations: "))
fuzzer = Fuzzer()
fuzzer.dictionary_based_fuzzing(
target_ip, target_port, protocol, wordlist_file, iterations
)
input("Press Enter to return to the Fuzzing Menu.")
def hybrid_fuzzing():
print("Hybrid fuzzing is not yet implemented.")
input("Press Enter to return to the Fuzzing Menu.")
if __name__ == "__main__":
main()