A modular cybersecurity multi-tool CLI for security teams. sectool bundles six
focused auditors behind a single, consistent command-line interface with
severity-ranked, color-coded output and machine-readable JSON.
| Command | Purpose |
|---|---|
sectool scan |
Static code scan for SQL injection, XSS, hardcoded secrets, command injection and weak crypto |
sectool ssl |
SSL/TLS certificate, protocol and cipher auditor |
sectool deps |
Dependency vulnerability checker backed by the OSV database |
sectool packets |
Network traffic analyzer for protocol breakdown and suspicious patterns (educational) |
sectool pass |
Password strength auditor with HaveIBeenPwned breach checking (k-anonymity) |
sectool crypto |
Auditor for weak cryptographic primitives and misuse |
sectool is intended for authorized security testing, defensive review and
education. Only scan code, hosts, networks and credentials you own or have
explicit written permission to assess. The packet analyzer captures live
traffic and may require elevated privileges; capturing networks you do not
control may be illegal.
Requires Python 3.9+.
git clone https://github.com/NormalLinuxUser2/sectool/ sectool
cd sectool
python -m venv .venv
# Linux/macOS
source .venv/bin/activate
# Windows (PowerShell)
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
pip install -e .The packet analyzer depends on scapy, which is included in
requirements.txt. If you installed only the core package, add it with:
pip install -e ".[packets]"After installation the sectool command is available on your PATH. You can also
run it without installing via python -m sectool.
These options are available on every subcommand and are placed after the command name:
| Option | Description |
|---|---|
--json |
Emit findings as JSON instead of text |
--no-color |
Disable ANSI colors |
--min-severity LEVEL |
Hide findings below LEVEL (info, low, medium, high, critical) |
--fail-on LEVEL |
Exit non-zero when a finding at or above LEVEL is present (default: low) |
--output FILE |
Write the report to a file instead of stdout |
-v, -vv |
Increase log verbosity (logs go to stderr) |
| Code | Meaning |
|---|---|
0 |
Completed; no findings at or above --fail-on |
1 |
Completed; findings at or above --fail-on were reported |
2 |
Error (bad input, unreachable host, missing dependency) |
130 |
Interrupted |
This makes sectool easy to wire into CI: a non-zero exit fails the build.
# Scan a project directory
sectool scan ./myapp
# Only show medium and above, restrict to Python files
sectool scan ./myapp --min-severity medium --ext .py
# Focus on specific categories and ignore a directory
sectool scan ./myapp --category secret --category sql-injection --exclude vendor
# JSON output for tooling
sectool scan ./myapp --json --output report.jsonCategories: sql-injection, xss, secret, command-injection, weak-crypto.
Add the marker sectool:ignore to a source line to suppress findings on it.
# Audit a host on the default port (443)
sectool ssl example.com
# Custom port and a stricter expiry warning window
sectool ssl mail.example.com --port 993 --expiry-warning-days 45
# Only surface real problems
sectool ssl example.com --min-severity mediumChecks certificate expiration and validity, trust-chain and hostname verification, key size, signature algorithm, self-signed certificates, enabled protocol versions (flagging SSLv3/TLS 1.0/1.1) and acceptance of weak cipher suites.
# Check the current directory's manifests
sectool deps
# Check a specific manifest
sectool deps ./requirements.txt
sectool deps ./frontend/package.json
# Parse manifests without contacting the OSV API
sectool deps ./myapp --offlineParses requirements.txt and package.json, cross-references pinned versions
against OSV, and reports vulnerable packages with suggested
fixed versions. Unpinned dependencies are flagged as a hygiene issue.
# Analyze a capture file
sectool packets --read capture.pcap
# Live capture (usually requires admin/root)
sectool packets --iface eth0 --count 500 --bpf "tcp port 80"Summarizes the protocol distribution and top talkers, then flags suspicious patterns: probable port scans, cleartext protocols, possible cleartext credentials and possible ARP spoofing.
# Prompt securely (recommended; the password is never echoed)
sectool pass
# From stdin (does not appear in shell history)
echo 'hunter2' | sectool pass --stdin
# Skip the online breach check
sectool pass --no-hibpEstimates entropy, detects predictable patterns (common passwords, sequences, repeats, keyboard walks, years) and checks the password against the HaveIBeenPwned breach corpus. The breach check uses k-anonymity: only the first 5 characters of the SHA-1 hash are sent, so the password itself never leaves your machine.
# Audit cryptographic usage in a codebase
sectool crypto ./myapp
# Limit to specific categories
sectool crypto ./myapp --category weak-hash --category weak-randomCategories: weak-hash, weak-cipher, weak-mode, weak-random,
weak-keysize, static-iv, weak-protocol, cert-validation.
Findings are ranked across five severity levels, color-coded in the terminal:
CRITICAL > HIGH > MEDIUM > LOW > INFO
Each finding includes a title, location, description, remediation advice and,
where relevant, a reference (CWE or advisory). Use --json for a structured
document containing a summary count and the full findings array.
sectool/
├── sectool/
│ ├── cli.py Central argparse entry point and dispatch
│ ├── core/
│ │ ├── findings.py Severity levels and the Finding model
│ │ ├── output.py Color/JSON reporter
│ │ ├── logging.py Structured logging setup
│ │ ├── codescan.py Shared regex/rule scanning engine
│ │ ├── context.py Reporter + logger container
│ │ └── errors.py Exception types
│ └── modules/
│ ├── scan.py Code vulnerability scanner
│ ├── ssl_audit.py SSL/TLS auditor
│ ├── deps.py Dependency checker (OSV)
│ ├── packets.py Packet analyzer
│ ├── passwords.py Password auditor (HIBP)
│ └── crypto.py Crypto auditor
├── tests/ pytest suite
├── requirements.txt
├── pyproject.toml
└── LICENSE
pip install -r requirements-dev.txt
pip install -e .
pytestThe test suite is network-free: the HaveIBeenPwned and OSV integrations are mocked, so it runs fast and offline.
Contributions are welcome.
- Fork and branch. Create a feature branch from
main(git checkout -b feature/my-change). - Match the style. The codebase favors small, self-documenting functions
and the shared
Finding/Severity/Reporterabstractions. New detectors should returnFindingobjects so output stays consistent. The code is kept comment-free; prefer clear names over comments. - Add detectors via rules. For
scanandcrypto, add acompile_rule(...)entry to the module'sRULESlist rather than writing bespoke logic. - Write tests. Every new rule or feature needs coverage under
tests/. Keep tests offline by mocking network calls. - Run the suite.
pytestmust pass before opening a pull request. - Keep findings actionable. Each finding should carry a clear title, a precise location and a concrete remediation.
- Open a pull request describing the change, the motivation and any new dependencies.
Please report security issues responsibly via a private channel rather than a public issue.
Released under the MIT License.