This repository contains a prototype security scanner for discovering web services on a network, enumerating endpoints, and testing likely default credentials with help from LLM-driven agents.
The project is organized around two runnable parts:
scanner/: the scanning pipeline (network scan -> web enum -> keyword extraction -> credential search -> credential testing)dashboard/: a Flask UI for browsing scan artifacts (scanner.db, logs, screenshots)
For each target subnet/IP:
- Discovers hosts/ports that expose HTTP(S) (
scanner/netscan/) - Enumerates reachable paths and detects login pages (
scanner/webenum/) - Extracts identifying keywords from selected endpoints (
scanner/ai/keyword_extractor.py) - Searches the web using LLMs for likely default credentials (
scanner/ai/cred_searcher.py) - Uses browser automation + LLM tool calls to test credentials (
scanner/ai/cred_tester.py)
Results are stored in SQLite and artifacts are written to a run directory containing:
scanner.dbscanner.logscreenshots/(credential test before/after states)
scanner/: core scanner code, tests, DB models, AI modulesdashboard/: Flask dashboard for viewing run outputsevaluate_external/Evaluation script to run ztgrace/changeme against our test services (seeevaluate_external/README.md)
- Linux/macOS environment (tested on Linux)
- Python (tested with 3.14.5)
nmapavailable on the host (used viapython3-nmap)- Chrome/Chromium runtime for SeleniumBase headless browser tasks
- LLM access:
- remote API: set
OPENAI_API_KEY(used with OpenRouter-compatible base URL by default) - or Ollama mode with
USE_LOCAL_LLM=true(make sure to pull the models you want to use)
- remote API: set
Create .env (in project root) with at least:
OPENAI_API_KEY=your_api_key_hereThe example.env shows more settings. Then create the venv and install the requirements:
python3 -m venv scanner/.venv
source scanner/.venv/bin/activate
python3 -m pip install -r scanner/requirements.txtFrom repository root:
python3 -m scanner.main "192.168.1.0/24"Or scan specific hosts/subnets and ports:
python3 -m scanner.main "192.168.1.10,192.168.1.0/28" -p "80,443,8080" --max-webdrivers 3 --max-webenum-workers 4python3 -m pip install -r dashboard/requirements.txt
python3 dashboard/app.pyThen open http://127.0.0.1:8089.
If your artifacts live elsewhere:
export SCANNER_LOGS_DIR=/path/to/scan_artifacts
python3 dashboard/app.pyMain entrypoint: python3 -m scanner.main <subnets>
Supported options:
-p, --ports: comma-separated ports forwarded to nmap-L, --log-level:DEBUG|INFO|WARNING|ERROR|CRITICAL--log-file: log filename/path under artifacts dir--max-webdrivers: concurrent browser sessions for credential testing--max-webenum-workers: concurrent web enumeration workers--artifacts-dir: output directory for DB/logs/screenshots--disable_llm_cache: disable local LLM response caching
Run help:
python3 -m scanner.main --helpEach run writes to an artifacts directory (default: scan_artifacts/ relative to current working directory):
scanner.db:servicetable: discovered web services and candidate credentialsendpointtable: enumerated paths, login flags, extracted keywords, tested/working credentials
scanner.log: scanner logs and status summariesscreenshots/: saved around login attempts
The dashboard can:
- list runs
- inspect discovered services/endpoints
- show found credentials/login panels
- group screenshots by endpoint and credential attempt
- view scanner/docker logs
Integration tests are under scanner/tests/ and rely on containerized known-vulnerable applications.
Important:
- Test scripts stop/kill running Docker containers and delete stopped ones!
- Test artifacts are created under
/tmp/scan_artifactsby default.
The integration runner (scanner/tests/tests.py) executes a list of application test cases. For each app:
- A Docker Compose stack is started from
scanner/tests/test-network/<app>/docker-compose.yml. - The test waits until the target login page is reachable and a password field is present.
- The scanner is run against that app target (
python -m scanner.main ...) with a dedicated artifacts directory. - Assertions are collected (credentials found, credentials verified, login panel found, endpoint count).
- The Compose stack is torn down (
docker compose down -v --remove-orphans), with a force-kill fallback if needed.
The startup helper also prunes containers/networks before runs to reduce leftover-state issues.
Run tests:
python3 -m scanner.tests.tests --keepRun evaluation-network tests:
python3 -m scanner.tests.tests --evaluation --keepUseful flags:
--select app1,app2: run only selected apps-e, --evaluation: run the evaluation-network app set instead of the default test-network set--kill-containers: clean running containers before test execution-L, --log-level: set test/scanner logging verbosity
- Use only on assets/networks you are explicitly authorized to test.
- Aggressive credential testing can trigger lockouts/rate limits.