-
Notifications
You must be signed in to change notification settings - Fork 1
/
darkshark.py
58 lines (50 loc) · 1.52 KB
/
darkshark.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
#!/usr/bin/env python3
#Keep above line as first line always! Its a shebang.
#Group- Parth,Gaurav,Manas
#imports
import os
from Interfaces import *
from GUI import *
from Sniffer import *
#from Helpers import *
from Attacks import *
#main function
print_intro() #print introduction on console
filecounter = 1 #initialise counter variable for file
counter = 1 #packet print counter
interfaces = Interface() #initialize interfaces
#Main loop
while True:
print_menu() #display menu
ch=0
while True: #get user input and validate
a = input("Enter Sr No. of your choice: ")
if(a == "1" or a == "2" or a == "3" or a == "4" or a == "5"):
ch = int(a)
break
else:
print("Invalid input! Please enter a valid one.")
#Call function according to user choice
if(ch == 1):
os.system('clear')
#option 1 of menu, listing available interfaces, is interfaces.print_interfaces from 'Interfaces.py'
interfaces.print_interfaces()
elif(ch == 2):
os.system('clear')
#option 2 of menu is print_bpf_list() from 'GUI.py'
print_bpf_list()
elif(ch==3):
os.system('clear')
#option 3 of menu, capturing and sniffing packets, it is capture_packets() from 'Sniffer.py'
filecounter = capture_packets(filecounter)
elif(ch==4):
os.system('clear')
#option 4 of menu: launch attacks, is launch_attacks() from 'Attacks.py'
launch_attacks()
else:
print_exit_message()
#Prompt for staying in the program
to_continue = input("Do you want to stay? (y/n): ")
if to_continue is not ("y" or "Y"):
print_exit_message()
os.system('clear')