Skip to main content

A Python package to restrict the login page of shelly-devices.

Project description

At the moment this Script is nowhere near being complete, use at your own risk!

Shelly

Stuff based around the beautifull small electronic devices from Allterco

Auto-Restrict-Login

This Script queries trough a given number of ips and restricts the http login with a given username and password

Installation

To install the Script(s) run:

pip install shelly-restrict
Usage

To use the script run:

  1. The Script requires the ips as fourth parameter, each seperated by a comma eg ip1,ip2,...
  2. When a login page is already restricted you will be prompted to provide the old password
  3. The Script doesnt work with mdns names, just ip addresses
  4. The Script will automatically generate a file called Shelly.json in the same directory as the script, to store the last username and the hash of the last password.
python3 secure.py [mode] [username] [password] [ip1,ip2]
  mode  enable/disable
Error-Codes
  • 0: Failed to load Shelly.json, check the directory and path. (The script cant find the Credentials-File)
  • 1: Wrong password entered. (The provided password doesnt match with the saved hash)
  • 2: Right hash found but wrong password provided. (The entered password matches the saved hash, but not the actual password on the login page)
  • 3: Found Shelly.json, but didnt find entry for this device. (The script found the Credentials-File, but the restricted login was never enabled with this script)
Credentials-File

The Credentials-File (Shellys.json) is generated and then located in the same directory as the script. The structure is:

{"devices": [{"ip": "192.168.xxx.xxx", "username": "test", "password": "$pbkdf2-sha256$30000$yZnzPqc0Rqi1NibEeM.5Fw$QZ0sk1Z6K4LMt3UM3AGrrKLk9jBOjwrXsY1psfAPY4Q"}, {"ip": "192.168.xxx.xxx", "username": "test", "password": "$pbkdf2-sha256$30000$yZnzPqc0Rqi1NibEeM.5Fw$QZ0sk1Z6K4LMt3UM3AGrrKLk9jBOjwrXsY1psfAPY4Q"}]}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shelly-restrict-0.0.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shelly_restrict-0.0.3-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file shelly-restrict-0.0.3.tar.gz.

File metadata

  • Download URL: shelly-restrict-0.0.3.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.2

File hashes

Hashes for shelly-restrict-0.0.3.tar.gz
Algorithm Hash digest
SHA256 56ec94c9bb847759d621d65f78618326e51402228831f9c4f490de61e9a0fa92
MD5 ceaa0596bd98d540a17fbf82fed72602
BLAKE2b-256 9ab3798886f14e260fa47ab97602d971f7be77baea6d9536b9832d8d9b2c055e

See more details on using hashes here.

File details

Details for the file shelly_restrict-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: shelly_restrict-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.2

File hashes

Hashes for shelly_restrict-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 debb3f66bff5eefa767365f3ed47abe89df102399b2fa91a3c0f7a22096fca71
MD5 c85edd7836baead3641b744790029664
BLAKE2b-256 af8807d806fe7f4cfd3c41d25b72ce996dd3a4bb0e08d5302d8a145d5372c84b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page