Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

wifipasswords

Retrieve and save all WiFi networks and passwords on the device.
On windows uses the netsh subprocess.
On linux reads the NetworkManager files or wpa_supplicant.conf.

Cross platform:

  • Windows
  • Linux (work in progress - need to add DNS and visible network config)
  • macOS (to be implemented)

NOTE: requires sudo privileges on linux when running the get_password() function due to file ownership permissions.

Features

  • Importable as a package or able to be run directly on the command line.
  • Tested in Python 3.6 - 3.9
  • Tested on Windows 10, Ubuntu 18 - 20.04 and Debian Buster.
  • Returns WiFi passwords as a dictionary
  • Able to show visible wifi networks
  • Able to show currently connected SSID.
  • Able to show current DNS config (Windows only at present)
  • Can save networks as JSON or wpa_supplicant.conf file.

Installation

Installed via pip using: pip install wifipasswords

Usage

from wifipasswords import WifiPasswords

passwords = WifiPasswords().get_passwords()
connected_passwords = WifiPasswords().get_currently_connected_passwords()

print(passwords)
print(connected_passwords)

WifiPasswords().save_wpa_supplicant('.', passwords, True, 'GB')

Command Line Usage

Provides a command line interface callable after installation with:

  • python3 -m wifipasswords
  • wifipasswords
    ~ $ wifipasswords

exampleoutput

To see command line options run wifipasswords -h

Packaging as EXE

Can be packaged to an EXE on windows with:
pyinstaller --clean --noconsole --onefile -i <icon> wifipasswords_exe.py

The wifipasswords_exe.py file is the same as the main.py file in the package except will pause after console output is finished to prevent the terminal from auto-closing if the EXE is run directly.

To-Do

  • Add macOS Support
  • Add getters for accessing variables directly
  • Fix visible network, DNS config and number of interfaces for Linux
  • Add automated tests
  • Add method to check and return only the connected SSID name and Password
  • Use nmcli to retrieve passwords on linux rather than reading files (may not require sudo)
  • Multithreading support for windows to imporove execution speed

About

Creation date: 10-02-2019
Modified date: 25-03-2021
Dependencies: colorama

Licence

Copyright (C) 2019-2021 Joe Campbell
GNU GENERAL PUBLIC LICENSE (GPLv3)

This program is free software: you can redistribute it and / or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see < https: // www.gnu.org/licenses/>.

Metadata

Release files for wifipasswords 0.3.3-beta-

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wifipasswords 0.3.3-beta-
File Size Uploaded
wifipasswords-0.3.3-beta-.tar.gz 12.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wifipasswords 0.3.3-beta-
File Interpreter ABI Platform
wifipasswords-0.3.3b0-py3-none-any.whl Python 3 none any Details

Total release size: 40.0 kB

Release files / wifipasswords-0.3.3-beta-.tar.gz

Download URL wifipasswords-0.3.3-beta-.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b5c1405fa342e653851b58c70c62e2ae9f5d9ac88b9a7c307f812f4f6a636cf0
BLAKE2b-256 checksum
How to use checksums
8fa8e648fcf60699de8460f02448cf9b48bdb428cef9ec3f88ffa5254565248a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

Release files / wifipasswords-0.3.3b0-py3-none-any.whl

Download URL wifipasswords-0.3.3b0-py3-none-any.whl
Size 27.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
595d2af9095cc2738047b0041e14836ffe00852d2de363cd02341a23186a3be6
BLAKE2b-256 checksum
How to use checksums
f6a747ab58b04145e154641bac8dfc475b9e84b42baaad4be8d8c69068ba0006
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page