
User-space bot and DDoS deflection for small HTTP services
A user-space deception layer that turns DDoS and bot abuse into wasted effort.
Net Ward sits in front of your HTTP service as a reverse proxy. Real traffic passes through untouched. Known probes and floods get harmless mirror responses that burn bot effort and never reach your app — no kernel hooks, no payloads, no retaliation, fail-open by design.
Built and maintained by Dragon Lady — github.com/Dragon-Lady · X: @answerislove2 Independent security researcher tracking live supply-chain and bot-abuse campaigns in the wild.
Website: dragon-lady.github.io/netward-standalone
Version 0.5.0 expands probe matching, refreshes definitions while preserving operator settings and history, and returns 503 for unmatched requests when the upstream is unavailable. Stop the proxy and back up its database before upgrading; review the definition-refresh and rollback guidance below.
python -m pip install --upgrade "netward>=0.5.0"
# Create config.json in a directory owned by your user (not directly in /tmp).
cat > config.json <<'JSON'
{
"node_id": "netward-local",
"upstream_target": "http://127.0.0.1:9000",
"listen_address": "127.0.0.1:8080",
"storage_path": "netward.db"
}
JSON
# Edit upstream_target to point at your running app before starting.
python -m netward --config config.json
Version 0.5.0 or newer is the recommended baseline for new installations and upgrades. Older releases remain available for reproducibility; new deployments should use the current release.
Or from source:
git clone https://github.com/Dragon-Lady/netward-standalone
cd netward-standalone
pip install -e .
Net Ward listens on listen_address and forwards clean traffic to upstream_target.
For a PyPI installation, use the minimal config.json above. The full
example_config.json is a repository file, not an installed wheel resource.
From a source checkout, copy it and edit the upstream target:
cp example_config.json config.json
Point upstream_target at a real HTTP service before you start Net Ward. If
the upstream is unreachable, unmatched requests return 503 Service Unavailable.
Matched probes continue to receive their configured decoys.
Required fields:
| Field | Meaning |
|---|---|
node_id | Stable name for this Net Ward instance |
upstream_target | HTTP service being protected |
listen_address | Host and port Net Ward binds |
Optional fields control mirror intensity, local storage, mesh placeholders, alert channels, upstream timeouts, and probe-log retention. A pattern match or the start of a request flood records an alert in SQLite. Alerts are deduplicated by kind, source, and pattern for five minutes. An empty alert_channels list sends to stdout; select any combination of stdout, email, slack, and ntfy for explicit delivery. Outbound delivery runs in the background and retries failed channels. Recent undelivered alerts are retried on startup.
Email requires alert_email, alert_smtp_host, and alert_smtp_from. Set alert_smtp_port and alert_smtp_security (starttls, ssl, or none); none is permitted only for a loopback SMTP server. If authentication is needed, set alert_smtp_username and alert_smtp_password_env to the name of an environment variable containing the password. Slack requires alert_slack_webhook. ntfy requires alert_ntfy_topic (a topic on ntfy.sh or a full self-hosted topic URL); for a protected topic, set alert_ntfy_token_env to the name of an environment variable containing its bearer token. HTTP destinations must use HTTPS except on loopback. alert_timeout_secs defaults to five seconds. Net Ward checks requested destinations at startup and stores successful delivery receipts in the alerts table. Alert messages contain the source IP, pattern ID, and classification; they do not include raw request bodies or headers.
| Optional field | Default | Meaning |
|---|---|---|
upstream_timeout_total | 10 | Whole-request budget for the upstream call, in seconds |
upstream_timeout_connect | 3 | Connect (DNS + TCP + TLS) timeout, in seconds |
upstream_timeout_sock_read | 5 | Idle time between upstream socket reads, in seconds |
upstream_max_concurrency | 64 | In-flight upstream requests |
upstream_max_body_bytes | 8388608 | Max buffered upstream response body (8 MiB). Larger bodies on unmatched requests return 503 |
probe_retention_secs | 604800 | Probe-log TTL (7 days) |
probe_max_rows | 10000 | Max probe-log rows after purge-on-write |
alert_timeout_secs | 5 | Per-channel timeout for outbound alert delivery, in seconds |
python -m netward --config config.json
Example topology:
| Component | Address |
|---|---|
| Net Ward | 127.0.0.1:8080 |
| Upstream app | http://127.0.0.1:9000 |
| Storage | netward.db |
Point your load balancer or web server at Net Ward. Keep the upstream app reachable only from the host or trusted network when possible.
Set listen_address to 0.0.0.0:<port> only when you intentionally want Net Ward reachable beyond localhost.
On Linux/macOS, keep storage_path non-world-writable. Example: chmod 600 netward.db, or chmod 644 netward.db only if you intentionally need read access for monitoring.
Net Ward sustains its documented per-box capacity continuously, but Python runtime memory pools may retain working-set state after sustained heavy load. Operators running Net Ward under continuous heavy traffic should monitor process resource usage and restart the daemon periodically, for example weekly or when RSS exceeds 2x baseline. v0.5 will refine this guidance based on operator feedback and local test observations, not automatic telemetry.
Clean request should reach upstream:
curl -i http://127.0.0.1:8080/
Known probe should be mirrored:
curl -i http://127.0.0.1:8080/wp-admin/
The WordPress probe returns a fake login page for /wp-admin, /wp-admin/
and its subpaths (such as /wp-admin/login.php), plus /wp-login.php.
Matching ignores case and does not include lookalikes such as /wp-administer.
When rendering succeeds, the upstream service does not receive the request.
Before protecting a real admin panel: disable generic_admin_login_probe
if your app uses /admin or /admin/login; disable wordpress_admin_probe
if it serves the WordPress admin paths. See Operator Commands.
A mirror-rendering error instead fails open to upstream and is logged at ERROR.
Inspection failure and an unavailable upstream are different cases: