Skip to content

daylighttg/glads_Password_Logger

Repository files navigation

Password Attempt Logger

A small CLI tool that logs login attempts to ~/.passwordlogger/ as JSON lines (JSONL), hashes usernames deterministically, tracks failed attempts, and provides a log viewer with filters.

Features

  • JSONL log format for easy parsing
  • Deterministic username hashing (MD5, 8 hex chars)
  • Persistent failed-attempt counter
  • Log viewer filters for date, user, status, and IP

Data directory

The log and counter are stored in ~/.passwordlogger/.

Log schema

Each line in attempts.jsonl is a JSON object:

{"timestamp":"2024-01-15T14:32:45Z","user_hash":"7a2f9c4e","status":"failed","ip":"192.168.1.100"}

Fields:

  • timestamp: UTC ISO 8601 with Z
  • user_hash: first 8 hex chars of MD5 of the raw username
  • status: success or failed
  • ip: optional string

Usage

Log attempts:

python main.py attempt bob failed 192.168.1.100
python main.py attempt alice success

View logs:

python main.py view
python main.py view --failed
python main.py view --user bob
python main.py view --date 2024-01-15
python main.py view --date 2024-01-01..2024-01-31

Show failed counter:

python main.py counter

Demo harness

A small demo is included to exercise the logger without touching your real user data directory.

python demo.py

Testing

Run the test suite with pytest:

python -m pytest

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages