{
  "hunt": {
    "meta": {
      "tlp": "clear",
      "hunt": {
        "handoff": "promote-to-detection",
        "trigger": "intel-report",
        "methodology": "model-assisted",
        "applicability": "campaign-specific",
        "justification": "The agent-framework PyPI compromise targeted high-value Azure and GitHub tokens. A negative result for exfiltration over the past 14 days provides assurance that no secret theft occurred during the active infection window."
      },
      "name": "Agent-Framework Exfiltration to Webhook.site",
      "type": "investigation",
      "labels": [
        "hunt",
        "attack.t1041",
        "credential access",
        "execution",
        "exfiltration",
        "initial access",
        "persistence"
      ],
      "series": {
        "slug": "we-caught-the-agent-framework-pypi-compromise-six-minutes-after-it-published",
        "index": 2,
        "title": "We caught the agent-framework PyPI compromise six minutes after it published",
        "total": 2
      },
      "related": [
        {
          "hunt": "agent-framework-pypi-persistence",
          "reason": "This hunt focuses on the exfiltration phase, which is preceded by the persistence and harvesting phases.",
          "relation": "follows"
        },
        {
          "hunt": "malicious-python-package-persistence-secret-theft",
          "relation": "follows"
        }
      ],
      "targets": {
        "web": {
          "name": "Web server / proxy logs",
          "category": "siem",
          "telemetry": [
            "network"
          ]
        },
        "hunter": {
          "name": "Hunt agent",
          "agent": true
        },
        "analyst": {
          "name": "Tier-2 analyst",
          "role": "analyst"
        },
        "network": {
          "name": "Network telemetry",
          "category": "network",
          "telemetry": [
            "network"
          ]
        },
        "endpoint": {
          "name": "Endpoint telemetry (hb_ surfaces)",
          "category": "endpoint",
          "telemetry": [
            "endpoint"
          ]
        }
      },
      "analysis": "A simple detection rule for webhook.site lookups is often tuned out in development environments. This hunt correlates DNS leads with specific HTTP metadata and stack-counts Python network flows to identify the exact behavioral signature of the agent-framework stealer, reducing false positives from legitimate testing.",
      "coverage": [
        {
          "stage": "exfiltration-to-webhook-site",
          "steps": [
            "dns-lead-lookups",
            "http-metadata-check",
            "outbound-connection-check"
          ],
          "status": "covered"
        },
        {
          "stage": "credential-access-secret-harvesting",
          "reason": "Belongs to the precursor hunt focusing on file access and process injection.",
          "status": "out_of_scope"
        },
        {
          "stage": "initial-access-malicious-pypi-package",
          "reason": "Belongs to another part of the 'We caught the agent-framework PyPI compromise six minutes after it published' series.",
          "status": "out_of_scope"
        },
        {
          "stage": "persistence-python-pth-hook",
          "reason": "Belongs to another part of the 'We caught the agent-framework PyPI compromise six minutes after it published' series.",
          "status": "out_of_scope"
        },
        {
          "stage": "execution-background-stealer-fork",
          "reason": "Belongs to another part of the 'We caught the agent-framework PyPI compromise six minutes after it published' series.",
          "status": "out_of_scope"
        }
      ],
      "scenario": {
        "stages": [
          {
            "name": "Malicious PyPI package installation",
            "slug": "initial-access-malicious-pypi-package",
            "tactic": "initial-access",
            "techniques": [
              "T1195.002"
            ],
            "observables": [
              "agent-framework==1.26.1",
              "agent-framework==1.26.2",
              "d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110",
              "3d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9"
            ]
          },
          {
            "name": "Persistence via Python .pth hook",
            "slug": "persistence-python-pth-hook",
            "tactic": "persistence",
            "techniques": [
              "T1546"
            ],
            "observables": [
              "agent_framework_meta.pth",
              "af_runtime_diag.pth",
              "_telemetry.py",
              "af_runtime_diag.py",
              "21f28e8517a10ffe431f8d68f5875c85eca4001ae6d118322b0a41873998eb5e",
              "325e7e9f0ec94e41ad1a1b7a3f18a6b8b5bffece2e2b97b8d3369eb967452f93"
            ]
          },
          {
            "name": "Background stealer execution",
            "slug": "execution-background-stealer-fork",
            "tactic": "execution",
            "techniques": [
              "T1059.006"
            ],
            "observables": [
              "os.fork()",
              "os.setsid()",
              "_AF_TEL",
              "threading.Thread",
              "t.daemon = True"
            ]
          },
          {
            "name": "Credential harvesting from disk and memory",
            "slug": "credential-access-secret-harvesting",
            "tactic": "credential-access",
            "techniques": [
              "T1555",
              "T1003",
              "T1528"
            ],
            "observables": [
              "~/.azure",
              "/proc/*/environ",
              "pip.conf",
              ".npmrc",
              ".git-credentials",
              "config.json",
              "SYSTEM_ACCESSTOKEN",
              "IDENTITY_HEADER"
            ]
          },
          {
            "name": "Network exfiltration to webhook.site",
            "slug": "exfiltration-to-webhook-site",
            "tactic": "exfiltration",
            "techniques": [
              "T1041"
            ],
            "observables": [
              "webhook.site",
              "af-runtime-diagnostics/1",
              "runtime-diagnostics/1",
              "d381fd80-ec62-42ad-8f5c-d1b15103c9bb"
            ]
          }
        ],
        "summary": "The agent-framework PyPI package (versions 1.26.1 and 1.26.2) was compromised to include a persistent credential stealer triggered by a .pth startup hook. The malware executes in the background of any Python process to harvest cloud tokens, environment variables, and configuration files from the filesystem and process memory for exfiltration to webhook.site."
      },
      "severity": "high",
      "rationale": "Focus on CI/CD runners, build servers, and developer laptops where Python is frequently used. Use the lookback window to cover the period immediately following the 2026-11-18 publication of the malicious packages.",
      "guardrails": {
        "claims": "no_unsupported",
        "evidence": "citation_required",
        "telemetry": "untrusted",
        "missing_data": "not_benign"
      },
      "hypothesis": "An intruder is exfiltrating harvested cloud and developer credentials from Python runtimes to a malicious webhook.site endpoint following the agent-framework PyPI compromise.",
      "parameters": {
        "user_agents": {
          "from": {
            "ref": "elastic-security-labs",
            "kind": "article",
            "observed": "2026-11-18"
          },
          "type": "list[string]",
          "default": [
            "af-runtime-diagnostics/1",
            "runtime-diagnostics/1"
          ],
          "description": "Custom User-Agents used by the stealer for POST requests."
        },
        "exfil_domains": {
          "from": {
            "ref": "elastic-security-labs",
            "kind": "article",
            "observed": "2026-11-18"
          },
          "type": "list[domain]",
          "default": [
            "webhook.site"
          ],
          "description": "Exfiltration domains named in the report."
        },
        "lookback_days": {
          "from": {
            "ref": "standard-retention",
            "kind": "manual",
            "observed": "2026-11-18"
          },
          "type": "number",
          "default": "14",
          "description": "Days of history to examine."
        },
        "exfil_path_uuid": {
          "from": {
            "ref": "elastic-security-labs",
            "kind": "article",
            "observed": "2026-11-18"
          },
          "type": "string",
          "default": "d381fd80-ec62-42ad-8f5c-d1b15103c9bb",
          "description": "The specific UUID fragment observed in the exfiltration URL."
        }
      },
      "provenance": {
        "authors": [
          {
            "org": "huntbase.io",
            "name": "Huntbase hunt generation"
          }
        ],
        "generated": {
          "by": "huntbase-hunt-generation",
          "from": "https://www.elastic.co/security-labs/threat-command/we-caught-the-agent-framework-pypi-compromise-six-minutes-after-it-published",
          "gates": [
            "dry-run",
            "lint"
          ],
          "model": "hb_google/gemini-3-flash-preview"
        }
      },
      "references": [
        {
          "url": "https://www.elastic.co/security-labs/threat-command/we-caught-the-agent-framework-pypi-compromise-six-minutes-after-it-published",
          "name": "Elastic Security Labs \u2014 We caught the agent-framework PyPI compromise"
        }
      ],
      "blind_spots": [
        {
          "id": "no-http-payload-visibility",
          "risk": "If traffic is encrypted and not inspected, the hunt relies on DNS and network flow headers, which may be insufficient to distinguish the stealer from legitimate developer tools.",
          "stage": "exfiltration-to-webhook-site",
          "question": "whether we can see the User-Agent and URL path for encrypted traffic to webhook.site",
          "requires": "TLS inspection or proxy logs in hb_http_activity"
        },
        {
          "id": "short-lived-containers",
          "risk": "Ephemeral build nodes may not persist the network telemetry or DNS logs required to see the theft if they are rotated before the hunt runs.",
          "stage": "exfiltration-to-webhook-site",
          "question": "whether exfiltration occurred from a build container that has since been destroyed",
          "requires": "Log persistent storage for ephemeral build environments"
        }
      ]
    },
    "name": "Agent-Framework Exfiltration to Webhook.site",
    "description": "This hunt targets the network-based exfiltration stage of the agent-framework supply-chain compromise. It identifies Python processes resolving and connecting to webhook.site infrastructure used by the stealer. The hunt uses a funnel flow to find DNS leads, then corroborates them with HTTP metadata (specific User-Agents and URL paths) and network flow patterns. By checking for the specific af-runtime-diagnostics User-Agent and the zlib-compressed POST behavior, it differentiates malicious exfiltration from legitimate developer testing of webhook endpoints."
  },
  "nodes": [
    {
      "id": "hypothesis",
      "type": "hypothesis",
      "label": "Hypothesis",
      "config": {
        "tags": [],
        "series": {
          "slug": "we-caught-the-agent-framework-pypi-compromise-six-minutes-after-it-published",
          "index": 2,
          "title": "We caught the agent-framework PyPI compromise six minutes after it published",
          "total": 2
        },
        "coverage": [
          {
            "stage": "exfiltration-to-webhook-site",
            "steps": [
              "dns-lead-lookups",
              "http-metadata-check",
              "outbound-connection-check"
            ],
            "status": "covered"
          },
          {
            "stage": "credential-access-secret-harvesting",
            "reason": "Belongs to the precursor hunt focusing on file access and process injection.",
            "status": "out_of_scope"
          },
          {
            "stage": "initial-access-malicious-pypi-package",
            "reason": "Belongs to another part of the 'We caught the agent-framework PyPI compromise six minutes after it published' series.",
            "status": "out_of_scope"
          },
          {
            "stage": "persistence-python-pth-hook",
            "reason": "Belongs to another part of the 'We caught the agent-framework PyPI compromise six minutes after it published' series.",
            "status": "out_of_scope"
          },
          {
            "stage": "execution-background-stealer-fork",
            "reason": "Belongs to another part of the 'We caught the agent-framework PyPI compromise six minutes after it published' series.",
            "status": "out_of_scope"
          }
        ],
        "rationale": "An intruder is exfiltrating harvested cloud and developer credentials from Python runtimes to a malicious webhook.site endpoint following the agent-framework PyPI compromise.",
        "blind_spots": [
          {
            "id": "no-http-payload-visibility",
            "risk": "If traffic is encrypted and not inspected, the hunt relies on DNS and network flow headers, which may be insufficient to distinguish the stealer from legitimate developer tools.",
            "stage": "exfiltration-to-webhook-site",
            "question": "whether we can see the User-Agent and URL path for encrypted traffic to webhook.site",
            "requires": "TLS inspection or proxy logs in hb_http_activity"
          },
          {
            "id": "short-lived-containers",
            "risk": "Ephemeral build nodes may not persist the network telemetry or DNS logs required to see the theft if they are rotated before the hunt runs.",
            "stage": "exfiltration-to-webhook-site",
            "question": "whether exfiltration occurred from a build container that has since been destroyed",
            "requires": "Log persistent storage for ephemeral build environments"
          }
        ],
        "scoping_notes": "Focus on CI/CD runners, build servers, and developer laptops where Python is frequently used. Use the lookback window to cover the period immediately following the 2026-11-18 publication of the malicious packages.",
        "beyond_detection": "A simple detection rule for webhook.site lookups is often tuned out in development environments. This hunt correlates DNS leads with specific HTTP metadata and stack-counts Python network flows to identify the exact behavioral signature of the agent-framework stealer, reducing false positives from legitimate testing."
      }
    },
    {
      "id": "dns-lead-lookups",
      "type": "query",
      "label": "Python DNS lookups for webhook.site",
      "config": {
        "dsl": "sqlite",
        "role": "baseline",
        "source": "endpoint",
        "content": "SELECT device_hostname, process_name, query_hostname, COUNT(*) AS lookup_count, MIN(time) AS first_seen, MAX(time) AS last_seen FROM hb_dns_activity WHERE (LOWER(process_name) LIKE '%python%' OR LOWER(process_name) LIKE '%python.exe%') AND instr(',' || '{{exfil_domains}}' || ',', ',' || LOWER(query_hostname) || ',') > 0 AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY device_hostname, process_name, query_hostname ORDER BY last_seen DESC",
        "surface": "hb_dns_activity",
        "description": "Find hosts where a Python runtime resolved the exfiltration infrastructure, acting as the primary lead for the funnel.",
        "expected_signal": "Python processes resolving webhook.site. While common for development, lookups from build agents or servers are high-confidence indicators of potential compromise."
      },
      "parents": [
        {
          "id": "hypothesis"
        }
      ],
      "primitive_config": {
        "dsl": "sqlite",
        "role": "baseline",
        "label": "Python DNS lookups for webhook.site",
        "reads": [
          "device_hostname",
          "process_name",
          "query_hostname",
          "time"
        ],
        "source": "hb_dns_activity",
        "target": "endpoint",
        "content": "SELECT device_hostname, process_name, query_hostname, COUNT(*) AS lookup_count, MIN(time) AS first_seen, MAX(time) AS last_seen FROM hb_dns_activity WHERE (LOWER(process_name) LIKE '%python%' OR LOWER(process_name) LIKE '%python.exe%') AND instr(',' || '{{exfil_domains}}' || ',', ',' || LOWER(query_hostname) || ',') > 0 AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY device_hostname, process_name, query_hostname ORDER BY last_seen DESC",
        "silence": "not_evidence_of_absence",
        "baseline": {
          "window": "{{lookback_days}}d",
          "compare": "first_seen"
        },
        "expected": "Python processes resolving webhook.site. While common for development, lookups from build agents or servers are high-confidence indicators of potential compromise.",
        "verified": "dry-run",
        "prevalence": {
          "by": "device_hostname",
          "key": [
            "query_hostname"
          ],
          "rare_below": 5
        },
        "verified_at": "2026-11-19"
      }
    },
    {
      "id": "http-metadata-check",
      "type": "query",
      "label": "Malicious HTTP POST telemetry",
      "config": {
        "dsl": "sqlite",
        "role": "detection-candidate",
        "source": "web",
        "content": "SELECT device_hostname, url_hostname, url_path, user_agent, http_method, time FROM hb_http_activity WHERE http_method = 'POST' AND (instr(',' || '{{user_agents}}' || ',', ',' || user_agent || ',') > 0 OR url_path LIKE '%{{exfil_path_uuid}}%') AND time >= datetime('now', '-{{lookback_days}} days') ORDER BY time DESC",
        "surface": "hb_http_activity",
        "description": "Identify POST requests that use the stealer's custom User-Agents or include the unique UUID fragment in the URL path.",
        "expected_signal": "POST requests to webhook.site or rare domains with the specific User-Agent. This confirms the malicious tool is communicating."
      },
      "parents": [
        {
          "id": "dns-lead-lookups"
        }
      ],
      "primitive_config": {
        "dsl": "sqlite",
        "role": "detection-candidate",
        "label": "Malicious HTTP POST telemetry",
        "reads": [
          "device_hostname",
          "http_method",
          "time",
          "url_hostname",
          "url_path",
          "user_agent"
        ],
        "source": "hb_http_activity",
        "target": "web",
        "content": "SELECT device_hostname, url_hostname, url_path, user_agent, http_method, time FROM hb_http_activity WHERE http_method = 'POST' AND (instr(',' || '{{user_agents}}' || ',', ',' || user_agent || ',') > 0 OR url_path LIKE '%{{exfil_path_uuid}}%') AND time >= datetime('now', '-{{lookback_days}} days') ORDER BY time DESC",
        "silence": "not_evidence_of_absence",
        "expected": "POST requests to webhook.site or rare domains with the specific User-Agent. This confirms the malicious tool is communicating.",
        "verified": "dry-run",
        "verified_at": "2026-11-19"
      }
    },
    {
      "id": "outbound-connection-check",
      "type": "query",
      "label": "Python outbound flow patterns",
      "config": {
        "dsl": "sqlite",
        "role": "baseline",
        "source": "network",
        "content": "SELECT device_hostname, process_name, dst_endpoint_ip, dst_endpoint_port, COUNT(*) as connection_count, MIN(time) as first_seen FROM hb_network_connection WHERE (LOWER(process_name) LIKE '%python%' OR LOWER(process_name) LIKE '%python.exe%') AND direction = 'outbound' AND NOT (dst_endpoint_ip LIKE '10.%' OR dst_endpoint_ip LIKE '172.1[6-9].%' OR dst_endpoint_ip LIKE '172.2[0-9].%' OR dst_endpoint_ip LIKE '172.3[0-1].%' OR dst_endpoint_ip LIKE '192.168.%') AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY device_hostname, process_name, dst_endpoint_ip, dst_endpoint_port ORDER BY connection_count ASC",
        "surface": "hb_network_connection",
        "description": "Corroborate that Python processes on the lead hosts are making outbound connections to non-internal IP addresses.",
        "expected_signal": "A Python process making infrequent outbound connections to public IP addresses. This provides the low-level connection record for hosts where HTTP logs might be encrypted."
      },
      "parents": [
        {
          "id": "dns-lead-lookups"
        }
      ],
      "primitive_config": {
        "dsl": "sqlite",
        "role": "baseline",
        "label": "Python outbound flow patterns",
        "reads": [
          "device_hostname",
          "direction",
          "dst_endpoint_ip",
          "dst_endpoint_port",
          "process_name",
          "time"
        ],
        "source": "hb_network_connection",
        "target": "network",
        "content": "SELECT device_hostname, process_name, dst_endpoint_ip, dst_endpoint_port, COUNT(*) as connection_count, MIN(time) as first_seen FROM hb_network_connection WHERE (LOWER(process_name) LIKE '%python%' OR LOWER(process_name) LIKE '%python.exe%') AND direction = 'outbound' AND NOT (dst_endpoint_ip LIKE '10.%' OR dst_endpoint_ip LIKE '172.1[6-9].%' OR dst_endpoint_ip LIKE '172.2[0-9].%' OR dst_endpoint_ip LIKE '172.3[0-1].%' OR dst_endpoint_ip LIKE '192.168.%') AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY device_hostname, process_name, dst_endpoint_ip, dst_endpoint_port ORDER BY connection_count ASC",
        "silence": "not_evidence_of_absence",
        "baseline": {
          "window": "{{lookback_days}}d",
          "compare": "first_seen"
        },
        "expected": "A Python process making infrequent outbound connections to public IP addresses. This provides the low-level connection record for hosts where HTTP logs might be encrypted.",
        "verified": "dry-run",
        "prevalence": {
          "by": "device_hostname",
          "key": [
            "dst_endpoint_ip"
          ],
          "rare_below": 3
        },
        "verified_at": "2026-11-19"
      }
    },
    {
      "id": "exfil-triage",
      "type": "analytic",
      "label": "Weigh exfiltration evidence",
      "config": {
        "cite": "required",
        "tools": [
          "endpoint",
          "network",
          "web"
        ],
        "context": [
          "dns-lead-lookups",
          "http-metadata-check",
          "outbound-connection-check"
        ],
        "objective": "Determine if a Python process is actively exfiltrating data to the adversary endpoint. Weigh a match on both User-Agent and webhook.site domain as highly malicious; weigh rare Python outbound connections to public IPs on lead hosts as suspicious.",
        "description": "Correlate DNS, HTTP, and Network evidence to determine if exfiltration occurred.",
        "max_iterations": 5,
        "expected_signal": "A verdict per host citing the specific rows and indicators that prove exfiltration.",
        "success_criteria": "A verdict of malicious | suspicious | benign per host, citing the DNS resolutions and HTTP POST headers."
      },
      "parents": [
        {
          "id": "http-metadata-check",
          "kind": "merge"
        },
        {
          "id": "outbound-connection-check",
          "kind": "merge"
        }
      ]
    },
    {
      "id": "route-on-verdict",
      "type": "checkpoint",
      "label": "Route on triage verdict",
      "config": {
        "fuzzy": true,
        "judge": "hunter",
        "question": "the triage verdict is malicious for at least one host",
        "condition": "the triage verdict is malicious for at least one host",
        "blind_spot": "no-http-payload-visibility",
        "confidence": "high",
        "description": "Contain malicious activity and route suspicious cases for manual review.",
        "checkpoint_type": "mandatory"
      },
      "parents": [
        {
          "id": "exfil-triage"
        }
      ]
    },
    {
      "id": "isolate-compromised-host",
      "type": "action",
      "label": "Isolate host and revoke tokens",
      "config": {
        "target": "endpoint",
        "description": "Contain the breach and prevent the use of stolen credentials.",
        "instructions": "Isolate the host immediately. Notify the Cloud Security and GitHub administration teams to rotate all secrets stored on this host, as they must be treated as fully compromised.",
        "action_approval": "required"
      },
      "parents": [
        {
          "id": "route-on-verdict",
          "branch": "on_supports"
        }
      ]
    },
    {
      "id": "analyst-validation",
      "type": "task",
      "label": "Analyst verification and tuning",
      "config": {
        "assignee": "analyst",
        "description": "Verify the agent's verdict and determine if the indicators need tuning for local developer activity.",
        "instructions": "Review the correlated network and HTTP rows. Confirm if the process path for Python is expected on this host. If the traffic went to webhook.site but used a benign User-Agent, verify if it belongs to a legitimate developer tool."
      },
      "parents": [
        {
          "id": "route-on-verdict",
          "branch": "default"
        },
        {
          "id": "route-on-verdict",
          "branch": "on_unavailable"
        },
        {
          "id": "isolate-compromised-host"
        }
      ]
    },
    {
      "id": "close-out",
      "type": "task",
      "label": "Close out hunt",
      "config": {
        "assignee": "analyst",
        "description": "Final documentation for negative results.",
        "instructions": "Record that no exfiltration patterns matching the agent-framework stealer were observed. Note any hosts that resolved the exfiltration domain without corresponding HTTP activity for future baseline reference."
      },
      "parents": [
        {
          "id": "route-on-verdict",
          "branch": "on_refutes"
        }
      ]
    }
  ]
}