repl.it
@notbehind_you/

Wifi-B-Gone

Python

No description

fork
loading
Files
  • main.py
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
#https://stackoverflow.com/questions/44246527/turn-wifi-off-using-python-on-windows-10
#https://stackoverflow.com/questions/24961246/script-to-find-all-network-adapters-im-connected-to-in-python

import subprocess, os
result = subprocess.check_output("netsh interface show interface", shell=True)
data = str(result)

data = data.strip("\\n")
data = data.strip("\\r\\n\\r\\n'")
data = data.split()
#print(data)

x = len(data)
interface_amount = x / 2

remove_keywords = [
    "Network\\r\\nEnabled", "Enabled", "Connected", "Dedicated", "Interface",
    "Name\\r\\n-------------------------------------------------------------------------\\r\\nEnabled",
    "State", "Type", "\\r\\n\\r\\n", "Host-Only", "b'\\r\\nAdmin", "Network",
    "Enabled", "\\", "\\n"
]
m = set(data) - set(remove_keywords)
print(m)
result = subprocess.check_output(
    "netsh interface set interface 'Ethernet' disabled", shell=False)
data = str(result)
print(data)
Fetching token
?