Skip to content

Instantly share code, notes, and snippets.

@AnwarPy
AnwarPy / huaweiDecrypt.py
Created July 5, 2025 18:05 — forked from staaldraad/huaweiDecrypt.py
Decrypt Huawei router/firewall passwords. Huawei stores passwords using DES encryption when the crypted option is enabled.
#!/usr/bin/python
"""
Simple tool to extract local users and passwords from most Huawei routers/firewalls config files.
Will extract plain-text passwords and crypted credentials. Huawei config files use DES encryption with
a known key. Using this information, the script will decrypt credentials found in the config file.
Author: Etienne Stalmans (etienne@sensepost.com)
Version: 1.0 (12/01/2014)
"""
from Crypto.Cipher import DES

Keybase proof

I hereby claim:

  • I am anwarpy on github.
  • I am anwarpy (https://keybase.io/anwarpy) on keybase.
  • I have a public key ASCfC3nCewmkVGfqkWP6C6r0y3i7ax1E1S7ixMHSEYACTwo

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am anwarpy on github.
* I am anwaranabtawi (https://keybase.io/anwaranabtawi) on keybase.
* I have a public key ASCUzUYZFxjVkV3WZeP4n2nrdT6SORWcn2uJD3feUxyWoAo
To claim this, I am signing this object:

Keybase proof

I hereby claim:

To claim this, I am signing this object: