sdushantha / wifi-password Goto Github PK
View Code? Open in Web Editor NEWQuickly fetch your WiFi password and if needed, generate a QR code of your WiFi to allow phones to easily connect
License: MIT License
Quickly fetch your WiFi password and if needed, generate a QR code of your WiFi to allow phones to easily connect
License: MIT License
If I run sudo wifi-password I get
ERROR: Could not find password
This is because my AP's name has a space inside (e.g: John DoeWifi)
If I create a new AP and name it JohnDoeWifi, I successfully get the result
password123
The program doesn't take into consideration that there may be an SSID with space inside the name. Only SSIDs with no space are read.
I like it! But can you please comment the code. That way it is easier to read and understand.
I'll try to move into common-cxxflags.py
and let you know.
Hi awesome work,
however I noticed on Linux (Ubuntu 18 LTS) throws the error : ERROR: Cound not find password
. This happens because it looks in /etc/NetworkManager/.../
for files with name {ssid}.nmconnection
, whereas in my case those files are just named as {ssid}
. Changing {ssid}.nmconnection
to just {ssid}
solved my issue.
and then generate QRCode for the one(s) requested.
Thanks
Hi!
I appreciate the work you put in this, but sadly it doesn't work for me.
I'm using Kubuntu 22.04 and the WiFi is a hidden network. If I run the command nmcli -s -g 802-11-wireless-security.psk connection show '{ssid}'
manually, it outputs the password though. Do I have to set up something first?
Thanks in advance!
Greetings,
Noah Streller
Excuse me, does this not work with termux on mobile phones?
After testing, some parameters are not supported and the cracking ability is weak
This tripped me up for a minute, but the quick install instructions don't mention that you need Pillow for generating images. Would be nice if the README indicated that.
I'll open a PR for that. If not desired feel free to close.
test
Here's an example:
Your command from here:
m ~ % sudo nmcli -s -g 802-11-wireless-security.psk connection show $SSID | grep -q . && echo 'Password found'
m ~ %
Since I'm not running wifi-password
as root, it puts sudo on.
Removing the sudo
:
m ~ % nmcli -s -g 802-11-wireless-security.psk connection show $SSID | grep -q . && echo 'Password found'
Password found
One thing though, is that nmcli
has this functionality:
m ~ % nmcli device wifi show-password
SSID: [CLIPPED]
Security: WPA
Password: [CLIPPED FOR GITHUB]
█████████████████████████████████████
██ ▄▄▄▄▄ █▄▀ ▀ ▄▀▄ ██▄▀▀▄ ▄█ ▄▄▄▄▄ ██
██ █ █ █ █▀ █▄ ▀▀▄▄█ ███ █ █ ██
[TRUNCATED FOR GITHUB ...]
██▄▄▄▄▄▄▄█▄▄▄▄█▄███▄███▄█▄█████▄▄████
████████████████████████████████████
m ~ % printf '%s\n\n' "$(wifi-password --version)" "$(NetworkManager --version)" "$(nmcli --version)" "$(cat /etc/os-release | head -4)"
1.1.1
1.32.12-1
nmcli tool, version 1.32.12-1
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
$ wifi-password -h
ERROR: Network Manager is required to run this program on Linux.
Do I need to be connected in order to read the help message... in order to understand how to get connected?
@qaisarirfan Your Wi-Fi is disconnected.
Does this change when it's connected?
Originally posted by @NDuma in RReverser/WiFi-Password#1 (comment)
Can the steps to uninstall be documented on the README, or better yet, automated? Adding an uninstall flag to the setup.py would be optimal.
Looking at the install logs, is this essentially it?
rm /usr/local/bin/wifi-password
rm /usr/local/lib/python3.9/site-packages/wifi_password-*.egg
run_command方法中的返回语句字符集需要修改为“gbk”
return output.decode("gbk").rstrip("\r\n")
get_password方法中,判断为"win32“的分支需要修改
elif sys.platform == "win32":
password = run_command(f"netsh wlan show profile name="{ssid}" key=clear")
password = re.findall(r"关键内容\s+:\s(.*)", password)[0]
it shows the commands differently that what they really are
Thanks and awesome project
The --version
option should just print the version number, it shouldn't ask to be run as root or, if run as root, print the WiFi password.
$ wifi-password --version
1.0.3
ERROR: You need to run '/usr/local/bin/wifi-password' as root
$ sudo wifi-password --version
1.0.3
Password-Printed-Here
elif sys.platform == "win32":
password = run_command(f"netsh wlan show profile name=\"{ssid}\" key=clear")
password_line = password.split("\r\n")[32]
password = password_line[(password_line.find(":") if password_line.find(":") != -1 else password_line.find(":"))+ 1:].rstrip().lstrip()
This might be a stupid question but do I have to enter my wifi password I'm scanning the qr code given but it my phone doesn't log in. If I do have to enter a password where? Thank you
I noticed the markdown file isn't rendering on Github because it has no file extension :)
Originally posted by @davelab6 in MicrosoftDocs/typography-issues#685
Originally posted by @B-starboy in MicrosoftDocs/typography-issues#719
The code works well without it.
Is there a role that I don't know?
python3 -m pip install --user wifi-password
Requirement already satisfied: wifi-password in /home/ryan/Projects/wifi-password (1.0.6)
Requirement already satisfied: qrcode in /usr/local/lib/python3.8/dist-packages/qrcode-6.1-py3.8.egg (from wifi-password) (6.1)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from qrcode->wifi-password) (1.14.0)
have a error
-bash:/usr/local/bin/wifi-password :NO such file or directory
Neither -i
nor --image
returns an image. Instead I see the password in plain text.
I'm on commit 1cc6ba2. I'm using macOS 10.15.7 and the built in terminal.
version: 1.0.2
IS:
calling wifi-password with -i or --image shows the password in the terminal.
SHOULD:
show the qr code as an image
SUGGESTION:
let the user specify a name and/or a path including the file extension(.jpeg, .png, etc.). If no extension is give or the extension is invalid, fall back to a default extension.
[janst@jan-pc wifi-password]$ wifi-password -i
ERROR: You need to run '/usr/bin/wifi-password' as root
[janst@jan-pc wifi-password]$ wifi-password --image
ERROR: You need to run '/usr/bin/wifi-password' as root
[janst@jan-pc wifi-password]$ sudo wifi-password -i
<shows password, erased for privacy reasons>
[janst@jan-pc wifi-password]$ sudo wifi-password --image
<shows password, erased for privacy reasons>```
I was trying to use the program without any arguments and it throws an index out of range exception
because the variable ssid
is an empty string:
After some debugging the issue is found in the method get_ssid
when the platform is win32
, in my case, I don't have wifi enable so that's why the SSID interface is not being fetched, but apparently the netsh
command returns an empty value and when trying to grab the index of 0, it breaks because there is nothing defined.
OS
: Windows 10Python version
: 3.8.1it showed
wifi-password is not recognized as an internal or external command, operable program or batch file.
even after i installed wifi-password using pip on windows10 system.
~ locate iwgetid
/sbin/iwgetid
~ wifi-password
ERROR: Can't find the 'iwgetid' command
This was run on Ubuntu 18.04.5 LTS
I understand that Mac will prompt for admin access every time I run wifi-password
for security purposes. Is there any way to give wifi-password
admin access always so as to easily access the wifi password?
I am somewhat satisfied that it does prompt for username and password before fetching the keychain credential. However, it would be more convenient to simply run it and get the wifi password directly haha
I just installed the package with python -m pip install --user wifi-password
. When I run wifi-password -q -i
the following exception is thrown:
Traceback (most recent call last):
File "C:\Users\Bob\AppData\Roaming\Python\Python38\site-packages\qrcode\image\pil.py", line 6, in <module>
from PIL import Image, ImageDraw
ModuleNotFoundError: No module named 'PIL'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Bob\AppData\Roaming\Python\Python38\Scripts\wifi-password-script.py", line 11, in <module>
load_entry_point('wifi-password==1.0.3', 'console_scripts', 'wifi-password')()
File "C:\Users\Bob\AppData\Roaming\Python\Python38\site-packages\wifi_password\wifi_password.py", line 108, in main
generate_qr_code(args.ssid, password, image=args.image)
File "C:\Users\Bob\AppData\Roaming\Python\Python38\site-packages\wifi_password\wifi_password.py", line 85, in generate_qr_code
img = qr.make_image()
File "C:\Users\Bob\AppData\Roaming\Python\Python38\site-packages\qrcode\main.py", line 289, in make_image
from qrcode.image.pil import PilImage
File "C:\Users\Bob\AppData\Roaming\Python\Python38\site-packages\qrcode\image\pil.py", line 8, in <module>
import Image
ModuleNotFoundError: No module named 'Image'
Hi It's a great project!:two_hearts:
i found the Key Content(password )
is not displayed when the types of networks is WPA2-Enterprise
Security settings
-----------------
Authentication : WPA2-Enterprise
Cipher : CCMP
Authentication : WPA2-Enterprise
Cipher : GCMP
Security key : Absent
802.1X : Enabled
EAP type : Microsoft: Protected EAP (PEAP)
802.1X auth credential : User credential
Credentials configured : No
Cache user information : Yes
Is there a way to solve this situation?
Thx~~~~
Windows 10
Traceback (most recent call last):
File "C:\Users\username\AppData\Local\Programs\Python\Python39\Scripts\wifi-password-script.py", line 33, in <module>
sys.exit(load_entry_point('wifi-password==1.1.1', 'console_scripts', 'wifi-password')())
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\site-packages\wifi_password-1.1.1-py3.9.egg\wifi_password\wifi_password.py", line 165, in main
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\site-packages\wifi_password-1.1.1-py3.9.egg\wifi_password\wifi_password.py", line 126, in generate_qr_code
File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\qrcode\image\pil.py", line 50, in save
self._img.save(stream, format=format, **kwargs)
File "C:\Users\username\AppData\Roaming\Python\Python39\site-packages\PIL\Image.py", line 2161, in save
fp = builtins.open(filename, "w+b")
OSError: [Errno 22] Invalid argument: 'Name\r.png'h
Found some details here: https://docs.brew.sh/Homebrew-and-Python
Let me know if you like the idea! I can have a look to see what it takes and raise a PR.
$ wifi-password
bash: wifi-password: command not found
Not sure why wifi-password command not recognized, I tried reloading Git Bash, but same error.
But installing through Git worked, so I'm currently using that.
Attached is a snippet log of my terminal.
I suppose the next issue would be the command returning ERROR: SSID was not found
regardless of what flags I pass through.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.