{
  "hunt": {
    "meta": {
      "tlp": "clear",
      "hunt": {
        "handoff": "keep-as-periodic-hunt",
        "trigger": "intel-report",
        "methodology": "model-assisted",
        "applicability": "campaign-specific",
        "justification": "Exploitation of perimeter devices leads to immediate unauthenticated network access or high-value credential theft; verifying the integrity of these public-facing services is a critical security obligation."
      },
      "name": "Perimeter Exploitation and NTLM Redirection",
      "type": "investigation",
      "labels": [
        "hunt",
        "attack.t1190",
        "attack.t1557.001",
        "credential access",
        "execution",
        "initial access",
        "persistence"
      ],
      "series": {
        "slug": "metasploit-wrapup-unauth-rce-modules-in-network-perimeter-devices-and-much-more",
        "index": 1,
        "title": "Metasploit Wrapup: Unauth RCE modules in Network Perimeter Devices and much more",
        "total": 2
      },
      "related": [
        {
          "hunt": "smb-egress-to-non-rfc1918",
          "reason": "A broader hunt for any outbound SMB traffic regardless of perimeter application exploitation.",
          "relation": "sibling"
        }
      ],
      "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 on the URI or the SMB port lacks context. This hunt correlates the vulnerability state (vulnerable software present) with the behavior (URI hit) and the specific outcome (uncommon outbound SMB connection) to settle on a verdict.",
      "coverage": [
        {
          "stage": "initial-access-perimeter-vulnerabilities",
          "steps": [
            "vulnerable-host-inventory",
            "perimeter-http-exploitation"
          ],
          "status": "covered"
        },
        {
          "stage": "credential-access-ntlm-disclosure",
          "steps": [
            "smb-redirection-attempts"
          ],
          "status": "covered"
        },
        {
          "stage": "execution-fetch-payload-delivery",
          "reason": "Belongs to another part of the 'Metasploit Wrapup: Unauth RCE modules in Network Perimeter Devices and much more' series.",
          "status": "out_of_scope"
        },
        {
          "stage": "persistence-linux-elf-injection",
          "reason": "Belongs to another part of the 'Metasploit Wrapup: Unauth RCE modules in Network Perimeter Devices and much more' series.",
          "status": "out_of_scope"
        },
        {
          "stage": "persistence-privileged-container-mount",
          "reason": "Belongs to another part of the 'Metasploit Wrapup: Unauth RCE modules in Network Perimeter Devices and much more' series.",
          "status": "out_of_scope"
        }
      ],
      "scenario": {
        "stages": [
          {
            "name": "Exploitation of Perimeter and Developer Tools",
            "slug": "initial-access-perimeter-vulnerabilities",
            "tactic": "initial-access",
            "techniques": [
              "T1190"
            ],
            "observables": [
              "HTTP POST to /forgot-password in Flowise",
              "Unauthenticated CI lint API calls to GitLab",
              "PHP file uploads to /wp-content/plugins/bug-library/",
              "Command injection patterns in Citrix NetScaler login logs",
              "SQL injection patterns in Cisco Secure Email Gateway S/MIME handling",
              "CVE-2025-58434",
              "CVE-2026-88771",
              "CVE-2026-97229",
              "CVE-2026-76443",
              "CVE-2024-5450"
            ]
          },
          {
            "name": "NTLMv2 Hash Disclosure via UNC Path",
            "slug": "credential-access-ntlm-disclosure",
            "tactic": "credential-access",
            "techniques": [
              "T1557.001"
            ],
            "observables": [
              "OpenBullet2 forced SMB authentication via UNC path proxy source",
              "Outbound SMB (port 445) connections to attacker-controlled infrastructure",
              "CVE-2026-39908"
            ]
          },
          {
            "name": "Multi-Protocol Fetch Payload Execution",
            "slug": "execution-fetch-payload-delivery",
            "tactic": "execution",
            "techniques": [
              "T1105",
              "T1059.003"
            ],
            "observables": [
              "Fetch commands using FTP, HTTP, HTTPS, or TFTP to download LoongArch64 payloads",
              "Execution of chmod on downloaded files",
              "Reverse shell or bind shell activity (e.g., shell_reverse_tcp)"
            ]
          },
          {
            "name": "Linux ELF Executable Payload Injection",
            "slug": "persistence-linux-elf-injection",
            "tactic": "persistence",
            "techniques": [
              "T1574"
            ],
            "observables": [
              "Code cave and segment injection in Linux ELF files",
              "Architecture-specific trampolines for x86, x64, or AArch64",
              "Modified ELF binaries on disk"
            ]
          },
          {
            "name": "Docker Container Persistence and Host Access",
            "slug": "persistence-privileged-container-mount",
            "tactic": "persistence",
            "techniques": [
              "T1610",
              "T1543.003"
            ],
            "observables": [
              "Creation of privileged Docker containers",
              "Bind-mounting host filesystem (e.g., C: drive on Windows or root on Linux) to a container",
              "Docker Desktop creating persistent Alpine containers on Windows",
              "Portainer API activity to create containers with host access"
            ]
          }
        ],
        "summary": "This campaign involves the use of newly released Metasploit modules targeting unauthenticated RCE and authentication bypass vulnerabilities in perimeter devices and developer tools like Citrix NetScaler, Cisco Secure Email Gateway, Flowise, and GitLab. After initial access, attackers leverage specialized Linux ELF injection techniques and privileged Docker container creation for persistent access and payload execution."
      },
      "severity": "high",
      "rationale": "Start by identifying all servers running Flowise, GitLab, Citrix, and Cisco gateway software. Use the HTTP activity surface to look for URIs associated with Metasploit modules, specifically focusing on unauthenticated endpoints.",
      "guardrails": {
        "claims": "no_unsupported",
        "evidence": "citation_required",
        "telemetry": "untrusted",
        "missing_data": "not_benign"
      },
      "hypothesis": "An attacker is exploiting vulnerabilities in perimeter applications (like Flowise or Citrix) to gain initial access or force NTLM authentication to a remote UNC path for credential theft.",
      "parameters": {
        "scope_hosts": {
          "type": "list[host]",
          "default": [],
          "description": "Specific hosts to investigate; leave empty to hunt across the entire estate."
        },
        "target_uris": {
          "type": "list[string]",
          "default": [
            "/forgot-password",
            "/api/v1/lint",
            "/wp-content/plugins/bug-library/"
          ],
          "description": "URI paths associated with the latest Metasploit module releases."
        },
        "lookback_days": {
          "type": "number",
          "default": "14",
          "description": "Days of history to examine."
        }
      },
      "provenance": {
        "authors": [
          {
            "org": "huntbase.io",
            "name": "Huntbase hunt generation"
          }
        ],
        "generated": {
          "by": "huntbase-hunt-generation",
          "from": "https://www.rapid7.com/blog/post/pt-metasploit-wrapup-unauth-rce-modules-in-network-perimeter-devices-and-much-more",
          "gates": [
            "dry-run",
            "lint",
            "critic"
          ],
          "model": "hb_google/gemini-3-flash-preview"
        }
      },
      "references": [
        {
          "url": "https://www.rapid7.com/blog/post/pt-metasploit-wrapup-unauth-rce-modules-in-network-perimeter-devices-and-much-more",
          "name": "Rapid7 \u2014 Metasploit Wrapup: Unauth RCE modules in Network Perimeter Devices"
        }
      ],
      "blind_spots": [
        {
          "id": "tls-encryption-blind-spot",
          "risk": "Attackers can hide exploit payloads in HTTPS traffic, making URI-based detection impossible without decryption.",
          "stage": "initial-access-perimeter-vulnerabilities",
          "question": "What were the full URI and body of the request on encrypted channels?",
          "requires": "TLS inspection or decrypted HTTP logs"
        },
        {
          "id": "smb-egress-filtering",
          "risk": "If port 445 is blocked at the perimeter, the network connection surface may not show the attempt, leaving the successful exploit (initial access) undetected if it relies on SMB for the second stage.",
          "stage": "credential-access-ntlm-disclosure",
          "question": "Were there failed SMB connection attempts to external IPs?",
          "requires": "Firewall logs with reject actions"
        }
      ]
    },
    "name": "Perimeter Exploitation and NTLM Redirection",
    "description": "This hunt targets recent Metasploit module releases for perimeter software. It first identifies hosts running vulnerable software, then concurrently examines HTTP logs for known exploitation paths and network logs for anomalous outbound SMB traffic (port 445). An agent evaluates whether these signals coincide, suggesting a successful exploit that redirected authentication to an attacker-controlled listener."
  },
  "nodes": [
    {
      "id": "hypothesis",
      "type": "hypothesis",
      "label": "Hypothesis",
      "config": {
        "tags": [],
        "series": {
          "slug": "metasploit-wrapup-unauth-rce-modules-in-network-perimeter-devices-and-much-more",
          "index": 1,
          "title": "Metasploit Wrapup: Unauth RCE modules in Network Perimeter Devices and much more",
          "total": 2
        },
        "coverage": [
          {
            "stage": "initial-access-perimeter-vulnerabilities",
            "steps": [
              "vulnerable-host-inventory",
              "perimeter-http-exploitation"
            ],
            "status": "covered"
          },
          {
            "stage": "credential-access-ntlm-disclosure",
            "steps": [
              "smb-redirection-attempts"
            ],
            "status": "covered"
          },
          {
            "stage": "execution-fetch-payload-delivery",
            "reason": "Belongs to another part of the 'Metasploit Wrapup: Unauth RCE modules in Network Perimeter Devices and much more' series.",
            "status": "out_of_scope"
          },
          {
            "stage": "persistence-linux-elf-injection",
            "reason": "Belongs to another part of the 'Metasploit Wrapup: Unauth RCE modules in Network Perimeter Devices and much more' series.",
            "status": "out_of_scope"
          },
          {
            "stage": "persistence-privileged-container-mount",
            "reason": "Belongs to another part of the 'Metasploit Wrapup: Unauth RCE modules in Network Perimeter Devices and much more' series.",
            "status": "out_of_scope"
          }
        ],
        "rationale": "An attacker is exploiting vulnerabilities in perimeter applications (like Flowise or Citrix) to gain initial access or force NTLM authentication to a remote UNC path for credential theft.",
        "blind_spots": [
          {
            "id": "tls-encryption-blind-spot",
            "risk": "Attackers can hide exploit payloads in HTTPS traffic, making URI-based detection impossible without decryption.",
            "stage": "initial-access-perimeter-vulnerabilities",
            "question": "What were the full URI and body of the request on encrypted channels?",
            "requires": "TLS inspection or decrypted HTTP logs"
          },
          {
            "id": "smb-egress-filtering",
            "risk": "If port 445 is blocked at the perimeter, the network connection surface may not show the attempt, leaving the successful exploit (initial access) undetected if it relies on SMB for the second stage.",
            "stage": "credential-access-ntlm-disclosure",
            "question": "Were there failed SMB connection attempts to external IPs?",
            "requires": "Firewall logs with reject actions"
          }
        ],
        "scoping_notes": "Start by identifying all servers running Flowise, GitLab, Citrix, and Cisco gateway software. Use the HTTP activity surface to look for URIs associated with Metasploit modules, specifically focusing on unauthenticated endpoints.",
        "beyond_detection": "A simple detection rule on the URI or the SMB port lacks context. This hunt correlates the vulnerability state (vulnerable software present) with the behavior (URI hit) and the specific outcome (uncommon outbound SMB connection) to settle on a verdict."
      }
    },
    {
      "id": "vulnerable-host-inventory",
      "type": "query",
      "label": "Identify vulnerable perimeter software",
      "config": {
        "dsl": "sqlite",
        "role": "scoping",
        "source": "endpoint",
        "content": "SELECT device_hostname, package_name, package_version FROM hb_software_inventory WHERE (LOWER(package_name) LIKE '%flowise%' OR LOWER(package_name) LIKE '%gitlab%' OR LOWER(package_name) LIKE '%netscaler%' OR LOWER(package_name) LIKE '%secure%email%' OR LOWER(package_name) LIKE '%wordpress%' OR LOWER(package_name) LIKE '%openbullet%')",
        "surface": "hb_software_inventory",
        "description": "Scope the hunt to hosts running software mentioned in the Metasploit wrap-up.",
        "expected_signal": "A list of hosts running potentially vulnerable perimeter or development applications."
      },
      "parents": [
        {
          "id": "hypothesis"
        }
      ],
      "primitive_config": {
        "dsl": "sqlite",
        "role": "scoping",
        "label": "Identify vulnerable perimeter software",
        "reads": [
          "device_hostname",
          "package_name",
          "package_version"
        ],
        "source": "hb_software_inventory",
        "target": "endpoint",
        "content": "SELECT device_hostname, package_name, package_version FROM hb_software_inventory WHERE (LOWER(package_name) LIKE '%flowise%' OR LOWER(package_name) LIKE '%gitlab%' OR LOWER(package_name) LIKE '%netscaler%' OR LOWER(package_name) LIKE '%secure%email%' OR LOWER(package_name) LIKE '%wordpress%' OR LOWER(package_name) LIKE '%openbullet%')",
        "silence": "not_evidence_of_absence",
        "expected": "A list of hosts running potentially vulnerable perimeter or development applications.",
        "verified": "dry-run",
        "verified_at": "2026-11-18"
      }
    },
    {
      "id": "perimeter-http-exploitation",
      "type": "query",
      "label": "Hunt for exploitation URI patterns",
      "config": {
        "dsl": "sqlite",
        "role": "detection-candidate",
        "source": "web",
        "content": "SELECT device_hostname, url_path, http_method, src_endpoint_ip, time FROM hb_http_activity WHERE (instr(',' || '{{target_uris}}' || ',', ',' || LOWER(url_path) || ',') > 0 OR LOWER(url_path) LIKE '%/wp-content/plugins/bug-library/%') AND time >= datetime('now', '-{{lookback_days}} days') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0)",
        "surface": "hb_http_activity",
        "description": "Find HTTP requests hitting specific endpoints associated with recent RCE modules.",
        "expected_signal": "Requests to sensitive paths like /forgot-password in Flowise or CI lint in GitLab."
      },
      "parents": [
        {
          "id": "vulnerable-host-inventory"
        }
      ],
      "primitive_config": {
        "dsl": "sqlite",
        "role": "detection-candidate",
        "label": "Hunt for exploitation URI patterns",
        "reads": [
          "device_hostname",
          "url_path",
          "http_method",
          "src_endpoint_ip",
          "time"
        ],
        "source": "hb_http_activity",
        "target": "web",
        "content": "SELECT device_hostname, url_path, http_method, src_endpoint_ip, time FROM hb_http_activity WHERE (instr(',' || '{{target_uris}}' || ',', ',' || LOWER(url_path) || ',') > 0 OR LOWER(url_path) LIKE '%/wp-content/plugins/bug-library/%') AND time >= datetime('now', '-{{lookback_days}} days') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0)",
        "silence": "not_evidence_of_absence",
        "expected": "Requests to sensitive paths like /forgot-password in Flowise or CI lint in GitLab.",
        "verified": "dry-run",
        "verified_at": "2026-11-18"
      }
    },
    {
      "id": "smb-redirection-attempts",
      "type": "query",
      "label": "Outbound SMB connection baseline",
      "config": {
        "dsl": "sqlite",
        "role": "baseline",
        "source": "network",
        "content": "SELECT device_hostname, dst_endpoint_ip, COUNT(*) AS connections, MIN(time) AS first_seen FROM hb_network_connection WHERE dst_endpoint_port = 445 AND direction = 'outbound' AND time >= datetime('now', '-{{lookback_days}} days') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) GROUP BY device_hostname, dst_endpoint_ip HAVING connections < 5",
        "surface": "hb_network_connection",
        "description": "Identify anomalous outbound SMB connections that may indicate NTLM hash disclosure.",
        "expected_signal": "Rare outbound port 445 connections from perimeter servers to external IPs."
      },
      "parents": [
        {
          "id": "vulnerable-host-inventory"
        }
      ],
      "primitive_config": {
        "dsl": "sqlite",
        "role": "baseline",
        "label": "Outbound SMB connection baseline",
        "reads": [
          "device_hostname",
          "dst_endpoint_ip",
          "dst_endpoint_port",
          "direction",
          "time"
        ],
        "source": "hb_network_connection",
        "target": "network",
        "content": "SELECT device_hostname, dst_endpoint_ip, COUNT(*) AS connections, MIN(time) AS first_seen FROM hb_network_connection WHERE dst_endpoint_port = 445 AND direction = 'outbound' AND time >= datetime('now', '-{{lookback_days}} days') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) GROUP BY device_hostname, dst_endpoint_ip HAVING connections < 5",
        "silence": "not_evidence_of_absence",
        "baseline": {
          "window": "{{lookback_days}}d",
          "compare": "first_seen"
        },
        "expected": "Rare outbound port 445 connections from perimeter servers to external IPs.",
        "verified": "dry-run",
        "prevalence": {
          "by": "device_hostname",
          "key": [
            "dst_endpoint_ip"
          ],
          "rare_below": 5
        },
        "verified_at": "2026-11-18"
      }
    },
    {
      "id": "incident-triage",
      "type": "analytic",
      "label": "Weigh perimeter evidence",
      "config": {
        "cite": "required",
        "tools": [
          "endpoint",
          "network",
          "web"
        ],
        "context": [
          "vulnerable-host-inventory",
          "perimeter-http-exploitation",
          "smb-redirection-attempts"
        ],
        "objective": "Determine if the perimeter server was successfully exploited based on URI hits and subsequent outbound SMB activity.",
        "description": "Determine if the HTTP exploitation activity and SMB redirection are part of the same attack chain.",
        "max_iterations": 4,
        "expected_signal": "A correlation between an exploit URI hit and a near-simultaneous outbound SMB connection.",
        "success_criteria": "A verdict of malicious if exploit URIs match outbound SMB redirections."
      },
      "parents": [
        {
          "id": "perimeter-http-exploitation",
          "kind": "merge"
        },
        {
          "id": "smb-redirection-attempts",
          "kind": "merge"
        }
      ]
    },
    {
      "id": "remediation-decision",
      "type": "checkpoint",
      "label": "Decide on containment",
      "config": {
        "fuzzy": true,
        "judge": "hunter",
        "question": "the incident-triage verdict is malicious for at least one host",
        "condition": "the incident-triage verdict is malicious for at least one host",
        "blind_spot": "tls-encryption-blind-spot",
        "confidence": "high",
        "description": "Route the hunt based on the agent's confidence in the exploitation verdict.",
        "checkpoint_type": "mandatory"
      },
      "parents": [
        {
          "id": "incident-triage"
        }
      ]
    },
    {
      "id": "isolate-target",
      "type": "action",
      "label": "Isolate affected host",
      "config": {
        "target": "endpoint",
        "description": "Contain the breach and prevent credential relaying.",
        "instructions": "Isolate the endpoint to stop outbound SMB NTLM relaying and further RCE execution.",
        "action_approval": "required"
      },
      "parents": [
        {
          "id": "remediation-decision",
          "branch": "on_supports"
        }
      ]
    },
    {
      "id": "manual-validation",
      "type": "task",
      "label": "Analyst manual validation",
      "config": {
        "assignee": "analyst",
        "description": "Verify the automated findings and analyze the SMB destination.",
        "instructions": "Review the HTTP paths and SMB destination IP. Check if the SMB traffic follows the HTTP POST request immediately. Determine if the destination IP has a reputation for hosting NTLM relay listeners."
      },
      "parents": [
        {
          "id": "remediation-decision",
          "branch": "default"
        },
        {
          "id": "remediation-decision",
          "branch": "on_unavailable"
        },
        {
          "id": "isolate-target"
        }
      ]
    },
    {
      "id": "close-out-report",
      "type": "task",
      "label": "Close out hunt report",
      "config": {
        "assignee": "analyst",
        "description": "Document the outcome and update software inventory requirements.",
        "instructions": "Summarize the findings. If Benign, record the URI hits as false positives for tuning. If Malicious, escalate to Incident Response."
      },
      "parents": [
        {
          "id": "remediation-decision",
          "branch": "on_refutes"
        },
        {
          "id": "manual-validation"
        }
      ]
    }
  ]
}