Skip to content

Password Policy Analyzer

nicole-osterbrock edited this page Jul 1, 2026 · 9 revisions

Lab: Build a Password Policy Analyzer (Python + Kali Linux)

This tool will:

  • Evaluate password strength
  • Compare an organization’s password policy against standards
  • Generate findings + remediation guidance
  • Produce a security report

Step 1 — Create Project Folder

Open Terminal

Run:

mkdir password-policy-analyzer

cd password-policy-analyzer

To verify, run:

pwd

Screenshot 2026-06-17 at 12 08 17

SUMMARY:

Open Terminal, Folder created, Current directory shown


Step 2 — Create Python Virtual Environment

Install venv:

sudo apt update

sudo apt install python3-venv -y

Create environment:

python3 -m venv venv

Activate:

source venv/bin/activate

Screenshot 2026-06-17 at 12 14 02

Step 3 — Install Dependencies

Install packages:

pip install pandas tabulate zxcvbn

Verify, run:

pip list

The List of Expected packages: pandas tabulate zxcvbn

Screenshot 2026-06-17 at 12 18 57

Step 4 — Create Project Files

Run:

touch analyzer.py

touch password_policy.json

touch report.txt

Open VS Code:

code .

SUMMARY:

The Folder should look like:

password-policy-analyzer │ ├── analyzer.py ├── password_policy.json ├── report.txt └── venv


Step 5 — Create Example Password Policy

Open:

password_policy.json

Type:

{ "minimum_length": 8, "require_uppercase": true, "require_numbers": true, "require_symbols": true, "expiration_days": 90, "allow_common_passwords": false }

Save

Screenshot 2026-06-17 at 12 33 41

Step 6 — Create the Analyzer

Open: analyzer.py Type: '''python import json from zxcvbn import zxcvbn from tabulate import tabulate

with open("password_policy.json") as f: policy = json.load(f)

audit=[]

if policy["minimum_length"] < 12: audit.append( ["Minimum Length", "FAIL", "Use 12+ characters"] ) else: audit.append( ["Minimum Length", "PASS", "Good"] )

if policy["expiration_days"] <= 90: audit.append( [ "Rotation", "WARN", "Avoid forced resets" ] )

sample="Summer2026!"

score=zxcvbn(sample)

audit.append([ "Password Strength", score["score"], score["feedback"]["warning"] ])

print(tabulate( audit, headers=[ "Category", "Status", "Recommendation" ] )) '''

Clone this wiki locally