Skip to main content

pySSHA-slapd

Python hashlib generator born as a script to test OpenLDAP user passwords. It supports salted:

  • md5
  • sha1
  • sha224
  • sha256
  • sha384
  • sha512

Introduction

pySSHA-slapd is a simple SSHA string encoder e checker that's quite easy to use:

python3 ssha.py -p slapdsecret
{SSHA}omu7YHgg6_uqOIN_epZtfJtGo0ruwdSr 

Usage

usage: ssha.py [-h] -p P [-s S] [-salt_size SALT_SIZE] [-c C] [-enc ENC] [-b]
               [-prefixed] [-d D]

Usage: python ssha.py -p Password[-c SSHA hash to check]

optional arguments:
  -h, --help            show this help message and exit
  -p P                  Password to encode
  -s S                  Salt, 4 bytes in hex format, example "fooo": -s
                        666f6f6f
  -salt_size SALT_SIZE  salt lenght
  -c C                  {SSHA} hash to check
  -enc ENC              Encoder to use, example: sha1 sha224 sha256 sha384
                        sha512
  -b                    if {SSHA} hash is in base64 format
  -prefixed             if suffixed or prefixed salt
  -d D                  Debug level from 1 to 5

Dependencies

Python3 and hashlib

Usage examples

You can adopt a specified salt for hashing, in hex format:

python3 ssha.py -p slapdsecret -s 74be2629
{SSHA}w5CJCwNQk44NjTYzcMZNKbE6Bu90viYp 

Verify if a password is valid comparing it with a SSHA hash:

python3 ssha.py -c {SHA1}pPUGnEBCmIa+fJy6ZTS87eEg+ylVYDqcrs6oHA== -p slapdsecret 

Same as previous but ssha hash is in base64 format (like ldapsearch output):

python3 ssha.py -c e1NIQTF9dzVDSkN3TlFrNDROalRZemNNWk5LYkU2QnU5MHZpWXA= -b -p slapdsecret -salt_size 4

Same as the previous but with maximum debug level

python3 ssha.py -c e1NIQTF9dzVDSkN3TlFrNDROalRZemNNWk5LYkU2QnU5MHZpWXA= -b -p slapdsecret -d 3 -salt_size 4

[sshaSplit debug]
	ssha_password: {SSHA}w5CJCwNQk44NjTYzcMZNKbE6Bu90viYp 
	salt: 74be2629 
	payload: 0b0350938e0d8d363370c64d29b13a06ef

[checkPassword debug]
 	ssha_password:    {SSHA}w5CJCwNQk44NjTYzcMZNKbE6Bu90viYp
	created_password: {SSHA}w5CJCwNQk44NjTYzcMZNKbE6Bu90viYp
	salt: 74be2629
	password: slapdsecret

{SSHA} Check is valid: True

select your preferred encoder

python3 ssha.py -p slapdsecret -s 74be2629 -enc sha512
{SHA512}4gm2Ep0Nklb8pkss9zIs+t6/BGaGn2QYphl3UeAYuBBNW/hj8glu4jUb7JPb4LVWdCv+g0WoyYUB9VWVajQpjHS+Jik= 

without salt

python3 ssha.py -p ciao -d 3 -salt_size 0  -enc sha512

OpenLDAP use a 8byte lenght salt, you can also change this value with -salt_size option.

Resources

Metadata

Release files for pySSHA 1.0.0

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

Source distribution (sdist)

Source distribution for pySSHA 1.0.0
File Size Uploaded
pySSHA-1.0.0.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pySSHA 1.0.0
File Interpreter ABI Platform
pySSHA-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.7 kB

Release files / pySSHA-1.0.0.tar.gz

Download URL pySSHA-1.0.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
88b3f53e8328de358d12015fadd31428db6e0dac33019a505aa0e44455e62095
BLAKE2b-256 checksum
How to use checksums
984db2b41a2a035d4d92baa00140526485f2c72a67dcd3a10d1ec1e50d1553d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.5.2

Release files / pySSHA-1.0.0-py3-none-any.whl

Download URL pySSHA-1.0.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
08cbe77d9d7e5349dd5be41cdeb3b4e3b7a76609e7350ca4208dbcabb6f6c14e
BLAKE2b-256 checksum
How to use checksums
48e177f120174098c4f1f0345182ffadb5f0327f142bf32e12ea920f40def2f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.5.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.8.1

2 release files

0.8

2 release files

0.6

2 release files

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