├── .gitignore ├── LICENSE.txt ├── README.md ├── images ├── logo │ ├── logo.png │ ├── logo_50x50.ng.png │ ├── logo_50x50.png │ ├── logo_75x75.ng.png │ └── logo_75x75.png └── screenshots │ ├── device_1_3.jpg │ └── who_1_3.jpg ├── install ├── setup.py └── src ├── __pycache__ ├── device.cpython-37.pyc ├── device.cpython-39.pyc ├── who.cpython-37.pyc ├── who.cpython-39.pyc ├── who_is_on_my_wifi.cpython-36.pyc ├── who_is_on_my_wifi.cpython-37.pyc ├── who_is_on_my_wifi.cpython-38.pyc ├── who_is_on_my_wifi.cpython-39.pyc └── wiom_speedtest.cpython-37.pyc ├── device.py ├── who.py ├── who_is_on_my_wifi.egg-info ├── PKG-INFO ├── SOURCES.txt ├── dependency_links.txt ├── entry_points.txt ├── requires.txt └── top_level.txt └── who_is_on_my_wifi.py /.gitignore: -------------------------------------------------------------------------------- 1 | .eggs 2 | .idea 3 | build 4 | dist 5 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Tucna 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Who is on my WiFi

2 | 3 |

GitHub Repo stars 4 | GitHub watchers 5 | GitHub all releases 6 | GitHub release (latest by date) 7 | GitHub repo size 8 | GitHub 9 | GitHub top language

10 | 11 | infoWho-is-on-my-wifi is a Python3 cli project that allows you to see who is stealing your WiFI network, scan your WiFI and show you how many devices are connected. Software can be installed on any Windows and Linux device (Mac not verified). 12 | 13 |

14 | 15 |

Table of contents

16 | 17 | * INSTALLATION
18 | * Pip
19 | * Debian based
20 | * Tarball/ Source
21 | * USAGE
22 | * Command
23 | * Basics
24 | * How to see who is on my wifi?
25 | * How to get information about my device?
26 | * Python3
27 | * Basics
28 | * How to see who is on my wifi?
29 | * How to get information about my device?
30 | * Error
31 | * WinPcapError:
32 | * route: not found:
33 | * SCREENSHOTS
34 | * TO-DO LIST
35 | * LICENSE
36 |
37 | 38 |

INSTALLATION

39 | 40 | 41 | Windows need WinPcap.
42 | 43 |

Pip

44 | 45 | `pip3 install who-is-on-my-wifi`
46 | 47 |

Debian based

48 | 49 | Download the latest debian [package](https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi/releases) and then run the code:
50 | 51 | ```bash 52 | sudo dpkg -i Python-Who-Is-On-My-WiFi*.deb 53 | ``` 54 | Or download the latest deb for example from [release page](https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi/releases) and follow these commands. 55 | 56 | ```bash 57 | ### Download commands ### 58 | wget https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi/releases/download/1.3.5/who-is-on-my-wifi-v1.3.5.deb 59 | 60 | ### Install ### 61 | sudo dpkg -i who-is-on-my-wifi-v1.3.5.deb 62 | rm who-is-on-my-wifi-v1.3.5.deb #remove useless package 63 | 64 | ### Uninstall ### 65 | sudo dpkg -r who-is-on-my-wifi-v1.3.5 66 | ``` 67 | 68 |
69 | 70 | 71 | 72 |

Tarball/ Source

73 | 74 | Download the latest tar [release](https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi/releases). Use any file manager or run command to extract package: 75 | 76 | ```bash 77 | ### Tarball ### 78 | tar -xvzf Python-Who-Is-On-My-WiFi*.tar.gz 79 | 80 | ### Zip ### 81 | unzip Python-Who-Is-On-My-WiFi*.zip 82 | 83 | ### Git ### 84 | git clone https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi.git 85 | 86 | ### Install ### 87 | cd Python-Who-Is-On-My-WiFi* 88 | sudo chmod +x install 89 | ./install 90 | ``` 91 | 92 |

USAGE

93 | 94 |

Command

95 | 96 |

Basics

97 | 98 | ``` 99 | usage: wiom [-h] [-v] [-c] [-d] [-w] [-t] 100 | 101 | Who-Is-On-My-WIFi 102 | 103 | optional arguments: 104 | -h, --help show this help message and exit 105 | -v, --version show current version 106 | -l, --license show Open Source License 107 | -c, --contact show contact 108 | -d, --device show information about your device 109 | -w, --who show who is on your WiFi! 110 | -t , --time int supplement for '-w' command (scanning '-t' seconds) 111 | 112 | GitHub: 113 | ``` 114 | 115 |
116 | 117 |

How to see who is on my wifi?

118 | 119 | !!! You have to run this command as `sudo` or as `Administrator` !!! 120 | 121 | ```shell 122 | linux@name:~$ sudo wiom -w # default scanning time is 10 sec 123 | linux@name:~$ sudo wiom -w -t 5 # scanning wifi for 5 sec 124 | ``` 125 | 126 |
127 | 128 |

How to get information about my device?

129 | 130 | ```shell 131 | linux@name:~$ sudo wiom -d 132 | ``` 133 | 134 |
135 | 136 |

Python3

137 | 138 | 139 |

Basics

140 | 141 | ```python 142 | >>> import who_is_on_my_wifi as wiom 143 | >>> 144 | >>> wiom.help() # help page 145 | >>> wiom.license() # see license 146 | >>> wiom.contact() # contact page 147 | >>> 148 | >>> wiom.who(n) # see who is on my wifi (int('n') is scanning time - optional; default is 10) 149 | >>> wiom.device() # information about wifi and your device 150 | 151 | ``` 152 | 153 |

How to see who is on my wifi?

154 | 155 | !!! You have to run this script as `sudo` or as `Administrator` !!! 156 | 157 | ```python 158 | from who_is_on_my_wifi import * 159 | 160 | WHO = who() # who(n) 161 | for j in range(0, len(WHO)): 162 | comm = f"\n{WHO[j][0]} {WHO[j][1]}\n{WHO[j][2]} {WHO[j][3]}\n{WHO[j][4]} {WHO[j][5]}\n" 163 | print(comm) 164 | 165 | # >>> OUTPUT <<< 166 | 167 | # IP Address: 192.168.0.1 168 | # Mac Address: 38:43:7d:62:42:24 169 | # Device: Compal Broadband Networks, Inc. (router) 170 | 171 | # IP Address: 192.168.0.24 172 | # Mac Address: 10:5b:ad:6c:64:55 173 | # Device: Mega Well Limited 174 | 175 | ... 176 | 177 | ``` 178 |
179 | 180 |

How to get information about my device?

181 | 182 | ```python 183 | from who_is_on_my_wifi import * 184 | 185 | dev = device() 186 | 187 | print(f""" 188 | PC Name: {dev[0]} 189 | PC Product-Name: {dev[1]} 190 | MAC Address: {dev[2]} 191 | IP Address (host): {dev[3]} 192 | IP Address: {dev[4]} 193 | Public IP: {dev[5]} 194 | PC HostName: {dev[6]} 195 | WiFi Name: {dev[7]} 196 | Gateway: {dev[8]} 197 | DNS 1: {dev[9]} 198 | DNS 2: {dev[10]} 199 | Password: {dev[11]} 200 | Security: {dev[12]} 201 | Interface: {dev[13]} 202 | Frequency: {dev[14]} 203 | Signal: {dev[15]} 204 | Channel: {dev[16]} 205 | 206 | 207 | Country: {dev[17]} 208 | Region: {dev[18]} 209 | City: {dev[19]} 210 | Zip Code: {dev[20]} 211 | Latitude: {dev[21]} 212 | Longitude: {dev[22]} 213 | Map: {dev[23]} 214 | ISP: {dev[24]} 215 | """) 216 | ``` 217 | 218 |
219 | 220 |

Error

221 | 222 | 223 |

RuntimeError: Sniffing and sending packets is not available at layer 2: winpcap is not installed

224 | 225 | This error means that you don't have ***WinPcap*** installed.
226 | To fix this you have to [download](https://www.winpcap.org/install/) it from their web page. 227 |
228 | 229 |

/bash/sh: 1: route: not found...

230 | 231 | This error means that you don't have ***net-tools*** installed.
232 | To fix this you have to download it using `sudo apt-get install net-tools` 233 | 234 |
235 | 236 | 237 | 238 |

SCREENSHOTS

239 | 240 | | `wiom -d` | `wiom -w` | 241 | | -------------------------------------------- | -------------------------------------- | 242 | | ![device](images/screenshots/device_1_3.jpg) | ![who](images/screenshots/who_1_3.jpg) | 243 | 244 | 245 |
246 | 247 | 248 |

Error

249 | 250 |

RuntimeError: Sniffing and sending packets is not available at layer 2: winpcap is not installed

251 | This error means that you don't have ***WinPcap*** installed.
252 | To fix this you have to [download](https://www.winpcap.org/install/) it from their web page. 253 |
254 | 255 |

/bash/sh: 1: route: not found...

256 | 257 | This error means that you don't have ***net-tools*** installed.
258 | To fix this you have to download it using `sudo apt-get install net-tools` 259 |
260 | 261 |

TO-DO LIST

262 | 263 | - [ ] Validated MacOS support 264 | - [ ] Add list of verified devices 265 | - [ ] Add WiFi Kill option 266 |
267 | 268 |

LICENSE

269 | 270 | [MIT](https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi/blob/master/LICENSE.txt) 271 | 272 | ```txt 273 | MIT License 274 | 275 | Copyright (c) 2020 Tucna 276 | 277 | Permission is hereby granted, free of charge, to any person obtaining a copy 278 | of this software and associated documentation files (the "Software"), to deal 279 | in the Software without restriction, including without limitation the rights 280 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 281 | copies of the Software, and to permit persons to whom the Software is 282 | furnished to do so, subject to the following conditions: 283 | 284 | The above copyright notice and this permission notice shall be included in all 285 | copies or substantial portions of the Software. 286 | 287 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 288 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 289 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 290 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 291 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 292 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 293 | SOFTWARE. 294 | ``` 295 | -------------------------------------------------------------------------------- /images/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/images/logo/logo.png -------------------------------------------------------------------------------- /images/logo/logo_50x50.ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/images/logo/logo_50x50.ng.png -------------------------------------------------------------------------------- /images/logo/logo_50x50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/images/logo/logo_50x50.png -------------------------------------------------------------------------------- /images/logo/logo_75x75.ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/images/logo/logo_75x75.ng.png -------------------------------------------------------------------------------- /images/logo/logo_75x75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/images/logo/logo_75x75.png -------------------------------------------------------------------------------- /images/screenshots/device_1_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/images/screenshots/device_1_3.jpg -------------------------------------------------------------------------------- /images/screenshots/who_1_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/images/screenshots/who_1_3.jpg -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | echo "" 4 | echo -e "██╗ ██╗██╗ ██████╗ ███╗ ███╗" 5 | echo -e "██║ ██║██║██╔═══██╗████╗ ████║" 6 | echo -e "██║ █╗ ██║██║██║ ██║██╔████╔██║" 7 | echo -e "██║███╗██║██║██║ ██║██║╚██╔╝██║" 8 | echo -e "╚███╔███╔╝██║╚██████╔╝██║ ╚═╝ ██║" 9 | echo -e " ╚══╝╚══╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝" 10 | echo "" 11 | echo " <-> version v1.3.5 <->" 12 | echo " <-> https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi <->" 13 | echo "" 14 | 15 | if [[ "$OSTYPE" == "linux-gnu"* ]]; then 16 | read -p "Are you sure you want to install who-is-on-my-wifi? [Y/n]: " ask0 17 | if [[ $ask0 == "Y" || $ask0 == "y" ]]; then 18 | PW=$pwd 19 | sudo pip3 install scapy 20 | sudo pip3 install getmac 21 | sudo python3 setup.py install 22 | 23 | apppth="/usr/share/applications/wiom.desktop" 24 | 25 | sudo touch $apppth 26 | sudo echo "[Desktop Entry]" > $apppth 27 | sudo echo "Version=1.3.5" >> $apppth 28 | sudo echo "Type=Application" >> $apppth 29 | sudo echo "Name=Who-Is-On-My-WiFi" >> $apppth 30 | sudo echo "Comment=See who is stealing your WiFI network! Scan your WiFI! See how many devices are connected." >> $apppth 31 | sudo echo "Exec=$pw/src/who_is_on_my_wifi.py" >> $apppth 32 | sudo echo "Path=$PW" >> $apppth 33 | sudo echo "Icon=$PW/images/logo/logo.png" >> $apppth 34 | sudo echo "Terminal=true" >> $apppth 35 | sudo echo "StartupNotify=false" >> $apppth 36 | sudo echo "Categories=Network;" >> $apppth 37 | 38 | sudo chmod +x $apppth 39 | 40 | distro=$(which apt) 41 | nett=$(which route) 42 | if [ comm == "" ]; then 43 | echo -e "\nInstalling net-tools..." 44 | sudo apt-get install net-tools -y 45 | fi 46 | 47 | if [ $distro == "" ]; then 48 | if [ comm == "" ]; then 49 | echo "Your distribution is not Debian based." 50 | echo "Please install 'net-tools' otherwise app won't work." 51 | fi 52 | exit 53 | fi 54 | 55 | fi 56 | fi 57 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | import platform 3 | 4 | with open('README.md', encoding='utf-8') as f: 5 | long_description = f.read() 6 | 7 | if platform.system() == "Windows": 8 | inst = "getmac", "scapy", "wmi" 9 | else: 10 | inst = "getmac", "scapy" 11 | 12 | setup( 13 | name='who-is-on-my-wifi', 14 | version='1.3.5', 15 | scripts=["src/who_is_on_my_wifi.py", "src/who.py", "src/device.py"], 16 | description="Help you to find who is stealing your WiFI network, scan your WiFI and show you how many devices are currently connected!", 17 | url="https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi", 18 | author="Karel Velicka", 19 | author_email="tucnakomet@gmail.com", 20 | py_modules=["who_is_on_my_wifi", "who", "device"], 21 | package_dir={"": "src"}, 22 | long_description=long_description, 23 | long_description_content_type='text/markdown', 24 | platforms=['any'], 25 | license="MIT", 26 | install_requires=[inst], 27 | classifiers=[ 28 | "Environment :: Console", 29 | "Programming Language :: Python :: 3", 30 | "Programming Language :: Python :: 3.6", 31 | "Programming Language :: Python :: 3.8", 32 | "Programming Language :: Python :: 3.9", 33 | "License :: OSI Approved :: MIT License", 34 | "Operating System :: POSIX", 35 | "Operating System :: Unix", 36 | 'Operating System :: Microsoft :: Windows', 37 | "Operating System :: OS Independent", 38 | ], 39 | entry_points={ 40 | 'console_scripts': [ 41 | 'wiom=who_is_on_my_wifi:main', 42 | 'who-is-on-my-wifi=who_is_on_my_wifi:main', 43 | ], 44 | }, 45 | ) 46 | -------------------------------------------------------------------------------- /src/__pycache__/device.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/src/__pycache__/device.cpython-37.pyc -------------------------------------------------------------------------------- /src/__pycache__/device.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/src/__pycache__/device.cpython-39.pyc -------------------------------------------------------------------------------- /src/__pycache__/who.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/src/__pycache__/who.cpython-37.pyc -------------------------------------------------------------------------------- /src/__pycache__/who.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/src/__pycache__/who.cpython-39.pyc -------------------------------------------------------------------------------- /src/__pycache__/who_is_on_my_wifi.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/src/__pycache__/who_is_on_my_wifi.cpython-36.pyc -------------------------------------------------------------------------------- /src/__pycache__/who_is_on_my_wifi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/src/__pycache__/who_is_on_my_wifi.cpython-37.pyc -------------------------------------------------------------------------------- /src/__pycache__/who_is_on_my_wifi.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/src/__pycache__/who_is_on_my_wifi.cpython-38.pyc -------------------------------------------------------------------------------- /src/__pycache__/who_is_on_my_wifi.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/src/__pycache__/who_is_on_my_wifi.cpython-39.pyc -------------------------------------------------------------------------------- /src/__pycache__/wiom_speedtest.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tucnakomet1/Python-Who-Is-On-My-WiFi/7384ddaaf6419b5958e6ff60324f0a555fb54c2c/src/__pycache__/wiom_speedtest.cpython-37.pyc -------------------------------------------------------------------------------- /src/device.py: -------------------------------------------------------------------------------- 1 | from scapy.all import * 2 | 3 | import urllib.request 4 | import subprocess 5 | import platform 6 | import socket 7 | import getmac 8 | import re 9 | 10 | if platform.system() == "Windows": import wmi 11 | 12 | 13 | def check_ipv(out): 14 | ipv4 = "((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" 15 | ipv6 = "(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:" \ 16 | "[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:" \ 17 | "[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}" \ 18 | "(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:" \ 19 | ")|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}" \ 20 | "[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]" \ 21 | "|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))" 22 | 23 | x = re.search(ipv4, out) 24 | y = re.search(ipv6, out) 25 | 26 | if x and y: out = out.replace(" ", ", ") 27 | return out 28 | 29 | 30 | def get_output(command, url=False, i=0): 31 | ipv_warn = "hostname -I" 32 | check = False 33 | 34 | if command == ipv_warn: check = True 35 | 36 | try: 37 | if url: 38 | inp = urllib.request.urlopen(command) 39 | out = inp.read().decode("utf-8").split() 40 | return out[i] 41 | else: 42 | inp = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 43 | out = inp.stdout.readlines() 44 | out = out[i].decode("utf-8").replace("\n", "") 45 | 46 | if out == "" or out == []: return "unknown" 47 | if check: return check_ipv(out) 48 | 49 | return out 50 | except: 51 | return "unknown" 52 | 53 | 54 | def get_new_wifi_name(wifi_nm): 55 | part1 = get_output("sudo nmcli -s -g 802-11-wireless-security.psk | grep 'to' | awk '{print $4}'") 56 | part2 = get_output("sudo nmcli -s -g 802-11-wireless-security.psk | grep 'to' | awk '{print $5}'") 57 | new_wifi = part1 + " " + part2 58 | 59 | return new_wifi 60 | 61 | 62 | def get_pass(wifi_password, WifiName): 63 | if WifiName == "unknown": 64 | return "unknown" 65 | else: 66 | password = get_output(wifi_password + WifiName) 67 | 68 | if password == "unknown": 69 | return get_output(wifi_password + f"'{get_new_wifi_name(WifiName)}'") 70 | return password 71 | 72 | 73 | def calculate_signal_strength(): 74 | try: 75 | word_strength = "unknown" 76 | signal = int(get_output("iwconfig | grep level | awk '{print $4}'").replace("level=", "")) 77 | 78 | if -30 <= signal: 79 | word_strength = "super strong" 80 | elif (-30 > signal) and (-50 <= signal): 81 | word_strength = "excellent signal" 82 | elif (-50 > signal) and (-67 <= signal): 83 | word_strength = "good signal" 84 | elif (-67 > signal) and (-70 <= signal): 85 | word_strength = "reliable signal" 86 | elif (-70 > signal) and (-80 <= signal): 87 | word_strength = "not strong signal" 88 | elif (-80 > signal) and (-90 <= signal): 89 | word_strength = "unreliable signal" 90 | elif signal < -90: 91 | word_strength = "super weak signal" 92 | 93 | return f"{signal} DBm, {word_strength}" 94 | except: 95 | return "unknown" 96 | 97 | 98 | def get_route(public_IP): 99 | try: 100 | response = urllib.request.urlopen(f"https://ip-api.io/json/{public_IP}") 101 | return response.read().decode("utf-8").replace(',', '":').replace("}", "").split('":') 102 | except: 103 | return "unknown" 104 | 105 | 106 | def get_route_arg(route, index): 107 | if route != "unknown": 108 | return route[index].replace('"', '') 109 | else: 110 | return "unknwon" 111 | 112 | 113 | def device(): 114 | plat = platform.system() 115 | 116 | public_IP = get_output("https://icanhazip.com", True) 117 | if public_IP == "unknown": public_IP = get_output("ifconfig.me") 118 | 119 | route = get_route(public_IP) 120 | country = get_route_arg(route, 9) 121 | regionN = get_route_arg(route, 33) 122 | city = get_route_arg(route, 3) 123 | zipC = get_route_arg(route, len(route)-1) 124 | lat = get_route_arg(route, 23) 125 | lon = get_route_arg(route, 25) 126 | maps = f"https://www.google.com/maps/@{lat},{lon},14z" 127 | org = get_route_arg(route, 29) 128 | 129 | if plat == "Linux": 130 | nam = get_output("sudo dmidecode -s system-manufacturer") 131 | product_name = get_output("sudo dmidecode -s baseboard-product-name") 132 | MAC = getmac.get_mac_address() 133 | IP_host = get_output("hostname -i") 134 | IP_All = get_output("hostname -I") 135 | hostname = get_output("hostname") 136 | WifiName = get_output("iwgetid -r") 137 | Gateway = get_output("ip route | grep default | awk '{print $3}'") 138 | DNS1 = get_output("nmcli dev show | grep DNS | awk '{print $2}'") 139 | DNS2 = get_output("nmcli dev show | grep DNS | awk '{print $2}'", False, 1) 140 | password = get_pass("nmcli -s -g 802-11-wireless-security.psk connection show ", WifiName) 141 | security = get_output("sudo wpa_cli status | grep 'key_mgmt'").replace("key_mgmt=", "") 142 | interface = get_output("route | grep default | awk '{print $8}'") 143 | frequency = (get_output("iwgetid -f | awk '{print $2}'") + " GHz").replace("Frequency:", "") 144 | signal_strength = calculate_signal_strength() 145 | channel = get_output("iwgetid -c | awk '{print $2}'").replace("Channel:", "") 146 | 147 | if nam == "unknown": nam = get_output("cat /sys/devices/virtual/dmi/id/sys_vendor") 148 | if product_name == "unknown": product_name = get_output("cat /sys/devices/virtual/dmi/id/product_name") 149 | 150 | return [nam, product_name, MAC, IP_host, IP_All, public_IP, hostname, WifiName, 151 | Gateway, DNS1, DNS2, password, security, interface, frequency, signal_strength, 152 | channel, country, regionN, city, zipC, lat, lon, maps, org] 153 | 154 | # ========================= # 155 | # WINDOWS # 156 | # ========================= # 157 | # not tested 158 | 159 | elif plat == "Windows": 160 | c = wmi.WMI() 161 | system = c.Win32_ComputerSystem()[0] 162 | sql = "select IPAddress,DefaultIPGateway from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE" 163 | c.query(sql) 164 | 165 | def get_ip_all(): 166 | sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 167 | sock.connect(("8.8.8.8", 80)) 168 | return sock.getsockname()[0] 169 | 170 | def get_wifi_name(): 171 | try: 172 | resu = subprocess.check_output(["netsh", "wlan", "show", "network"]) 173 | resu = (resu.decode("ascii")).replace("\r", "").split("\n") 174 | ls = resu[4:] 175 | ls = ls[0].split(": ") 176 | 177 | ssids = [] 178 | 179 | if ls == [""]: 180 | ssids.append("unknown") 181 | else: 182 | if len(ls) >= 3: 183 | ssids.append(": ".join(ls[1:len(ls)])) 184 | else: 185 | ssids.append("".join(ls[1])) 186 | 187 | return "".join(ssids) 188 | except: 189 | return "unknown" 190 | 191 | nam = system.Manufacturer 192 | product_name = system.Model 193 | MAC = getmac.get_mac_address() 194 | IP_host = socket.gethostbyname('localhost') 195 | IP_All = get_ip_all() 196 | hostname = socket.gethostname() 197 | WifiName = get_wifi_name() 198 | 199 | try: 200 | comma = 'nslookup localhost | findstr "Address:"' 201 | processx = subprocess.Popen(comma, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 202 | outx, err = processx.communicate() 203 | outx = outx.decode("utf-8").split() 204 | DNS1 = outx[1] 205 | except: 206 | DNS1 = "unknown" 207 | try: 208 | DNSbytes = DNS1.encode() 209 | process = subprocess.Popen(['ipconfig', '/all'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 210 | out, err = process.communicate() 211 | out = out.split() 212 | indx = [g for g, rs in enumerate(out) if rs == DNSbytes] 213 | DNS2 = out[indx[0] + 1] 214 | DNS2 = DNS2.decode() 215 | except: 216 | DNS2 = "unknown" 217 | 218 | try: 219 | scripton = 'ipconfig -all | findstr "DHCP" | findstr "Server"' 220 | process2 = subprocess.Popen(scripton, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 221 | out2, err2 = process2.communicate() 222 | 223 | out2 = out2.decode().replace(" DHCP Server", "").replace(" .", "").replace(" : ", "").replace("\r\n", "") 224 | Gateway = out2 225 | except: 226 | Gateway = "unknown" 227 | try: 228 | SSID = WifiName 229 | if SSID == "unknown": 230 | password = "unknown" 231 | else: 232 | comm = f"netsh wlan show profile {SSID} key=clear | findstr Key" 233 | ShowProcess2 = subprocess.Popen(comm, stdout=subprocess.PIPE, stderr=None, shell=True) 234 | res2, erra2 = ShowProcess2.communicate() 235 | res2 = res2.decode() 236 | res2 = res2.replace("Key", "").replace("Content", "").replace(":", "").replace(" ", "") 237 | if res2 == "": 238 | password = "unknown" 239 | else: 240 | password = res2.replace("\r", "").replace("\n", "") 241 | except: 242 | password = "unknown" 243 | 244 | try: 245 | secur_stat = subprocess.check_output(["netsh", "wlan", "show", "interfaces"]) 246 | secur_stat = secur_stat.decode("utf-8").split() 247 | secur_index = secur_stat.index("Authentication") 248 | 249 | security = secur_stat[secur_index + 2] 250 | except: 251 | security = "unknown" 252 | 253 | try: 254 | chan_procc = subprocess.check_output(["netsh", "wlan", "show", "interfaces"]) 255 | chan_procc = chan_procc.decode("utf-8").split() 256 | chan_index = chan_procc.index("Channel") 257 | 258 | channel = chan_procc[chan_index + 2] 259 | except: 260 | channel = "unknown" 261 | 262 | try: 263 | freq_procc = subprocess.check_output(["netsh", "wlan", "show", "interfaces"]) 264 | freq_procc = freq_procc.decode("utf-8").split() 265 | freq_index = freq_procc.index("Radio") 266 | freq = freq_procc[freq_index + 3] 267 | 268 | if freq == "802.11a": 269 | frequency = "5 GHz" 270 | elif freq == "802.11b": 271 | frequency = "2.4 GHz" 272 | elif freq == "802.11g": 273 | frequency = "2.4 GHz" 274 | elif freq == "802.11n": 275 | frequency = "2.4 GHz / 5 GHz" 276 | elif freq == "802.11c": 277 | frequency = "5 GHz" 278 | else: 279 | frequency = "unknown" 280 | except: 281 | frequency = "unknown" 282 | 283 | try: 284 | sign_procc = subprocess.check_output(["netsh", "wlan", "show", "interfaces"]) 285 | sign_procc = sign_procc.decode("utf-8").split() 286 | sign_index = sign_procc.index("Signal") 287 | 288 | procenta = sign_procc[sign_index + 2] 289 | 290 | proc = list(procenta) 291 | proc.pop() 292 | proc = int("".join(proc)) 293 | 294 | if proc >= 75: 295 | word_strength = "super strong" 296 | elif proc < 75 and proc >= 50: 297 | word_strength = "strong" 298 | elif proc < 50 and proc >= 25: 299 | word_strength = "weak" 300 | else: 301 | word_strength = "super weak" 302 | 303 | signal_strength = f"{proc} % - {word_strength}" 304 | except: 305 | signal_strength = "unknown" 306 | 307 | try: 308 | inter_procc = subprocess.check_output(["netsh", "wlan", "show", "interfaces"]) 309 | inter_procc = inter_procc.decode("utf-8").split() 310 | inter_index = inter_procc.index("Name") 311 | 312 | interface = inter_procc[inter_index + 2] 313 | except: 314 | interface = "unknown" 315 | 316 | return [nam, product_name, MAC, IP_host, IP_All, public_IP, hostname, 317 | WifiName, Gateway, DNS1, DNS2, password, security, interface, 318 | frequency, signal_strength, channel, country, regionN, city, 319 | zipC, lat, lon, maps, org] 320 | 321 | # ========================= # 322 | # DARWIN # 323 | # ========================= # 324 | # not tested 325 | 326 | if plat == "Darwin": 327 | nam = get_output("system_profiler SPHardwareDataType | grep 'Model Name:' | awk '{print $3}'") 328 | product_name = get_output("system_profiler SPHardwareDataType | grep 'Model Identifier:' | awk '{print $3}'") 329 | MAC = getmac.get_mac_address() 330 | IP_host = get_output("cat /etc/resolv.conf | grep nameserver | awk '{print $2}'") 331 | IP_All = get_output("ipconfig getifaddr en0") 332 | hostname = get_output("hostname") 333 | WifiName = get_output("/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | awk -F' SSID: ' '/ SSID: / {print $2}'") 334 | Gateway = get_output("netstat -rn | grep 'default' | awk '{print $2}'") 335 | DNS1 = get_output("scutil --dns | grep nameserver | awk '{print $3}'") 336 | DNS2 = get_output("nslookup google.com | grep 'Server:' | awk '{print $2}'") 337 | 338 | try: 339 | if WifiName == "unknown": password = "unknown" 340 | else: password = get_output(f"security find-generic-password -ga {WifiName} | grep 'password:'") 341 | except: password = "unknown" 342 | 343 | security = get_output("/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I") 344 | security = security[security.index("link auth") + 1] 345 | interface = get_output("ifconfig") 346 | channel = get_output("/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -c", False, 1) 347 | frequency = get_output("/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -c", False, 2) 348 | 349 | try: 350 | config2 = subprocess.check_output("", stderr=subprocess.STDOUT) 351 | config2 = config2.decode("utf-8").split() 352 | maximum, result_now, dbm = 0, 0, 0 353 | 354 | for mom in range(len(config2)): 355 | if ("level" in config2[mom]): 356 | result_now = mom 357 | result_now = config2[result_now].replace("level=", "") 358 | dbm = mom + 1 359 | dbm = config2[dbm] 360 | 361 | proc = 100 + (int(maximum) + int(result_now)) 362 | word_strength = "" 363 | 364 | if proc >= 75: word_strength = "super strong" 365 | if 75 > proc >= 50: word_strength = "strong" 366 | if 50 > proc >= 25: word_strength = "weak" 367 | if proc < 25: word_strength = "super weak" 368 | 369 | signal = result_now + " " + dbm 370 | signal_strength = f"{signal} ({proc} %) - {word_strength}" 371 | except: 372 | signal_strength = "unknown" 373 | 374 | return [nam, product_name, MAC, IP_host, IP_All, public_IP, 375 | hostname, WifiName, Gateway, DNS1, DNS2, password, 376 | security, interface, frequency, signal_strength, 377 | channel, country, regionN, city, zipC, lat, lon, maps, org] 378 | -------------------------------------------------------------------------------- /src/who.py: -------------------------------------------------------------------------------- 1 | from scapy.all import * 2 | from device import * 3 | 4 | import urllib.request 5 | import platform 6 | import os 7 | 8 | 9 | def who(time=10): 10 | plat = platform.system() 11 | dev = device() 12 | 13 | if ((plat == "Linux") or (plat == "Darwin")) and (os.getuid() == 1000): 14 | print("Please run this command as sudo! (for better result)") 15 | exit() 16 | 17 | WhoList, IPs, MACs, deviceNames = [], [], [], [] 18 | name, product_name, MyMac, MyIP = dev[0], dev[1], dev[2], dev[4] 19 | gateway = dev[8]+"/24" 20 | 21 | MyDeviceList = ["IP Address:", MyIP, "Mac Address:", MyMac, "Device:", f"{name} {product_name} (Your device)"] 22 | start = 0 23 | 24 | while start <= time: 25 | start += 1 26 | 27 | eth = Ether(dst="ff:ff:ff:ff:ff:ff") 28 | arp = ARP(pdst=gateway) 29 | devided = eth/arp 30 | answ = srp(devided, timeout=0.5, verbose=False)[0] # '0.5' because of double attempts per second 31 | 32 | for res in answ: 33 | IP = res[1].psrc 34 | if IP not in IPs: 35 | IPs.append(IP) 36 | 37 | MAC = res[1].hwsrc 38 | MACs.append(MAC) 39 | try: 40 | deviceName = urllib.request.urlopen(f"http://api.macvendors.com/{MAC}") 41 | deviceName = deviceName.read().decode("utf-8") 42 | deviceNames.append(deviceName) 43 | 44 | except: 45 | try: 46 | deviceName = urllib.request.urlopen(f"https://api.maclookup.app/v2/macs/{MAC}") 47 | deviceName = (deviceName.read().decode("utf-8")).split(",") 48 | deviceName = (deviceName[3]).replace('company":', "").replace('"', "") 49 | 50 | if deviceName == "": deviceName = "unknown" 51 | 52 | deviceNames.append(deviceName) 53 | except: 54 | deviceName="unknown" 55 | deviceNames.append(deviceName) 56 | 57 | 58 | for i in range(0, len(IPs)): 59 | if IPs[i] == dev[8]: WhoList.append(["IP Address:", IPs[i], "Mac Address:", MACs[i], "Device:", f"{deviceNames[i]} (router)"]) 60 | else: WhoList.append(["IP Address:", IPs[i], "Mac Address:", MACs[i], "Device:", deviceNames[i]]) 61 | 62 | WhoList.append(MyDeviceList) 63 | 64 | return WhoList 65 | -------------------------------------------------------------------------------- /src/who_is_on_my_wifi.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 2.1 2 | Name: who-is-on-my-wifi 3 | Version: 1.3.5 4 | Summary: Help you to find who is stealing your WiFI network, scan your WiFI and show you how many devices are currently connected! 5 | Home-page: https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi 6 | Author: Karel Velicka 7 | Author-email: tucnakomet@gmail.com 8 | License: MIT 9 | Description:

Who is on my WiFi

10 | 11 |

GitHub Repo stars 12 | GitHub watchers 13 | GitHub all releases 14 | GitHub release (latest by date) 15 | GitHub repo size 16 | GitHub 17 | GitHub top language

18 | 19 | infoWho-is-on-my-wifi is a Python3 cli project that allows you to see who is stealing your WiFI network, scan your WiFI and show you how many devices are connected. Software can be installed on any Windows and Linux device (Mac not verified). 20 | 21 |

22 | 23 |

Table of contents

24 | 25 | * INSTALLATION
26 | * Pip
27 | * Debian based
28 | * Tarball/ Source
29 | * USAGE
30 | * Command
31 | * Basics
32 | * How to see who is on my wifi?
33 | * How to get information about my device?
34 | * Python3
35 | * Basics
36 | * How to see who is on my wifi?
37 | * How to get information about my device?
38 | * Error
39 | * WinPcapError:
40 | * route: not found:
41 | * SCREENSHOTS
42 | * TO-DO LIST
43 | * LICENSE
44 |
45 | 46 |

INSTALLATION

47 | 48 | 49 | Windows need WinPcap.
50 | 51 |

Pip

52 | 53 | `pip3 install who-is-on-my-wifi`
54 | 55 |

Debian based

56 | 57 | Download the latest debian [package](https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi/releases) and then run the code:
58 | 59 | ```bash 60 | sudo dpkg -i Python-Who-Is-On-My-WiFi*.deb 61 | ``` 62 | Or download the latest deb for example from [release page](https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi/releases) and follow these commands. 63 | 64 | ```bash 65 | ### Download commands ### 66 | wget https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi/releases/download/1.3.5/who-is-on-my-wifi-v1.3.5.deb 67 | 68 | ### Install ### 69 | sudo dpkg -i who-is-on-my-wifi-v1.3.5.deb 70 | rm who-is-on-my-wifi-v1.3.5.deb #remove useless package 71 | 72 | ### Uninstall ### 73 | sudo dpkg -r who-is-on-my-wifi-v1.3.5 74 | ``` 75 | 76 |
77 | 78 | 79 | 80 |

Tarball/ Source

81 | 82 | Download the latest tar [release](https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi/releases). Use any file manager or run command to extract package: 83 | 84 | ```bash 85 | ### Tarball ### 86 | tar -xvzf Python-Who-Is-On-My-WiFi*.tar.gz 87 | 88 | ### Zip ### 89 | unzip Python-Who-Is-On-My-WiFi*.zip 90 | 91 | ### Git ### 92 | git clone https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi.git 93 | 94 | ### Install ### 95 | cd Python-Who-Is-On-My-WiFi* 96 | sudo chmod +x install 97 | ./install 98 | ``` 99 | 100 |

USAGE

101 | 102 |

Command

103 | 104 |

Basics

105 | 106 | ``` 107 | usage: wiom [-h] [-v] [-c] [-d] [-w] [-t] 108 | 109 | Who-Is-On-My-WIFi 110 | 111 | optional arguments: 112 | -h, --help show this help message and exit 113 | -v, --version show current version 114 | -l, --license show Open Source License 115 | -c, --contact show contact 116 | -d, --device show information about your device 117 | -w, --who show who is on your WiFi! 118 | -t , --time int supplement for '-w' command (scanning '-t' seconds) 119 | 120 | GitHub: 121 | ``` 122 | 123 |
124 | 125 |

How to see who is on my wifi?

126 | 127 | !!! You have to run this command as `sudo` or as `Administrator` !!! 128 | 129 | ```shell 130 | linux@name:~$ sudo wiom -w # default scanning time is 10 sec 131 | linux@name:~$ sudo wiom -w -t 5 # scanning wifi for 5 sec 132 | ``` 133 | 134 |
135 | 136 |

How to get information about my device?

137 | 138 | ```shell 139 | linux@name:~$ sudo wiom -d 140 | ``` 141 | 142 |
143 | 144 |

Python3

145 | 146 | 147 |

Basics

148 | 149 | ```python 150 | >>> import who_is_on_my_wifi as wiom 151 | >>> 152 | >>> wiom.help() # help page 153 | >>> wiom.license() # see license 154 | >>> wiom.contact() # contact page 155 | >>> 156 | >>> wiom.who(n) # see who is on my wifi (int('n') is scanning time - optional; default is 10) 157 | >>> wiom.device() # information about wifi and your device 158 | 159 | ``` 160 | 161 |

How to see who is on my wifi?

162 | 163 | !!! You have to run this script as `sudo` or as `Administrator` !!! 164 | 165 | ```python 166 | from who_is_on_my_wifi import * 167 | 168 | WHO = who() # who(n) 169 | for j in range(0, len(WHO)): 170 | comm = f"\n{WHO[j][0]} {WHO[j][1]}\n{WHO[j][2]} {WHO[j][3]}\n{WHO[j][4]} {WHO[j][5]}\n" 171 | print(comm) 172 | 173 | # >>> OUTPUT <<< 174 | 175 | # IP Address: 192.168.0.1 176 | # Mac Address: 38:43:7d:62:42:24 177 | # Device: Compal Broadband Networks, Inc. (router) 178 | 179 | # IP Address: 192.168.0.24 180 | # Mac Address: 10:5b:ad:6c:64:55 181 | # Device: Mega Well Limited 182 | 183 | ... 184 | 185 | ``` 186 |
187 | 188 |

How to get information about my device?

189 | 190 | ```python 191 | from who_is_on_my_wifi import * 192 | 193 | dev = device() 194 | 195 | print(f""" 196 | PC Name: {dev[0]} 197 | PC Product-Name: {dev[1]} 198 | MAC Address: {dev[2]} 199 | IP Address (host): {dev[3]} 200 | IP Address: {dev[4]} 201 | Public IP: {dev[5]} 202 | PC HostName: {dev[6]} 203 | WiFi Name: {dev[7]} 204 | Gateway: {dev[8]} 205 | DNS 1: {dev[9]} 206 | DNS 2: {dev[10]} 207 | Password: {dev[11]} 208 | Security: {dev[12]} 209 | Interface: {dev[13]} 210 | Frequency: {dev[14]} 211 | Signal: {dev[15]} 212 | Channel: {dev[16]} 213 | 214 | 215 | Country: {dev[17]} 216 | Region: {dev[18]} 217 | City: {dev[19]} 218 | Zip Code: {dev[20]} 219 | Latitude: {dev[21]} 220 | Longitude: {dev[22]} 221 | Map: {dev[23]} 222 | ISP: {dev[24]} 223 | """) 224 | ``` 225 | 226 |
227 | 228 |

Error

229 | 230 | 231 |

RuntimeError: Sniffing and sending packets is not available at layer 2: winpcap is not installed

232 | 233 | This error means that you don't have ***WinPcap*** installed.
234 | To fix this you have to [download](https://www.winpcap.org/install/) it from their web page. 235 |
236 | 237 |

/bash/sh: 1: route: not found...

238 | 239 | This error means that you don't have ***net-tools*** installed.
240 | To fix this you have to download it using `sudo apt-get install net-tools` 241 | 242 |
243 | 244 | 245 | 246 |

SCREENSHOTS

247 | 248 | | `wiom -d` | `wiom -w` | 249 | | -------------------------------------------- | -------------------------------------- | 250 | | ![device](images/screenshots/device_1_3.jpg) | ![who](images/screenshots/who_1_3.jpg) | 251 | 252 | 253 |
254 | 255 | 256 |

Error

257 | 258 |

RuntimeError: Sniffing and sending packets is not available at layer 2: winpcap is not installed

259 | This error means that you don't have ***WinPcap*** installed.
260 | To fix this you have to [download](https://www.winpcap.org/install/) it from their web page. 261 |
262 | 263 |

/bash/sh: 1: route: not found...

264 | 265 | This error means that you don't have ***net-tools*** installed.
266 | To fix this you have to download it using `sudo apt-get install net-tools` 267 |
268 | 269 |

TO-DO LIST

270 | 271 | - [ ] Validated MacOS support 272 | - [ ] Add list of verified devices 273 | - [ ] Add WiFi Kill option 274 |
275 | 276 |

LICENSE

277 | 278 | [MIT](https://github.com/tucnakomet1/Python-Who-Is-On-My-WiFi/blob/master/LICENSE.txt) 279 | 280 | ```txt 281 | MIT License 282 | 283 | Copyright (c) 2020 Tucna 284 | 285 | Permission is hereby granted, free of charge, to any person obtaining a copy 286 | of this software and associated documentation files (the "Software"), to deal 287 | in the Software without restriction, including without limitation the rights 288 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 289 | copies of the Software, and to permit persons to whom the Software is 290 | furnished to do so, subject to the following conditions: 291 | 292 | The above copyright notice and this permission notice shall be included in all 293 | copies or substantial portions of the Software. 294 | 295 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 296 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 297 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 298 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 299 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 300 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 301 | SOFTWARE. 302 | ``` 303 | 304 | Platform: any 305 | Classifier: Environment :: Console 306 | Classifier: Programming Language :: Python :: 3 307 | Classifier: Programming Language :: Python :: 3.6 308 | Classifier: Programming Language :: Python :: 3.8 309 | Classifier: Programming Language :: Python :: 3.9 310 | Classifier: License :: OSI Approved :: MIT License 311 | Classifier: Operating System :: POSIX 312 | Classifier: Operating System :: Unix 313 | Classifier: Operating System :: Microsoft :: Windows 314 | Classifier: Operating System :: OS Independent 315 | Description-Content-Type: text/markdown 316 | -------------------------------------------------------------------------------- /src/who_is_on_my_wifi.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | LICENSE.txt 2 | README.md 3 | setup.py 4 | src/device.py 5 | src/who.py 6 | src/who_is_on_my_wifi.py 7 | src/who_is_on_my_wifi.egg-info/PKG-INFO 8 | src/who_is_on_my_wifi.egg-info/SOURCES.txt 9 | src/who_is_on_my_wifi.egg-info/dependency_links.txt 10 | src/who_is_on_my_wifi.egg-info/entry_points.txt 11 | src/who_is_on_my_wifi.egg-info/requires.txt 12 | src/who_is_on_my_wifi.egg-info/top_level.txt -------------------------------------------------------------------------------- /src/who_is_on_my_wifi.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/who_is_on_my_wifi.egg-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [console_scripts] 2 | who-is-on-my-wifi = who_is_on_my_wifi:main 3 | wiom = who_is_on_my_wifi:main 4 | 5 | -------------------------------------------------------------------------------- /src/who_is_on_my_wifi.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | getmac 2 | scapy 3 | -------------------------------------------------------------------------------- /src/who_is_on_my_wifi.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | device 2 | who 3 | who_is_on_my_wifi 4 | -------------------------------------------------------------------------------- /src/who_is_on_my_wifi.py: -------------------------------------------------------------------------------- 1 | from scapy.all import * 2 | from device import * 3 | from who import * 4 | 5 | import subprocess 6 | import argparse 7 | import textwrap 8 | import platform 9 | import inspect 10 | import socket 11 | import sys 12 | import os 13 | 14 | if platform.system() == "Windows": import wmi 15 | 16 | # contact links 17 | 18 | def contact(): 19 | print("\n-- Gmail: \n-- GitHub: \n") 20 | 21 | 22 | # license link 23 | 24 | def license(): 25 | print("""\nWho-Is-On-My-WiFi is under MIT open-source license... 26 | -- See: \n""") 27 | 28 | 29 | # run device 30 | def device_(): 31 | dev = device() 32 | 33 | dvc = f""" 34 | PC Name: {dev[0]} \nPC Product-Name: {dev[1]} 35 | MAC Address: {dev[2]} \nIP Address (host): {dev[3]} 36 | IP Address: {dev[4]} \nPublic IP: {dev[5]} 37 | PC HostName: {dev[6]} \nWiFi Name: {dev[7]} 38 | Gateway: {dev[8]} \nDNS 1: {dev[9]} 39 | DNS 2: {dev[10]} \nPassword: {dev[11]} 40 | Security: {dev[12]} \nInterface: {dev[13]} 41 | Frequency: {dev[14]} \nSignal: {dev[15]} 42 | Channel: {dev[16]} \n\n 43 | Country: {dev[17]} \nRegion: {dev[18]} 44 | City: {dev[19]} \nZip Code: {dev[20]} 45 | Latitude: {dev[21]} \nLongitude: {dev[22]} 46 | Map: {dev[23]} \nISP: {dev[24]} 47 | """ 48 | print(dvc) 49 | 50 | ######## 51 | # help # 52 | ######## 53 | 54 | def help(): 55 | if platform.system() == "Linux": 56 | PURPLE, CYAN, DARKCYAN, BLUE, GREEN, YELLOW, RED, BOLD, UNDER, END = '\033[95m', '\033[96m', '\033[36m', '\033[94m', '\033[92m', '\033[93m', '\033[91m', '\033[1m', '\033[4m', '\033[0m' 57 | else: 58 | PURPLE, CYAN, DARKCYAN, BLUE, GREEN, YELLOW, RED, BOLD, UNDER, END = '', '', '', '', '', '', '', '', '', '' 59 | 60 | print(f""" 61 | who-is-on-my-wifi 1.3.4 62 | 63 | {UNDER}{BOLD}Usage:{END} 64 | {RED}>>> {YELLOW}import {CYAN}who_is_on_my_wifi{END} as wiom 65 | 66 | {RED}>>> {CYAN}wiom{END}.{GREEN}help(){END} {BOLD}{RED} # show this help page{END} 67 | {RED}>>> {CYAN}wiom{END}.{GREEN}contact(){END} {BOLD}{RED} # show contact{END} 68 | {RED}>>> {CYAN}wiom{END}.{GREEN}license(){END} {BOLD}{RED} # show license{END} 69 | 70 | {RED}>>> {CYAN}wiom{END}.{GREEN}who(n){END} {BOLD}{RED} # scan wifi (n : optional integer, means scanning time in seconds; default 10){END} 71 | {RED}>>> {CYAN}wiom{END}.{GREEN}device(){END} {BOLD}{RED} # see information about your device{END} 72 | """) 73 | 74 | 75 | # main function --> argparse 76 | 77 | def main(): 78 | wrapper = textwrap.TextWrapper(width=70) 79 | string = wrapper.fill(text="Who-Is-On-My-WIFi") 80 | parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, description=string, 81 | epilog=textwrap.dedent("""GitHub: \n""")) 82 | 83 | parser.add_argument('-v', '--version', action='version', 84 | version='who_is_on_my_wifi 1.3.5', help='show current version') 85 | 86 | parser.add_argument('-l', '--license', action='store_true', 87 | help='show Open Source License') 88 | 89 | parser.add_argument('-c', '--contact', action='store_true', 90 | help='show contact') 91 | 92 | parser.add_argument('-d', '--device', action="store_true", 93 | help='show information about your device') 94 | 95 | parser.add_argument('-w', '--who', action="store_true", 96 | required=False, help='show who is on your WiFi!') 97 | 98 | parser.add_argument("-t", "--time", type=int, 99 | metavar="", required=False, 100 | default=10, help="int supplement for '-w' command (scanning '-t' seconds)") 101 | 102 | args = parser.parse_args() 103 | 104 | if args.contact: contact() 105 | elif args.license: license() 106 | elif args.device: device_() 107 | elif args.who: 108 | WHO = who(args.time) 109 | for j in range(0, len(WHO)): 110 | print(f"\n{WHO[j][0]} {WHO[j][1]}\n{WHO[j][2]} {WHO[j][3]}\n{WHO[j][4]} {WHO[j][5]}\n") 111 | 112 | 113 | elif len(sys.argv) == 1: 114 | parser.print_help() 115 | else: parser.print_help() 116 | 117 | if __name__ == "__main__": 118 | main() 119 | --------------------------------------------------------------------------------