Releases: suchsoak/Wifi-Info-PY
nmcli
Just small corrections
- error handling in nmcli
- Added 404 error
search = os.system("nmcli")
if search == False:
It will look for the nmcli command, if not, just go to the next command in the script
else:
pass
There was a 404 error added
elif r.status_code == 404:
colorama.init()
print(Fore.RED)
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print()
print("Tor is not found", "Status Code: " ,r.status_code)
print()
print("Proxy is not found!", "Status Code: " ,proxy.status_code)
print()
print("vpnproton is not found!", "Status Code: " ,vpnproton.status_code)
print()
print("free-proxy-list is not blocked!", "Status Code: " ,proxylist.status_code)
print()
print("Proxy_list2 is not blocked!", "Status Code: " ,proxylist2.status_code)
...
v.1.0.3
__ __ ______ ________ ______ ______ __ __ ________ ______
| \ _ | \ \ \ \ | \ \ | \ \/ \
| ▓▓ / \ | ▓▓\▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓\▓▓▓▓▓▓ \▓▓▓▓▓▓ ▓▓\ | ▓▓ ▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓
| ▓▓/ ▓\| ▓▓ | ▓▓ | ▓▓__ | ▓▓ | ▓▓ | ▓▓▓\| ▓▓ ▓▓__ | ▓▓ | ▓▓
| ▓▓ ▓▓▓\ ▓▓ | ▓▓ | ▓▓ \ | ▓▓ | ▓▓ | ▓▓▓▓\ ▓▓ ▓▓ \ | ▓▓ | ▓▓
| ▓▓ ▓▓\▓▓\▓▓ | ▓▓ | ▓▓▓▓▓ | ▓▓ | ▓▓ | ▓▓\▓▓ ▓▓ ▓▓▓▓▓ | ▓▓ | ▓▓
| ▓▓▓▓ \▓▓▓▓_| ▓▓_| ▓▓ _| ▓▓_ _| ▓▓_| ▓▓ \▓▓▓▓ ▓▓ | ▓▓__/ ▓▓
| ▓▓▓ \▓▓▓ ▓▓ \ ▓▓ | ▓▓ \ | ▓▓ \ ▓▓ \▓▓▓ ▓▓ \▓▓ ▓▓
\▓▓ \▓▓\▓▓▓▓▓▓\▓▓ \▓▓▓▓▓▓ \▓▓▓▓▓▓\▓▓ \▓▓\▓▓ \▓▓▓▓▓▓
⠠⠞⠑⠭⠞⠶⠠⠑⠙⠊⠞⠕⠗Github: https://github.com/suchsoak⠠⠞⠑⠭⠞⠶⠠⠑⠙⠊⠞⠕⠗
BY:suchsoak
v:1.0.3
Details
Add more additional information to the script, I've fixed the issue on the firewall part. I've added more sites to test the request. I also put bytes in test speed.
for interface in interfaces.values():
if all(key in interface for key in wifi):
if all(interface) is not None:
print ("Inet: ",interface['inet'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
colorama.init()
print(Fore.MAGENTA)
print ("Device: ",interface['device'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print(Style.RESET_ALL)
print ("Inet4: ",interface['inet4'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print ("Inet6: ",interface['inet6'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print ("Netmask: ",interface['netmask'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print ("Netmasks: ",interface['netmasks'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print ("Broadcast: ",interface['broadcast'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print ("Broadcasts: ",interface['broadcasts'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print ("flags: ",interface['flags'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print ("prefixlens: ",interface['prefixlens'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
Add the flags
and prefixlens
print ("flags: ",interface['flags'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print ("prefixlens: ",interface['prefixlens'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
Add psutil.net_connections
net_connections = psutil.net_connections()
for conn in net_connections:
laddr = conn.laddr
raddr = conn.raddr
status = conn.status
pid = conn.pid
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print(f"Local: {laddr.ip}:{laddr.port}")
print(f"Status: {status}")
print(f"PID: {pid}")
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
Add asciiart on nt1
|ooo===ooo===oooo==oooo===ooo===ooo===ooo|
|===ooo===ooo========+==oo===ooo===ooo===|
|====o====oo=+:... . ..:+=oo===ooo===|
|ooo===oo=:. ....... .:=o====ooo|
|====oo=: .:::::::::::+::. :+ooo===|
|===oo: .:+::. ..:+:. :=o===|
|ooo==. :+: ..::++:::. :+: .==ooo|
|===oo=+=+. :+=+::::::+++: +=+=oo===|
|===ooo==. :+:. .:+. :==ooo===|
|ooo===ooo++: .:+++::. :++=oo===ooo|
|===o====oo=. :+oo+:::=o=: .=o===o=o===|
|===ooo===oo=++=o=. +oo++=oo===ooo===|
|ooo===ooo====ooo: :=ooo===ooo===ooo|
|o=o====oo==o=oo=o:. ..==========o=====o|
|===ooo===ooo====oo=++=ooo===ooo===ooo===|
Add more site in firewall test
r = requests.get('https://www.torproject.org/')
proxy = requests.get('https://www.proxysite.com/')
vpnproton = requests.get('https://protonvpn.com/')
proxylist = requests.get('https://free-proxy-list.net/')
proxylist2 = requests.get('https://www.proxyscrape.com/free-proxy-list')
OnWorks = requests.get('https://www.onworks.net/')
nordvpn = requests.get('https://nordvpn.com/')
shodan = requests.get('https://www.shodan.io/')
zoomeye = requests.get('https://www.zoomeye.org/')
Add bytes in speedtest
print(Speedtest)
print(Style.RESET_ALL)
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print("Download:", speed.download / 1024 / 1024, "Mbps")
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print("Upload:", speed.upload / 1024 / 1024, "Mbps")
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print("Ping:", speed.ping, "ms")
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print("Bytes:", speed.bytes_received, "bytes")
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print("Server:", speed.server['sponsor'])
Bytes
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print("Bytes:", speed.bytes_received, "bytes")
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
Wifi-Info-PY --- Details
__ __ ______ ________ ______ ______ __ __ ________ ______
| \ _ | \ \ \ \ | \ \ | \ \/ \
| ▓▓ / \ | ▓▓\▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓\▓▓▓▓▓▓ \▓▓▓▓▓▓ ▓▓\ | ▓▓ ▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓
| ▓▓/ ▓\| ▓▓ | ▓▓ | ▓▓__ | ▓▓ | ▓▓ | ▓▓▓\| ▓▓ ▓▓__ | ▓▓ | ▓▓
| ▓▓ ▓▓▓\ ▓▓ | ▓▓ | ▓▓ \ | ▓▓ | ▓▓ | ▓▓▓▓\ ▓▓ ▓▓ \ | ▓▓ | ▓▓
| ▓▓ ▓▓\▓▓\▓▓ | ▓▓ | ▓▓▓▓▓ | ▓▓ | ▓▓ | ▓▓\▓▓ ▓▓ ▓▓▓▓▓ | ▓▓ | ▓▓
| ▓▓▓▓ \▓▓▓▓_| ▓▓_| ▓▓ _| ▓▓_ _| ▓▓_| ▓▓ \▓▓▓▓ ▓▓ | ▓▓__/ ▓▓
| ▓▓▓ \▓▓▓ ▓▓ \ ▓▓ | ▓▓ \ | ▓▓ \ ▓▓ \▓▓▓ ▓▓ \▓▓ ▓▓
\▓▓ \▓▓\▓▓▓▓▓▓\▓▓ \▓▓▓▓▓▓ \▓▓▓▓▓▓\▓▓ \▓▓\▓▓ \▓▓▓▓▓▓
⠠⠞⠑⠭⠞⠶⠠⠑⠙⠊⠞⠕⠗Github: https://github.com/suchsoak⠠⠞⠑⠭⠞⠶⠠⠑⠙⠊⠞⠕⠗
BY:suchsoak
v:1.0.2
Details
wifi = ['inet', 'netmask', 'device', 'inet4', 'netmasks', 'broadcast', 'broadcasts']
# Information
for interface in interfaces.values():
if all(key in interface for key in wifi):
if all(interface) is not None:
print ("Inet: ",interface['inet'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
colorama.init()
print(Fore.MAGENTA)
print ("Device: ",interface['device'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print(Style.RESET_ALL)
print ("Inet4: ",interface['inet4'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print ("Inet6: ",interface['inet6'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print ("Netmask: ",interface['netmask'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print ("Netmasks: ",interface['netmasks'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print ("Broadcast: ",interface['broadcast'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print ("Broadcasts: ",interface['broadcasts'])
print ("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
The provided script retrieves information about the Wi-Fi network interfaces of the system.
First, it initializes an empty list called 'wifi'.
Next, it iterates over each interface in the 'interfaces' dictionary. If the current interface contains all the keys listed in the 'wifi' list and if all the values for these keys are not None, the script proceeds to print the relevant network information for the interface.
Here is the specific output provided by the script for each interface:
The IPv4 address ('inet').
The name of the network interface device ('device').
The IPv6 address ('inet6').
The subnet mask ('netmask').
The broadcast address ('broadcast').
Additionally, the script uses the 'colorama' module to color the printed network interface device name.
Family Information
for interface, addresses in add.items():
print(f"Interface: {interface}")
for address in addresses:
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print("Family:", address.family)
print("Address:", address.address)
time.sleep(2)
print("Netmask:", address.netmask)
print("Broadcast:", address.broadcast)
This script displays the IPv4 and IPv6 addresses, Inetmasks, and broadcast addresses for each network interface on the system.
To do this, it iterates over the dictionary items in 'add', where each key represents a network interface and each value is a list of IP address objects for that interface.
For each interface, the script first prints the name of the interface and then iterates over the list of IP address objects for that interface.
For each IP address object, the script prints the family of the IP address (either 'inet' for IPv4 or 'inet6' for IPv6), the IP address itself, the netmask, and the broadcast address.
After printing all the information for an interface, the script waits for 2 seconds before proceeding to the next interface. This provides a convenient way to pause and review the output for each interface.
This script can be helpful for understanding and troubleshooting network connectivity issues.
Other Wifi Information
for device in wifi_info:
try:
wifi_mode = device.mode
wifi_bssid = device.bssid
print()
wifi_ssid = device.ssid
print()
time.sleep(3)
wifi_signal = device.signal
wifi_cha = device.chan
wifi_frequency = device.freq
wifi_security = device.security
print(f"WiFi Mode: {wifi_mode}")
print(f"BSSID: {wifi_bssid}")
colorama.init()
print(Fore.MAGENTA)
print(f"SSID: {wifi_ssid}")
print(Style.RESET_ALL)
print(f"Signal Strength: {wifi_signal}")
print(f"WiFi Chang: {wifi_cha}")
print(f"wifi Frequency: {wifi_frequency}")
print(f"wifi Security: {wifi_security}")
print()
except Exception as error:
print(f"Error: {error}")
This script gathers and prints the Wi-Fi connection details of each device on the network.
To understand the script's logic, we can break it down step by step:
The script iterates over each device in the 'wifi_info'list.
For each device, the script attempts to retrieve various Wi-Fi details, such as the Wi-Fi mode, BSSID, SSID, signal strength, channel, frequency, and security type.
After successfully retrieving the Wi-Fi details for a device, the script prints these details to the console.
If the script encounters an error while trying to retrieve a device's Wi-Fi details, it catches the error and prints the error message to the console.
After printing the Wi-Fi details for a device, the script waits for 3 seconds before proceeding to the next device.
By following these steps, the script gathers and prints the Wi-Fi connection details for each device on the network
Note
This script is specifically designed for networks where devices can connect via Wi-Fi. If the network uses a different type of connection, such as Ethernet, the script would not be able to gather Wi-Fi details for those devices.
Firewall Test
try:
r = requests.get('https://www.torproject.org/')
proxy = requests.get('https://www.proxysite.com/')
vpnproton = requests.get('https://protonvpn.com/')
r.status_code
if r.status_code == 200:
colorama.init()
print(Fore.MAGENTA)
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print()
print("Tor is not blocked!", "Status Code: " ,r.status_code)
print()
print("Proxy is not blocked!", "Status Code: " ,proxy.status_code)
print()
print("Vpnproton is not blocked!", "Status Code: " ,vpnproton.status_code)
print()
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print(Style.RESET_ALL)
elif r.status_code == 403:
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print()
print("Tor is not found", "Status Code: " ,r.status_code)
print()
print("Proxy is not found!", "Status Code: " ,proxy.status_code)
print()
print("vpnproton is not found!", "Status Code: " ,vpnproton.status_code)
print()
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
elif r.status_code == 503:
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print()
print("Tor is not found", r.status_code)
print()
print("Proxy is not found!", "Status Code: " ,proxy.status_code)
print()
print("vpnproton is not found!", "Status Code: " ,vpnproton.status_code)
print()
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
else:
colorama.init()
print(Fore.RED)
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print()
print("Tor rejected, bocked for firewall: ", r.status_code)
print()
print("Proxy blocked for firewall", "Status Code: " ,proxy.status_code)
print()
print("vpnproton blocked for firewall", "Status Code: " ,proxy.status_code)
print()
print("−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−")
print(Style.RESET_ALL)
except Exception as e:
print(e)
This script is designed to check the availability of Tor,proxy and Proton_vpn connections on the internet.
Here's the step-by-step explanation of the script:
The script sends an HTTP GET request to the Tor website URL ('https://www.torproject.org/') using the requests.get() function.
Similarly, the script sends an HTTP GET request to the Proxy Site website URL ('https://www.proxysite.com/') using the requests.get() function.
The script sends an HTTP GET request to the Tor website URL ('https://protonvpn.com/') using the requests.get() function.
The response status code for the HTTP GET request is obtained using the r.status_code attribute.
If the response status code is 200, it means that Tor and proxy connections are not blocked, and the script prints this information along with the status code.
If the response status code is 403, it means that the Tor and proxy websites are not found, and the script prints this information along with the status code.
If the response status code is 503, it means that the Tor and p...