Security

ARTEX Detection: Spot and Block AI Pentest Traffic on Linux

An ARTEX agent probing your web server works like a pentester at machine speed. It grabs source maps, learns what your 404 looks like, fuzzes a few hundred routes in a minute, tries a JWT with alg:none and then sprays passwords at one attempt per second. Microsoft, Wiz, Unit 42 and CrowdStrike have all reported threat actors using this multi-agent LLM pentest framework since October. Operators change its user agent strings first, so a blocklist of them is the weakest control you can deploy.

Original content from computingforgeeks.com - post 197037

This guide builds ARTEX detection from the behaviour up, with an nginx JSON log, a hunt script, ES|QL queries, Elastic’s merged rule and the ThreatDefence Sigma rules, then blocks the traffic with nginx, fail2ban and Suricata. Every rule below was tested in November 2026 on Ubuntu 26.04 LTS with nginx 1.28.3, Elasticsearch 9.5.7, sigma-cli 3.1.0, fail2ban 1.1.0 and Suricata 8.0.3 against our own Juice Shop box, and ARTEX itself never ran.

The traffic pattern vendors have confirmed

Microsoft’s November 25 guidance for defenders says it plainly: “The most reliable and durable signal of ARTEX activity is behavioral: ARTEX sends a wide variety of requests in a brief time and retries variations on the same technique or moves on to next-stage actions at machine speed.” The same post warns that operators “can and do vary network indicators like source IP address or user agent string.” That is the frame for everything below. Indicators raise an alert; behaviour confirms it.

The specific request patterns come from Wiz’s write-up on Storm-0940, cross-checked against Microsoft and Unit 42. We only kept a signal when a primary vendor page states it. The table rates each one by how long it survives an operator who reads the same reports you do.

SignalReported byDurability
100+ distinct paths with 50+ client errors from one source in one minuteMicrosoft hunting queryHigh: the agent needs volume to fuzz
Baseline request to /zzz-nonexistent-xyz123 before each fuzzing runWizMedium: the path string can change, the habit is structural
Fetches of .js.map, /assets/config.json, /env.js, /swagger/?format=openapiWiz, MicrosoftMedium: legitimate tools fetch some of these too
JWT with alg:none; OAuth callback with code=AAAA&state=notvalidb64!!WizMedium: exact strings are cheap to change
Password spray with a median gap of one secondWiz, Microsoft (151,000+ failed sign-ins in one campaign)High: the pacing is the attack
Short bursts of 1 to 14 requests, then a 25 to 31 second pauseUnit 42Medium
User agents artex-enrich/* and norma/* (Microsoft), norma/0.4 (Wiz), Mozilla/5.0 ARTeX (Elastic rule)Microsoft, Wiz, ElasticLow: Wiz saw more than 15 user agents and calls its list “expected to be noisy if hunted independently”

Microsoft also lists curl, Wget, Python HTTP clients and headless Chromium through Playwright as ARTEX defaults, and it says not to alert on curl or Wget alone because legitimate automation uses them. We agree, and nothing below fires on a generic client string. If you also run offensive AI tools in your own pipeline, the comparison in AI pentesting tools for CI/CD shows what your own scanners will look like in the same logs.

A lab that replays the traits, not the tool

We never installed ARTEX and never pulled an ARTEX image. A trojanized copy circulated on Docker Hub after the project went closed-source, which we come back to near the end, so running a “test copy” is its own exposure. Instead, two GCP VMs on one private subnet played the parts: edge-lab01 (10.128.15.201) ran nginx in front of OWASP Juice Shop on localhost, and probe-lab01 (10.128.15.202) sent requests that copy the published traits. If you’d rather build this on your own hardware, the Proxmox and Kali pentest lab gives you the same isolated layout.

The packages on the edge host come from the Ubuntu archive:

sudo apt-get install -y nginx docker.io suricata jq tcpdump fail2ban python3-venv pipx

Juice Shop and a single-node Elasticsearch run as containers bound to 127.0.0.1, so neither is reachable except through nginx. Elasticsearch has security turned off here, which is acceptable only on a throwaway box. On a real deployment, point the ES|QL steps at your existing cluster with its normal credentials and skip the second container. Our edge VM had 16 GB of RAM; give the pair at least 4 GB, and put the sysctl setting in /etc/sysctl.d/ if the box will reboot.

export ES_VERSION="9.5.7" # pin: version tested in this guide #https://www.elastic.co/docs/release-notes/elasticsearch
sudo sysctl -w vm.max_map_count=262144
sudo docker run -d --name juice-shop --restart unless-stopped -p 127.0.0.1:3000:3000 bkimminich/juice-shop
sudo docker run -d --name es --restart unless-stopped -p 127.0.0.1:9200:9200 \
  -e discovery.type=single-node -e xpack.security.enabled=false -e ES_JAVA_OPTS="-Xms2g -Xmx2g" \
  docker.elastic.co/elasticsearch/elasticsearch:${ES_VERSION}

The replay script lives on the probe host. It sends four recon fetches as norma/0.4, one artex-enrich/1.0 title grab, a baseline probe, 128 fuzzed paths under a normal Chrome user agent, the two JWT and OAuth probes, and 30 login attempts at one per second as python-requests/2.34.2. Open a new file for it:

vim replay.sh

Paste the script below and change T to a host you own. Most of the requests use the Chrome string on purpose, because a real agent rotates its user agent and we wanted to see which rules still fire without one.

#!/bin/bash
# Replays traits from the Wiz, Microsoft and Elastic write-ups against our own lab box. Not ARTEX.
T=http://10.128.15.201
CHROME="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"

for p in /main.js.map /assets/config.json /env.js "/swagger/?format=openapi"; do
  curl -s -o /dev/null -A "norma/0.4" "$T$p"
done
curl -s -o /dev/null -A "artex-enrich/1.0" "$T/"

curl -s -o /dev/null -A "$CHROME" "$T/zzz-nonexistent-xyz123"
for w in admin api backup config console dashboard debug dev docs env git graphql health internal login logs \
         manage metrics old private robots server-status setup staging status swagger test tmp upload users v1 v2; do
  for pre in "" rest/ api/ .well-known/; do
    curl -s -o /dev/null -A "$CHROME" "$T/$pre$w"
  done
done

NONE="eyJhbGciOiJub25lIn0.eyJlbWFpbCI6ImFkbWluQGp1aWNlLXNoLm9wIn0."
curl -s -o /dev/null -A "$CHROME" -H "Authorization: Bearer $NONE" "$T/rest/user/whoami"
curl -s -o /dev/null -A "$CHROME" "$T/sso?jwt=$NONE"
curl -s -o /dev/null -A "$CHROME" "$T/sign_in/oauth/microsoft/callback?code=AAAA&state=notvalidb64!!"

for i in $(seq 1 30); do
  curl -s -o /dev/null -w "%{http_code} " -A "python-requests/2.34.2" -H "Content-Type: application/json" \
    -d "{\"email\":\"user$i@juice-sh.op\",\"password\":\"Winter2026!\"}" "$T/rest/user/login"
  sleep 1
done
echo

A handful of normal requests from the edge host itself, sent with a Firefox user agent and including one failed login, sat in the same log for comparison. None of the rules below fired on them. That is a small control sample, so run the rules against a day of your own production logs before you alert on them.

An access log that keeps what an agent gives away

The default combined log drops the token header and gives you nothing clean to parse, so the JWT checks have nothing to work with. A JSON log written with escape=json fixes both. A map pulls the first base64url segment of any token found in the Authorization header or the jwt and token query parameters, so you log the JWT header (the algorithm) without logging the signature or the claims. Remove the stock site first so this server block is the default:

sudo rm -f /etc/nginx/sites-enabled/default
sudo vim /etc/nginx/conf.d/agent-detect.conf

Add the detection-only configuration. It still writes the combined log, so nothing that reads access.log today breaks:

map "$http_authorization $arg_jwt $arg_token" $jwt_header {
    "~(?<h>eyJ[A-Za-z0-9_-]+)\." $h;
    default "";
}

log_format agent_json escape=json
    '{"ts":"$time_iso8601","src":"$remote_addr","method":"$request_method",'
    '"uri":"$request_uri","status":$status,"bytes":$body_bytes_sent,'
    '"ua":"$http_user_agent","jwt_hdr":"$jwt_header","rt":$request_time}';

server {
    listen 80 default_server;
    server_name _;
    access_log /var/log/nginx/access.log combined;
    access_log /var/log/nginx/agent.json agent_json;
    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Test the syntax, reload, run the replay from the probe, then pull the whoami request out of the new log. The log commands from here on run as a user in the adm group, which can read /var/log/nginx; otherwise prefix them with sudo.

sudo nginx -t && sudo systemctl reload nginx
jq . <(grep /rest/user/whoami /var/log/nginx/agent.json)

The record carries the token’s header segment, eyJhbGciOiJub25lIn0, which decodes to {"alg":"none"}:

{
  "ts": "2026-11-27T12:51:50+00:00",
  "src": "10.128.15.202",
  "method": "GET",
  "uri": "/rest/user/whoami",
  "status": 200,
  "bytes": 11,
  "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
  "jwt_hdr": "eyJhbGciOiJub25lIn0",
  "rt": 0.005
}

Read the status and size together. A 200 with 11 bytes is Juice Shop returning an empty user object, so the app rejected the unsigned token. A 200 with a full user record would mean your app accepts alg:none, and that is an incident, not a detection. Check this field on your own apps before you trust any of the rules that follow.

Behavioural rules that survive a new user agent

The hunt script reads the JSON log and raises one alert per behaviour. It uses Microsoft’s one-minute threshold for fuzzing and Wiz’s pacing for the spray, and it treats a user agent match as its own low-weight alert rather than a reason to stop looking. It needs only the Python standard library:

vim agent-hunt.py

Add the script. The fuzz rule counts a request as an error when it returns a 4xx or when its size matches the response to the baseline probe, for a reason the output makes clear:

#!/usr/bin/env python3
"""Flag agentic-scanner behaviour in the nginx agent_json access log."""
import base64, json, re, statistics, sys
from collections import defaultdict
from datetime import datetime
from urllib.parse import urlsplit, parse_qs

LOG = sys.argv[1] if len(sys.argv) > 1 else "/var/log/nginx/agent.json"
PATHS_PER_MIN = 100          # Microsoft hunting threshold: 100+ distinct paths in one minute
ERRORS_PER_MIN = 50          # ...with 50+ client errors (4xx)
SPRAY_MIN, SPRAY_GAP = 20, 2.0
BASELINE = re.compile(r"zzz-nonexistent|zzz_nonexistent|notexist", re.I)
RECON = re.compile(r"\.js\.map$|/config\.json$|/env\.js$|/swagger/|openapi", re.I)
WEAK_UA = re.compile(r"^artex-|^norma/|artex|scopeweaver|hexstrike|cyberstrikeai", re.I)
B64URL = re.compile(r"^[A-Za-z0-9_-]*={0,2}$")

def b64json(seg):
    try:
        return json.loads(base64.urlsafe_b64decode(seg + "=" * (-len(seg) % 4)))
    except Exception:
        return {}

minute = defaultdict(lambda: {"paths": set(), "err": 0, "same": 0})
baseline_size, logins, seen = {}, defaultdict(list), set()

def alert(kind, src, msg):
    if (kind, src, msg) not in seen:
        seen.add((kind, src, msg))
        print(f"ALERT {kind:<14} src={src:<15} {msg}")

for line in open(LOG):
    r = json.loads(line)
    src, uri, ts = r["src"], r["uri"], datetime.fromisoformat(r["ts"])
    path, query = urlsplit(uri).path, parse_qs(urlsplit(uri).query)
    m = minute[(src, ts.strftime("%H:%M"))]
    m["paths"].add(path)
    m["err"] += 400 <= r["status"] < 500
    if BASELINE.search(path):
        baseline_size[src] = r["bytes"]
        alert("baseline-probe", src, f"{path} -> {r['status']} {r['bytes']}B")
    elif baseline_size.get(src) == r["bytes"]:
        m["same"] += 1
    if RECON.search(uri):
        alert("recon-file", src, uri)
    if r["jwt_hdr"] and str(b64json(r["jwt_hdr"]).get("alg", "")).lower() == "none":
        alert("jwt-alg-none", src, path)
    for state in query.get("state", []):
        if not B64URL.match(state):
            alert("oauth-state", src, f"{path} state={state}")
    if r["method"] == "POST" and path.endswith("/login") and r["status"] == 401:
        logins[src].append(ts)
    if WEAK_UA.search(r["ua"]):
        alert("ua-weak", src, r["ua"])

for (src, mm), m in sorted(minute.items()):
    if len(m["paths"]) >= PATHS_PER_MIN and max(m["err"], m["same"]) >= ERRORS_PER_MIN:
        alert("fuzz-burst", src, f"{mm} paths={len(m['paths'])} 4xx={m['err']} baseline-size={m['same']}")

for src, t in logins.items():
    if len(t) >= SPRAY_MIN:
        gap = statistics.median((b - a).total_seconds() for a, b in zip(t, t[1:]))
        if gap <= SPRAY_GAP:
            alert("login-spray", src, f"{len(t)} failed logins, median gap {gap:.1f}s")

Run it against the log after one pass of the replay.

python3 agent-hunt.py

Twelve alerts, all from the probe, none from the edge host’s own requests:

agent-hunt.py output listing recon-file, baseline-probe, jwt-alg-none, oauth-state, fuzz-burst and login-spray alerts from one source

The line to study is fuzz-burst 12:51 paths=138 4xx=10 baseline-size=64. The probe hit 138 distinct paths in one minute, but only 10 came back as client errors, far under Microsoft’s 50. Juice Shop is a single-page app: any unknown path returns 200 with the 9,831-byte index.html, and the baseline probe shows exactly that. A pure 4xx threshold misses fuzzing against every SPA, every catch-all route and every site that serves a soft 404. Counting responses the same size as the baseline is the fix, and it’s what the agent itself does with that probe.

The spray alert reads 30 failed logins, median gap 1.0s, the pacing Wiz describes. Humans who forget a password do not produce 30 failures at metronome timing, so this alert rarely needs a second look.

The same detections in Elasticsearch ES|QL

A script on one box is a hunt; a SIEM query across every edge is a detection. We mapped the JSON log to ECS field names and bulk-indexed it into logs-nginx.access-lab, the same index pattern the Elastic nginx integration writes. Whatever ships your logs, the queries below only work when these conditions hold:

  • The client address lands in source.ip, not only in a raw message field.
  • The path without its query string lands in url.path, and the query string in url.query.
  • The response code is a number in http.response.status_code, and the size is in http.response.body.bytes.
  • The user agent is kept unparsed in user_agent.original.

Check one document in Discover before you trust a query that returns nothing. With Filebeat or Elastic Agent and the nginx integration, the mapping is done for you. In the lab, a short shipper did the mapping and the bulk upload from the JSON log:

vim ship-to-es.py

Add the shipper. It writes into a logs-nginx.access-* data stream, so the queries below and Elastic’s rule find it without changes:

#!/usr/bin/env python3
"""Map agent_json lines to ECS and bulk-index them into logs-nginx.access-lab."""
import json, sys, urllib.request
from urllib.parse import urlsplit

ES = "http://127.0.0.1:9200"
docs = []
for line in open(sys.argv[1]):
    r = json.loads(line)
    u = urlsplit(r["uri"])
    docs.append(json.dumps({"create": {}}))
    docs.append(json.dumps({
        "@timestamp": r["ts"],
        "source": {"ip": r["src"]},
        "http": {"request": {"method": r["method"]},
                 "response": {"status_code": r["status"], "body": {"bytes": r["bytes"]}}},
        "url": {"original": r["uri"], "path": u.path, "query": u.query or None},
        "user_agent": {"original": r["ua"]},
        "host": {"name": "edge-lab01"},
        "data_stream": {"type": "logs", "dataset": "nginx.access", "namespace": "lab"},
    }))
req = urllib.request.Request(f"{ES}/logs-nginx.access-lab/_bulk?refresh=true",
                             data=("\n".join(docs) + "\n").encode(),
                             headers={"Content-Type": "application/x-ndjson"})
res = json.load(urllib.request.urlopen(req))
print(f"indexed={len(res['items'])} errors={res['errors']}")

Run it once against the log after a replay:

python3 ship-to-es.py /var/log/nginx/agent.json

Every line went in without a mapping error.

indexed=174 errors=False

A small wrapper sends a query file to the _query API and prints a text table. Create it:

vim esql.sh

Add the wrapper. On a secured cluster, add -u or an API key header to the curl call:

#!/bin/bash
# usage: esql.sh <file with an ES|QL query>
jq -Rs '{query: .}' "$1" | curl -s -XPOST "http://127.0.0.1:9200/_query?format=txt" -H "Content-Type: application/json" -d @-

Make it executable so the later steps can call it by path:

chmod +x esql.sh

The fuzz query groups by source and minute and keeps any bucket at Microsoft’s threshold. Put it in q-burst.esql:

FROM logs-nginx.access-*
| EVAL minute = DATE_TRUNC(1 minute, @timestamp),
       client_error = CASE(http.response.status_code >= 400 AND http.response.status_code < 500, 1, 0)
| STATS paths = COUNT_DISTINCT(url.path), client_errors = SUM(client_error),
        requests = COUNT(*), agents = COUNT_DISTINCT(user_agent.original) BY source.ip, minute
| WHERE paths >= 100 OR client_errors >= 50
| SORT paths DESC

We used OR here on purpose. With AND, the SPA problem above hides the burst completely. The spray query goes in q-spray.esql; change the login path to your app’s:

FROM logs-nginx.access-*
| WHERE http.request.method == "POST" AND url.path == "/rest/user/login" AND http.response.status_code == 401
| STATS failures = COUNT(*), first_seen = MIN(@timestamp), last_seen = MAX(@timestamp) BY source.ip, user_agent.original
| EVAL seconds = DATE_DIFF("second", first_seen, last_seen)
| WHERE failures >= 20
| KEEP source.ip, user_agent.original, failures, seconds

Run both with ./esql.sh q-burst.esql and ./esql.sh q-spray.esql:

ES|QL results showing a 138-path fuzzing minute and a 30-failure login spray from one source IP

The burst row shows 138 paths, 146 requests and four user agents from one source in the 12:51 minute. Four agents from one address inside a minute is a signal in its own right, because browsers do not switch identity mid-session. The spray row shows 30 failures over 30 seconds from python-requests, a client string Microsoft saw in the Storm-0940 sign-in campaign and one you cannot block outright, since half your integrations probably use it.

Elastic’s merged user agent rule

Elastic merged “LLM-Driven Penetration Testing Framework User Agent” into elastic/detection-rules on 23 November 2026 (PR #7211). It is an ES|QL rule, severity high, risk score 73, that classifies user agents for ARTEX, AntiFox, ScopeWeaver, CyberStrikeAI and HexStrike across web, cloud audit and identity logs. Fetch the TOML from main:

curl -sSfLO https://raw.githubusercontent.com/elastic/detection-rules/main/rules/cross-platform/initial_access_llm_pentest_framework_user_agent.toml
grep -m4 -E "^(name|rule_id|type|creation_date) " initial_access_llm_pentest_framework_user_agent.toml

The header fields confirm you have the merged version:

creation_date = "2026/11/20"
name = "LLM-Driven Penetration Testing Framework User Agent"
rule_id = "5a773283-3663-42ba-8862-287823c69750"
type = "esql"

Python’s built-in tomllib pulls the query field out verbatim. Append one stats line so the result groups instead of listing every document, then run it. The ARTEX branch of the rule matches artex-*, mozilla/* artex* and norma/0.4* after lowercasing, and the rule notes that norma/0.4 is shared with AntiFox:

python3 -c 'import tomllib, sys; print(tomllib.load(open(sys.argv[1], "rb"))["rule"]["query"])' initial_access_llm_pentest_framework_user_agent.toml > artex-ua.esql
echo "| stats hits = count(*) by Esql.framework, user_agent.original, source.ip" >> artex-ua.esql
./esql.sh artex-ua.esql

Against the lab index it returns two rows.

Elastic LLM-Driven Penetration Testing Framework User Agent rule query returning norma and artex-enrich hits in ES|QL

Four norma/0.4 hits and one artex-enrich/1.0: the rule saw 5 of the roughly 167 requests the probe sent. It parses and fires, and that ratio is the honest measure of a user agent rule. The rule’s own triage note says these agents self-identify on only a fraction of their traffic, and Elastic sets alert suppression to one hour so it does not flood. Deploy it as a tripwire, then pivot to the source IP in the behavioural queries above.

A follow-up, PR #7254 (“[Tuning] Potential Agentic Offensive Frameworks User Agent”), renames the rule and rewrites the ARTEX condition. When we checked on 27 November 2026 it was still open. Its current diff adds a * artex-* pattern, drops the mozilla/* artex* branch and narrows norma/0.4* to an exact match, so Mozilla/5.0 ARTeX would stop matching. Do not copy the query from the PR branch. When it merges, re-fetch from main and keep the Mozilla pattern in your nginx map if you still want it.

ThreatDefence Sigma rules converted to ES|QL

ThreatDefence publishes MIT-licensed detections for more than 70 agentic frameworks in Sigma, KQL, Suricata, Zeek, YARA and WAF formats. Its README says the ARTEX packet capture in the repo is synthetic test traffic, so treat its rules as derived from reports, as ours are. Install the Sigma CLI with pipx. The 4.x CLI couldn’t load the Elasticsearch backend in our run (the error is in troubleshooting), so pin the 3.x line:

pipx install "sigma-cli<4" #https://github.com/SigmaHQ/sigma-cli/releases
pipx inject sigma-cli pysigma-backend-elasticsearch
git clone -q --depth 1 https://github.com/ThreatDefence/agentic-attack-detections
ls agentic-attack-detections/frameworks/artex/sigma/web

The web folder holds four rules:

web_artex_placeholder_probe_paths.yml
web_artex_probe_header.yml
web_artex_user_agent.yml
web_oauth_callback_probe.yml

The rules use the generic webserver field names (cs-uri-stem, cs-user-agent), which do not exist in ECS. A small pySigma pipeline maps them. Create it next to the clone:

vim nginx-ecs.yml

Add the field mapping, scoped to the webserver log source so it never rewrites other rule types:

name: nginx access log in ECS
priority: 100
transformations:
  - id: webserver_to_ecs
    type: field_name_mapping
    mapping:
      cs-user-agent: user_agent.original
      cs-uri-stem: url.path
      cs-uri-query: url.query
      cs-method: http.request.method
      sc-status: http.response.status_code
    rule_conditions:
      - type: logsource
        category: webserver

Validate the rules, then convert one to see the mapped query:

sigma check agentic-attack-detections/frameworks/artex/sigma/web | tail -4
sigma convert -t esql -p nginx-ecs.yml agentic-attack-detections/frameworks/artex/sigma/web/web_artex_placeholder_probe_paths.yml | tail -1

The check reports no errors, and the conversion now targets ECS fields. The progress lines go to stderr, so they survive the tail:

Parsing Sigma rules
Checking Sigma rules
Found 0 errors, 0 condition errors and 0 issues.
No rule errors found.
No condition errors found.
No validation issues found.
Parsing Sigma rules
from * metadata _id, _index, _version | where url.path like "*/zzz-nonexistent-xyz123*" or url.path like "*zzz_nonexistent_abc.txt*" or url.path like "*Notexist-xyz*"

We ran three of the four rules. web_artex_probe_header.yml matches on request headers, which an access log does not record, so it belongs on a WAF or a proxy that logs headers. For each of the other three we swapped from * for from logs-nginx.access-*, appended a stats hits = count(*) by source.ip, url.path line, and ran it through esql.sh:

sigma check passing on the ThreatDefence ARTEX web rules and each converted ES|QL query returning one hit

Each of the three hit once. The user agent rule caught only artex-enrich/1.0 on /, because its list does not include norma/0.4; the Elastic rule does. Run both if you run either. The baseline-path and OAuth rules hit the exact strings Wiz published, which is precisely their weakness: change xyz123 to anything else and they go quiet, while the size-match logic in the hunt script keeps working.

Blocking at nginx without trusting the user agent

Detection tells you an agent is working through your app. These four nginx controls cost it the cheap wins. Each one targets a step the agent depends on, and only one of them looks at the user agent:

  • A request with a known agent user agent gets a 403, as a tripwire that also logs.
  • A request carrying an alg:none JWT gets a 401 before it reaches the app.
  • A request for a .js.map file gets a 404, so production source maps never leave the box.
  • The login route accepts 10 requests a minute per source with a burst of 5, and answers the rest with 429.

Replace the detection file with the blocking version. The log format and JWT map stay the same, so the hunt script and the SIEM queries keep working:

sudo vim /etc/nginx/conf.d/agent-detect.conf

The alg:none map checks three casings of the base64url header, because the encoding changes with the case of “none”:

map "$http_authorization $arg_jwt $arg_token" $jwt_header {
    "~(?<h>eyJ[A-Za-z0-9_-]+)\." $h;
    default "";
}

# Weak signal: self-identifying agent user agents (Elastic rule + ThreatDefence list)
map $http_user_agent $agent_ua {
    default                 0;
    "~*^artex-"             1;
    "~*^mozilla/\S+ artex"  1;
    "~*^norma/0\.4"         1;
    "~*scopeweaver"         1;
}

# {"alg":"none"...} base64url-encoded with alg as the first key
map $jwt_header $jwt_none {
    default                 0;
    "~^eyJhbGciOiJub25l"    1;
    "~^eyJhbGciOiJOb25l"    1;
    "~^eyJhbGciOiJOT05F"    1;
}

limit_req_zone $binary_remote_addr zone=login:10m rate=10r/m;

log_format agent_json escape=json
    '{"ts":"$time_iso8601","src":"$remote_addr","method":"$request_method",'
    '"uri":"$request_uri","status":$status,"bytes":$body_bytes_sent,'
    '"ua":"$http_user_agent","jwt_hdr":"$jwt_header","rt":$request_time}';

server {
    listen 80 default_server;
    server_name _;

    access_log /var/log/nginx/access.log combined;
    access_log /var/log/nginx/agent.json agent_json;

    if ($agent_ua) { return 403; }
    if ($jwt_none) { return 401; }

    location ~ \.js\.map$ { return 404; }

    location = /rest/user/login {
        limit_req zone=login burst=5 nodelay;
        limit_req_status 429;
        proxy_pass http://127.0.0.1:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

The map only catches alg as the first JSON key with no space after the colon. A header written as {"alg": "none"}, as Python’s default json.dumps produces, encodes to eyJhbGciOiAibm9uZSI and slips past it, as does a header with typ first. The hunt script decodes the header and catches both. Your app must still reject unsigned tokens itself; this is a second layer, not the fix. Test and reload:

sudo nginx -t && sudo systemctl reload nginx

From the probe, a short test script sends each blocked pattern plus a python-requests control, then 15 login attempts one second apart (block-test.sh and spray-test.sh in our lab, with fail2ban from the next section already running):

curl tests against nginx returning 403 for agent user agents, 401 for an alg none JWT, 404 for a source map and 429 then timeouts for a login spray

All three agent strings got 403, including the mixed-case Mozilla/5.0 ARTeX, and python-requests still got 200, which is what you want. The spray line shows the layers stacking: seven 401s from the app, three 429s from limit_req, then 000 as curl times out because fail2ban dropped the source at the firewall. The rate limit alone slows a spray. It takes the ban to stop one.

Banning login sprays with fail2ban

A spray at one attempt per second stays under most per-second limits, so the ban has to count failures over a window. The filter reads the JSON log and counts both 401s and 429s on the login route, so a source that keeps hammering after the rate limit kicks in still adds to its count:

sudo vim /etc/fail2ban/filter.d/nginx-agent-login.conf

Anchor the regex on the src field, not on the start of the line. fail2ban strips the matched timestamp before it applies failregex, so a pattern that starts with {"ts": never matches:

[Definition]
failregex = "src":"<HOST>","method":"POST","uri":"/rest/user/login","status":(?:401|429),
datepattern = "ts":"%%Y-%%m-%%dT%%H:%%M:%%S

Now the jail, which bans for an hour after 10 failures in 60 seconds through nftables:

sudo vim /etc/fail2ban/jail.d/nginx-agent-login.local

Add the jail definition.

[nginx-agent-login]
enabled  = true
port     = http,https
filter   = nginx-agent-login
logpath  = /var/log/nginx/agent.json
maxretry = 10
findtime = 60
bantime  = 3600
banaction = nftables-multiport

Before you restart, add your own egress ranges to ignoreip in the jail, or the first test from your desk bans you. Then restart fail2ban, run the spray from the probe, and check the jail and the nftables set it manages:

sudo systemctl restart fail2ban
sudo fail2ban-client status nginx-agent-login
sudo nft list set inet f2b-table addr-set-nginx-agent-login

The probe’s address sits in the ban set.

fail2ban-client status for the nginx-agent-login jail and the nftables set holding the banned source address

Ten failures in a minute is strict for a public login page. Real users rarely fail that often, but a shared office NAT can, which is another reason to fill in ignoreip. If the box also runs UFW, the nftables ban sits alongside it; the UFW guide for Ubuntu 26.04 shows how the two rule sets coexist. An IP ban will not hold off an agent that rotates addresses, which is exactly why the ES|QL spray query groups by user agent as well.

Suricata rules for traffic outside nginx

Some of your web traffic never reaches an nginx you control: appliances, vendor portals, old apps on someone else’s stack. A sensor on a span port or a pcap still sees it. These six local rules cover the same signals, with a threshold on the login route instead of a user agent match for the spray:

sudo vim /etc/suricata/rules/agentic-web.rules

Add the rules. The SIDs start at 9100001, a block that neither ET Open nor our vendor sets use; sidallocation.org reserves 1000000 to 1999999 for local rules if you prefer to stay inside that convention:

alert http any any -> any any (msg:"LOCAL agentic framework user agent norma/0.4"; flow:established,to_server; http.user_agent; content:"norma/0.4"; startswith; classtype:web-application-attack; sid:9100001; rev:1;)
alert http any any -> any any (msg:"LOCAL ARTEX self-identifying user agent"; flow:established,to_server; http.user_agent; content:"artex-"; nocase; startswith; classtype:web-application-attack; sid:9100002; rev:1;)
alert http any any -> any any (msg:"LOCAL scanner 404 baseline probe path"; flow:established,to_server; http.uri; content:"/zzz-nonexistent-xyz123"; classtype:web-application-attack; sid:9100003; rev:1;)
alert http any any -> any any (msg:"LOCAL OAuth callback with invalid state"; flow:established,to_server; http.uri; content:"state=notvalidb64!!"; classtype:web-application-attack; sid:9100004; rev:1;)
alert http any any -> any any (msg:"LOCAL JWT with alg none in Authorization"; flow:established,to_server; http.header; content:"Bearer eyJhbGciOiJub25l"; classtype:web-application-attack; sid:9100005; rev:1;)
alert http any any -> any any (msg:"LOCAL login POST burst from one source"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/rest/user/login"; threshold:type both, track by_src, count 10, seconds 60; classtype:attempted-user; sid:9100006; rev:1;)

We captured one replay on the edge host’s interface with sudo timeout 60 tcpdump -i ens4 -w /tmp/replay.pcap "tcp port 80". Load-test the rules, then read the pcap with checksum validation off:

sudo suricata -T -c /etc/suricata/suricata.yaml -S /etc/suricata/rules/agentic-web.rules
sudo suricata -k none -c /etc/suricata/suricata.yaml -S /etc/suricata/rules/agentic-web.rules -r /tmp/replay.pcap -l /tmp/sur
cut -d" " -f2- /tmp/sur/fast.log

All six SIDs fired across nine alerts.

Suricata fast.log with alerts from all six local agentic web rules on the replay pcap

The login threshold fired once, not 30 times, because type both alerts once per window per source. Without -k none the same pcap produced only three alerts; the troubleshooting section explains why. Suricata sees HTTP in clear text only, so put the sensor behind your TLS terminator or feed it the decrypted mirror.

Your own host is not an ARTEX console

The second exposure is on your side of the wire. According to BadByte’s analysis, a backdoored tomicdd/artex image was pushed to Docker Hub on the evening of 8 October, hours after the author announced ARTEX would go closed-source. Security Affairs, relaying Genians, reports the project’s removal on 11 October instead. We found no primary Genians statement, so treat that date as unconfirmed. The image drew about 9,131 pulls, and was removed with congdonglinux/artex on 5 November. BadByte also reports that the project’s compose file published port 8787 on all interfaces and that it found 62 backdoored consoles, most on 8787. No vendor report we read names 8787, so treat the port as BadByte’s finding. Anyone on your team who “just tried” ARTEX may have shipped an exposed console, so check the hosts you own:

sudo ss -ltnp "sport = :8787"
sudo docker images --format "{{.Repository}}:{{.Tag}}" | grep -iE "artex|tomicdd|congdonglinux" || echo "no ARTEX images on this host"
sudo docker ps -a --format "{{.Names}} {{.Image}} {{.Ports}}"

Our edge host came back clean.

ss showing nothing listening on port 8787 and docker images showing no ARTEX or tomicdd images on the host

Nothing on 8787, no matching images, and both containers bound to 127.0.0.1. An empty ss line does not prove the console never ran, so check image history and shell history too. CrowdStrike’s VAPOR PANDA report gives endpoint markers that extend the check past Docker. On every host you own, these should hold:

  • No process command line contains artx or artex.
  • No cloud role or service account name starts with artx.
  • No Windows host has a C:\ProgramData\artx5v\ directory.

Those hunts run on endpoint telemetry, and what an EDR agent sees on a Linux server shows what that data looks like. The same supply chain lesson applies to Python packages, and our agent framework PyPI malware check walks through it.

Troubleshooting

Error: Plugin not compatible with installed pySigma version!

sigma-cli 4.0.1 printed this on sigma plugin install elasticsearch in November 2026. Forcing it with -f, or running pipx inject on the 4.x CLI, pulls pySigma back to a version the 4.x CLI can’t import, and every sigma command then fails with No module named 'sigma.policy'. Uninstall the CLI, install the 3.x line with pipx install "sigma-cli<4" and inject pysigma-backend-elasticsearch. Check sigma list targets for the esql and lucene rows.

Suricata misses user agent rules on a capture from a cloud VM

Our first run on the pcap produced three alerts, and eve.json held only 64 http events against 171 flows. On the capturing host, its own outbound packets are recorded before the NIC offload fills in their checksums, so Suricata rejects them and the HTTP sessions never reassemble. Add -k none for offline reads. For live capture, set checksum-checks: no under the interface in the af-packet or pcap section of suricata.yaml. A sensor on a real span port does not usually need it.

Fuzzing doesn’t trip the 4xx threshold

If your app serves index.html for unknown routes, fuzzed paths return 200 and Microsoft’s “50 client errors” condition never fires. Request /zzz-nonexistent-xyz123 yourself, note the size, and count same-size responses as errors as the hunt script does. In ES|QL, add http.response.body.bytes to the burst query and filter on your baseline size.

fail2ban bans the tester immediately after a restart

On restart, fail2ban re-reads the existing log, and failures still inside findtime count again. Clear it with sudo fail2ban-client set nginx-agent-login unbanip 10.128.15.202 and wait out the 60-second window before you test again.

ARTEX detection audit checklist

Work through this on each internet-facing web host. Every item is a condition you can check, and the behavioural ones come first because they are the ones that last:

  1. The access log records source, path, status, response size, user agent and the JWT header segment as JSON.
  2. Your apps return an empty or 401 response to a token with alg:none.
  3. A query alerts on 100+ distinct paths from one source in a minute, with errors counted by status or by baseline size.
  4. A query alerts on 20+ failed logins from one source, and the hunt confirms a median gap of two seconds or less.
  5. The Elastic user agent rule from main and the ThreatDefence Sigma rules both run, and both fire on a test request.
  6. Source maps, /env.js and runtime config files return 404 in production.
  7. The login route is rate-limited, and fail2ban bans a source after repeated 401 or 429 responses.
  8. No host you own listens on 8787 or holds a tomicdd/artex or congdonglinux/artex image.

If you can only do two, do items 3 and 4: they rest on the volume and pacing an agent cannot drop without slowing itself down. The user agent items are worth the five minutes they take, but they caught 5 of our 167 requests, and the operator controls that number, not you. When you want to see how these detections fit alongside SAST and DAST in the rest of your pipeline, SAST vs DAST vs IAST vs SCA lays out what each layer catches.

Keep reading

Java4Shell (CVE-2026-114938): Find and Patch Vulnerable JVMs Security Java4Shell (CVE-2026-114938): Find and Patch Vulnerable JVMs UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 Security UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 nginx HTTP/2 RCE CVE-2026-123007: Check, Disable HTTP/2, Patch Security nginx HTTP/2 RCE CVE-2026-123007: Check, Disable HTTP/2, Patch WP Rocket CVE-2026-125812: Check, Patch and Hunt Planted Files Security WP Rocket CVE-2026-125812: Check, Patch and Hunt Planted Files Enable Post-Quantum TLS in Nginx, Apache, HAProxy and OpenSSH Security Enable Post-Quantum TLS in Nginx, Apache, HAProxy and OpenSSH Install Passbolt Password Manager on Ubuntu 26.04 / 24.04 Desktop Install Passbolt Password Manager on Ubuntu 26.04 / 24.04

Leave a Comment

Press ESC to close