Back to updates
UpdatedSep 2, 2026

credential-attacks-toolkit — Updated!

Complete credential attack suite for authorized security testing — SSH, FTP, Web Login, Bruteforce, Dictionary attacks

Share

CredAttack — Credential Attacks Toolkit

Release Python Protocols Tests License

⚠️ LEGAL NOTICE — Authorised security testing ONLY.
Using this tool against systems you do not own or have explicit written permission to test is illegal under the Computer Fraud and Abuse Act (US), Computer Misuse Act (UK), and equivalent laws worldwide. See SECURITY.md.


Table of Contents


What is CredAttack?

CredAttack is a modular, production-grade credential testing suite for authorised penetration testing engagements. It covers the full credential-attack lifecycle:

PhaseCredAttack Capability
ReconnaissanceDefault creds DB (200+ pairs), smart username-derived pattern generation
Attack17 protocol attackers, 6 attack modes, multi-target campaigns
EvasionLockout detection, configurable rate limiting, jitter, proxy rotation
ReportingJSONL audit log, Jinja2 HTML report, found-creds banner + file dump

Attack Modes

ModeCommandDescription
Dictionaryssh, ftp, smb, …Wordlist against one user
SpraysprayOne password across a user list (lockout-safe)
CombocomboEvery user × every password
SmartsmartUsername/company-derived pattern generation
DefaultsdefaultsTry 200+ known service defaults
Multi-targetmultiSame attack across a list of hosts
Full pipelinefullAll protocols, one report

Supported Protocols

#ProtocolModuleDefault PortNotes
1SSHssh.py22paramiko, key/password auth
2FTPftp.py21Active & passive mode
3HTTP Formhttp_form.py80/443Auto CSRF token detection
4HTTP Basichttp_basic.py80RFC 7617
5HTTP Digesthttp_digest.py80RFC 7616
6SMBsmb.py445impacket, NTLM
7RDPrdp.py3389impacket NLA
8SMTPsmtp.py587STARTTLS
9POP3pop3.py110APOP support
10IMAPimap.py143STARTTLS
11MySQLmysql.py3306mysql-connector-python
12MSSQLmssql.py1433pymssql
13Redisredis_proto.py6379AUTH command
14MongoDBmongodb.py27017pymongo
15WinRMwinrm.py5985NTLM, pywinrm
16LDAPldap_proto.py389ldap3, rootDSE auto-detect
17Telnettelnet.py23raw TCP
18VNCvnc.py5900Raw DES challenge-response

Architecture

credattack.py          ← thin shim: `python credattack.py ...` from a checkout
│
├── credattack/cli.py   ← CLI (Typer) — 8 attack-mode subcommands; also the
│                          `credattack` console script when pip-installed
├── credattack/core/
│   ├── config.py      ← Pydantic v2 Settings, CREDATTACK_* env-var overrides
│   ├── engine.py      ← AttackEngine (ThreadPoolExecutor + Rich progress UI)
│   ├── lockout.py     ← LockoutDetector (sliding-window, thread-safe)
│   ├── proxy.py       ← ProxyRotator (round-robin, health-check, demotion)
│   ├── mutator.py     ← PasswordMutator (leet, seasonal, suffix, keyboard-walk…)
│   ├── result.py      ← AttemptResult + SessionReport dataclasses
│   ├── report.py      ← Jinja2 HTML report generator
│   └── logger.py      ← Rich logging + JSONL audit writer
│
├── credattack/protocols/
│   └── *.py           ← 18 ProtocolAttacker implementations
│
├── credattack/data/
│   ├── default_creds.json    ← 200+ real default credential pairs
│   ├── smart_patterns.json   ← 140+ enterprise password templates
│   └── wordlists/            ← Per-service default password lists
│
└── tests/             ← 50+ pytest tests (unit + protocol mocks)

Quick Start

# Clone and set up
git clone https://github.com/amibhai/credential-attacks-toolkit.git
cd credential-attacks-toolkit
python -m venv .venv && source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt

# Check version
python credattack.py --version

# Dry-run (no connections made — verify your word lists)
python credattack.py ssh -t 192.168.1.100 -u admin -P wordlists/common_passwords.txt --dry-run

# Real SSH dictionary attack
python credattack.py ssh -t 192.168.1.100 -u admin -P /path/to/rockyou.txt

# Password spray (rate-limited, lockout-safe)
python credattack.py spray -t 192.168.1.100 --protocol ssh -U users.txt -p "Summer2024!" --delay 30

# Smart mode — generate patterns from username + company
python credattack.py smart -t 192.168.1.100 --protocol ssh -u john.doe --company ACME

# Try service defaults
python credattack.py defaults -t 192.168.1.100 --protocol mysql

# Multi-target campaign
python credattack.py multi --targets hosts.txt --protocol ssh -U users.txt -P passes.txt

Installation

python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install --upgrade pip
pip install -r requirements.txt

Option B — Makefile shortcuts

make install      # core deps
make install-dev  # + pytest-cov, ruff, mypy

Option C — pip install (editable or from a wheel)

pip install -e .          # core deps only
pip install -e .[full]    # + SMB/RDP/MySQL/MSSQL/Redis/MongoDB/WinRM/LDAP
pip install -e .[dev]     # + pytest/ruff/mypy

credattack --version      # console script, equivalent to `python credattack.py`

Option D — Docker

docker build -t credattack -f docker/Dockerfile .
docker run --rm credattack --help

# Mount your wordlists and collect output
docker run --rm \
  -v $(pwd)/wordlists:/app/wordlists:ro \
  -v $(pwd)/output:/app/output \
  credattack ssh -t 192.168.1.100 -u admin -P wordlists/common_passwords.txt

CLI Reference

Global options

python credattack.py [OPTIONS] COMMAND [ARGS]...

Options:
  -V, --version    Show version and exit.
  --help           Show help.

Common flags (available on all protocol commands)

FlagShortDefaultDescription
--target-tTarget host / IP
--port0 (proto default)Override TCP port
--username-uSingle username
--user-file-UNewline-separated username file
--pass-file-PNewline-separated password file
--password-p2Single password
--threads-n10Concurrent workers
--timeout-T5.0Per-attempt timeout (s)
--delay-d0.0Fixed inter-attempt delay (s)
--jitter0.0Max random jitter (s)
--stop-on-firstTrueStop per-user after first hit
--proxy-fileNoneHTTP/SOCKS5 proxy list
--output-dir-o./outputResult directory
--verbosity-v1Logging level (0-3)
--dry-runFalseCount pairs without connecting

Subcommands

# Protocol-specific (each maps to a dedicated attacker)
python credattack.py ssh|ftp|smb|rdp|smtp|pop3|imap|mysql|mssql|redis|mongodb|winrm|ldap|telnet|vnc \
  -t HOST -u USER -P passes.txt

# HTTP (form / basic / digest)
python credattack.py http -t http://target/login --mode form \
  --form-user-field username --form-pass-field password --success-string "Dashboard"

# Spray — single password, many users, long delay
python credattack.py spray -t HOST --protocol ssh -U users.txt -p "Password1" --delay 30

# Combo — cartesian product users × passwords
python credattack.py combo -t HOST --protocol smb -U users.txt -P passes.txt

# Smart — OSINT-derived generation
python credattack.py smart -t HOST --protocol ssh -u firstname.lastname --company TargetCorp

# Defaults — try vendor default credentials
python credattack.py defaults -t HOST --protocol mysql

# Multi — same attack across multiple hosts
python credattack.py multi --targets hosts.txt --protocol ssh -U users.txt -P passes.txt

# Full — all protocols in sequence
python credattack.py full -t HOST -U users.txt -P passes.txt

Password Mutation Engine

PasswordMutator in credattack/core/mutator.py supports composable strategies:

StrategyMethodExample output
Leet-speakleet_speak(word)p@ssw0rd, p455w0rd
Capitalisationcapitalise_variants(word)PASSWORD, Password, pAsSwOrD
Suffixsuffix_append(word)password123, password@2025
Prefixprefix_append(word)!password, mypassword
Keyboard-walkkeyboard_walk(word)qassword (a→q)
Username patternsusername_patterns(user, company)john123, Doe1!, ACME2024!
Seasonal (v1.1)seasonal_patterns(company)Summer2024!, Winter25
Special-char wrap (v1.1)special_char_wrap(word)!@Password, Password!@
Combinecombine(word, strategies)chains any of the above
Smart (all-in-one)smart_generate(user, company)deduped, capped stream
from credattack.core.mutator import PasswordMutator

m = PasswordMutator(max_mutations=5000)

# All strategies combined
for pw in m.smart_generate("john.doe", company="ACME"):
    print(pw)

# Just seasonal patterns
for pw in m.seasonal_patterns(company="Contoso"):
    print(pw)

Default Credentials Database

credattack/data/default_creds.json contains 200+ real default credential pairs across:

Cisco · F5 · Juniper · Palo Alto · VMware · Jenkins · GitLab · Tomcat · WordPress · MySQL · MSSQL · Redis · MongoDB · PostgreSQL · Elasticsearch · RabbitMQ · Splunk · Nagios · Zabbix · pfSense · MikroTik · Huawei · HP iLO · Dell iDRAC · IPMI

# See all defaults for a service
python credattack.py defaults -t HOST --protocol mysql --dry-run

# Run against target
python credattack.py defaults -t 10.0.0.1 --protocol ssh

Proxy Rotation

Pass a proxy file (one proxy per line, host:port format):

# proxies.txt
192.168.1.10:1080
192.168.1.11:1080
socks5://10.0.0.5:9050
python credattack.py ssh -t TARGET -u admin -P passes.txt --proxy-file proxies.txt

The ProxyRotator performs health-checks on startup and demotes proxies that exceed a failure-rate threshold. Dead proxies are automatically excluded.


HTML Reports

After every non-dry-run attack an HTML report is auto-generated in ./output/:

  • Stat cards: total attempts, success rate, duration, attempts/sec
  • Found credentials table: host · protocol · username · password (copy-to-clipboard)
  • Dark-theme Jinja2 template
# Open after a run
start output/report_*.html      # Windows
open  output/report_*.html      # macOS

Configuration & Environment Variables

All settings in credattack/core/config.py can be overridden via CREDATTACK_* environment variables:

export CREDATTACK_THREADS=20
export CREDATTACK_TIMEOUT=3.0
export CREDATTACK_DELAY=1.0
export CREDATTACK_JITTER=0.5
export CREDATTACK_LOCKOUT_THRESHOLD=3
export CREDATTACK_VERBOSITY=2

Or at the CLI level with the standard flags (--threads, --timeout, etc.).


Docker

# Build image
docker build -t credattack -f docker/Dockerfile .

# Run with Docker Compose
cd docker
docker compose run credattack ssh -t 192.168.1.100 -u admin -P /app/wordlists/common_passwords.txt

# Set config via environment
docker run --rm \
  -e CREDATTACK_THREADS=20 \
  -e CREDATTACK_TIMEOUT=3 \
  -v $(pwd)/output:/app/output \
  credattack defaults -t 10.0.0.1 --protocol mysql

Testing

# Run all tests
pytest -q

# With coverage
pytest --cov=credattack --cov-report=term-missing -q

# Makefile shortcut
make test-cov

Current suite: 50+ tests covering:

AreaTests
Lockout detector (sliding window, thread safety)test_lockout.py
Password mutator strategiestest_mutator.py
New mutator strategies (seasonal, special-char)test_mutator_extended.py
Proxy rotator (health-check, demotion)test_proxy.py
Result & SessionReport dataclassestest_result.py
SSH protocol mocktest_protocols_ssh.py
FTP protocol mocktest_protocols_ftp.py
HTTP Basic & Digest mockstest_protocols_http.py

Wordlists

⚠️ The bundled wordlists/ files are minimal smoke-test stubs. Supply your own for real assessments.

WordlistSizeBest For
rockyou.txt~14 MGeneral dictionary
SecLists/Passwords/VariousProtocol-specific
kaonashi.txt~64 MAdvanced coverage
OSINT-derivedVariableTargeted attacks
# Use any external wordlist
python credattack.py ssh -t TARGET -u admin -P /opt/wordlists/rockyou.txt

Project Structure

credential-attacks-toolkit/
├── credattack.py               # Thin shim -> credattack.cli:app (source-checkout usage)
├── pyproject.toml              # PEP 517/518 build & tool config
├── requirements.txt            # Runtime deps
├── Makefile                    # Developer shortcuts
├── VERSION                     # Single source of version truth
├── CHANGELOG.md
├── SECURITY.md
├── .github/
│   └── workflows/ci.yml        # GitHub Actions: lint + test matrix + mypy
├── docker/
│   ├── Dockerfile
│   └── docker-compose.yml
├── credattack/
│   ├── cli.py                  # CLI (Typer) — packaged, backs the console script
│   ├── core/
│   │   ├── config.py           # Pydantic v2 Settings
│   │   ├── engine.py           # AttackEngine (ThreadPoolExecutor)
│   │   ├── lockout.py          # LockoutDetector (sliding window)
│   │   ├── proxy.py            # ProxyRotator
│   │   ├── mutator.py          # PasswordMutator
│   │   ├── result.py           # AttemptResult, SessionReport
│   │   ├── report.py           # HTML report generator
│   │   └── logger.py           # Rich logger + JSONL writer
│   ├── protocols/              # 18 ProtocolAttacker implementations
│   │   └── base.py             # Abstract ProtocolAttacker
│   └── data/
│       ├── default_creds.json  # 200+ vendor defaults
│       ├── smart_patterns.json # 140+ enterprise templates
│       └── wordlists/          # Per-service starter lists
├── attacks/                    # Standalone single-file tools (predate credattack/;
│   └── *.py                    # kept for scripts not yet ported: JWT cracking,
│                                # WAF detection, timing-based user enumeration)
├── utils/
│   └── credential_utils.py     # Shared helpers for the attacks/ scripts
├── tests/
│   ├── conftest.py             # Shared fixtures
│   ├── test_lockout.py
│   ├── test_mutator.py
│   ├── test_mutator_extended.py
│   ├── test_proxy.py
│   ├── test_result.py
│   ├── test_protocols_ssh.py
│   ├── test_protocols_ftp.py
│   └── test_protocols_http.py
├── wordlists/                  # Minimal smoke-test stubs
└── output/                     # Generated logs & reports (git-ignored)

Attack Success Rates (Indicative)

Password TypeDictionarySmart ModeSpray (common)
4 chars~90%~95%~60%
6 chars~65%~75%~25%
8 chars mixed~15%~25%~5%
10+ chars complex<5%<5%<1%

Contributing

See CONTRIBUTING.md.
Please open an issue before submitting large PRs.
All contributions must adhere to the ethical use policy in SECURITY.md.


Use responsibly. Test ethically. Stay legal.

Categories