-
Notifications
You must be signed in to change notification settings - Fork 0
/
launcher.py
189 lines (159 loc) · 6.26 KB
/
launcher.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import os
import subprocess
import sys
import Sniffer
import FakeAccessPoint
from scapy.all import *
# Console colors
W = '\033[0m' # white (normal)
R = '\033[31m' # red
G = '\033[32m' # green
O = '\033[33m' # orange
B = '\033[34m' # blue
P = '\033[35m' # purple
C = '\033[36m' # cyan
T = '\033[93m' # tan
ast = '['+B+'*'+W+'] '
min = '['+R+'-'+W+'] '
plu = '['+G+'+'+W+'] '
def check_root():
if not os.geteuid() == 0:
sys.exit(R+'WirelessPrism must be run as root... Exiting'+W)
def print_menu():
print('\n'+G + 'Welcome in Wireless Mayhem Framework, please choose one of the following activities:' + W)
print(O + '[1]' + W + ' Wi-Fi SSID Sniffer')
print(O + '[2]' + W + ' Sensible Data Sniffer')
print(O + '[3]' + W + ' FTP Credential Sniffer')
print(O + '[4]' + W + ' Mail Sniffer')
print(O + '[5]' + W + ' Airodump')
print(O + '[6]' + W + ' Fake Access Point')
def selectMON_interface():
print B+'[INFO]'+W+' Looking for a monitor-mode interface'
cmd = "ifconfig -a | grep mon | cut -d ':' -f1"
try: # cerca interfacce in monitor mode
mon_interfaces = subprocess.check_output(cmd, shell=True)
print mon_interfaces
except:
print R+'[ERROR]'+W+' No monitor-mode interfaces found'
mon_interfaces = False
# cerca interfacce wireless wlanX
if not mon_interfaces:
cmd = "ifconfig -a | grep wlan | cut -d ':' -f1"
print B+'[INFO]'+W+' Looking for a Wlan interface'
try:
wlan_interfaces = subprocess.check_output(cmd, shell=True)
print G + '[INFO]' + W + ' Wlan found'
except:
# non ci sono nemmeno interfacce wireless
print R+'[ERROR]'+W+' No Wlan interfaces found... Exiting'
return False
# ci sono interfacce ma esci e metti in monitor
if wlan_interfaces:
print B+'[INFO]'+W+' Please put in monitor mode ("$ airmon-ng start wlanX") one of these interfaces:\n'+wlan_interfaces
return False
else:
interface = raw_input('Enter a Monitor interface: ')
return interface
def selectWLAN_interface():
print B+'[INFO]'+W+' Looking for a Wlan interface'
cmd = "ifconfig -a | grep wlan"
try: #cerca wlan
wlan_interfaces = subprocess.check_output(cmd, shell=True)
print G + '[INFO]' + W + ' Wlan found'
print wlan_interfaces
except:
# non ci sono interfacce wireless
print R+'[ERROR]'+W+' No Wlan interfaces found... Exiting'
return False
# ci sono interfacce!
interface = raw_input('Enter a Wlan interface: ')
return interface
def select_filename():
filename = raw_input('Enter a Filename: ')
return filename
def main():
check_root()
cmd = 'cat images/logo.txt'
os.system(cmd)
while True:
#loop forever looking for an option
try:
print_menu()
input = raw_input()
# options list
if input == '1':
interface = selectMON_interface()
if interface:
print G + '[INFO]' + W + ' Starting Wi-Fi SSID Sniffer'
print G + '[INFO]' + W + ' Waiting for something interesting...'
try:
sniff(iface=interface, prn=Sniffer.ssidSniffer)
except(KeyboardInterrupt, SystemExit):
pass
else:
print R +'[INFO]'+ W+' Exiting'
exit(1)
elif input == '2':
interface = selectMON_interface()
if interface:
print G + '[INFO]' + W + ' Starting Sensible Data Sniffer'
print G + '[INFO]' + W + ' Waiting for something interesting...'
try:
sniff(filter='tcp', iface=interface, prn=Sniffer.sendibleDataSniff, store=0)
except(KeyboardInterrupt, SystemExit):
pass
else:
print R +'[INFO]'+ W+' Exiting'
exit(1)
elif input == '3':
interface = selectWLAN_interface()
if interface:
print G + '[INFO]' + W + ' Starting FTP Credential Sniffer'
print G + '[INFO]' + W + ' Waiting for something interesting...'
try:
sniff(filter='tcp port 21', iface=interface, prn=Sniffer.ftpSniff, store=0)
except(KeyboardInterrupt, SystemExit):
pass
else:
print R +'[INFO]'+ W+' Exiting'
exit(1)
elif input == '4':
interface = selectWLAN_interface()
if interface:
print G + '[INFO]' + W + ' Starting Mail Sniffer'
print G + '[INFO]' + W + ' Waiting for something interesting...'
try:
sniff(filter="tcp port 110 or tcp port 25 or tcp port 143", prn=Sniffer.mailSniff, store=0)
except(KeyboardInterrupt, SystemExit):
pass
else:
print R +'[INFO]'+ W+' Exiting'
exit(1)
elif input == '5':
interface = selectMON_interface()
if interface:
print G + '[INFO]' + W + ' Starting AiroDump'
filename = select_filename()
try:
Sniffer.Airdump(interface, filename)
except(KeyboardInterrupt, SystemExit):
pass
else:
print R +'[INFO]'+ W+' Exiting'
exit(1)
time.sleep(1)
elif input == '6':
print G + '[INFO]' + W + ' Starting Fake Access Point'
try:
fap = FakeAccessPoint.FakeAccessPoint()
fap.setConf()
fap.run()
except(KeyboardInterrupt, SystemExit):
print R + '[INFO]' + W + ' Exiting'
exit(1)
#exiting with ctrlC
except KeyboardInterrupt:
print R +'[INFO]'+ W+' Exiting'
exit(0)
if __name__ == '__main__':
main()