← All hunts high TLP:CLEAR Part 2 of 2

AI-Assisted Execution and C2 Tunneling

An intruder is deploying AI-generated scripts for reverse shells and automated secret-scraping toolkits, using a centralized C2 infrastructure to coordinate post-exploitation activity.

Based on research by Unit 42 2026-10-22 12 steps · 4 queries T1059 T1059.001 T1071.001 T1105 T1552 T1572

Brief

The Shift to AI-Assisted Attacks

Unit 42 recently detailed how threat actors use artificial intelligence to plan and execute cybercrime in their report, “Next Exploit Opportunities” (https://unit42.paloaltonetworks.com/ai-assisted-cybercrime-analysis/). This shift lowers the barrier for entry, allowing attackers to generate functional reverse shells and automated scraping scripts with minimal manual effort. Our team developed this hunt to identify the specific footprints left by these AI-generated toolsets.

Scoping the Network Lead

The hunt begins by examining network connection logs for any host communicating with known actor-controlled IP addresses. We use specific infrastructure leads, such as 162.243.3.92, to establish an initial scope. This first phase acts as a gate; if the hunt identifies network communication, it automatically narrows the subsequent, more intensive behavioral checks to those specific hosts to reduce noise and processing time.

Deep Dive into Scripting and Utilities

In the second phase, the hunt examines script block activity for patterns indicative of AI-generated shells. We look for the presence of socket-related objects in PowerShell and VBScript, specifically targeting code that attempts to bridge standard input and output with a network connection. Since AI often generates functional but recognizable templates for these tasks, searching for specific .NET classes provides a high-confidence signal for manual review.

Analyzing Process Execution

The hunt also monitors the execution of networking utilities and command-line shells. We focus on tools like ncat or PowerShell instances using encoded command arguments. These utilities often facilitate the tunneling or execution phases of the intrusion. By correlating the use of these tools with the initial network leads, an analyst can quickly determine if the activity represents a legitimate administrative session or an active exploit.

Baselining Sensitive File Access

A fleet-wide prevalence check identifies rare access to sensitive files, such as .env files, SSH keys, or cloud provider credentials. Automated scraping tools generated by AI often perform broad searches for these secrets across the file system. The hunt calculates a baseline for file access events and highlights instances where an unusual process reads a sensitive file on fewer than three hosts in the environment. This helps isolate automated theft from standard system operations.

Blind Spots and Limitations

Several blind spots exist within this hunt design. The scoping phase relies on agent-based network logging; endpoints missing this visibility will not trigger the initial gate. Additionally, if an adversary uses significant obfuscation or splits their AI-generated scripts across multiple execution blocks, keyword-based searches for socket objects may fail. Analysts should ensure comprehensive script block logging is enabled to maximize the effectiveness of the behavioral checks.

Running the Hunt

This hunt is published as a hunt.md playbook. It integrates directly into Huntbase or any runtime capable of parsing the hunt.md format. To run it, import the playbook and provide the relevant lookback period. The results provide a prioritized list of hosts with synthesized evidence from network, process, and script activity, allowing for rapid triage and isolation of compromised systems.

In this series

Steps

  1. Network connections to actor infrastructure

    Query · scoping

    Identifies hosts communicating with known actor infrastructure at 162.243.3.92 to establish initial scope.

    reads hb_network_connectionsql
    SELECT device_hostname, dst_endpoint_ip, dst_endpoint_port, direction, protocol, time FROM hb_network_connection WHERE instr(',' || '{{actor_ips}}' || ',', ',' || dst_endpoint_ip || ',') > 0 AND time >= datetime('now', '-{{lookback_days}} days')

    What a hit looks like. A hit indicates a host reaching out to the actor's primary infrastructure. Silence suggests no known C2 traffic in this window.

  2. Read lead connections

    Agent triage

    Is an assessment of the network activity to identify specific hosts for the deep-dive.

  3. Is the lead real?

    Decision

    Is a gate for the expensive fan-out based on the initial network findings.

  4. Script-based reverse shell activity

    Query · detection candidate

    Identifies script blocks containing reverse shell signatures or AI-generated C2 patterns, filtered by the initial scope.

    reads hb_script_activitysql
    SELECT device_hostname, script_name, script_content, time FROM hb_script_activity WHERE (LOWER(script_content) LIKE '%tcpclient%' OR LOWER(script_content) LIKE '%wscript.shell%') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')

    What a hit looks like. Execution of reverse shell code or VBScript droppers. High confidence when matching scoped hosts.

  5. Execution of C2 and shell utilities

    Query · triage

    Finds process command lines associated with tunneling utilities like ncat and reverse shells.

    reads hb_process_activitysql
    SELECT device_hostname, process_name, process_cmd_line, time FROM hb_process_activity WHERE (LOWER(process_cmd_line) LIKE '%ncat%' OR LOWER(process_cmd_line) LIKE '% -enc %') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')

    What a hit looks like. A hit suggests manual or scripted execution of networking tools commonly used by the actor for shells.

  6. Rare access to sensitive files

    Query · baseline

    Identifies rare processes accessing secrets or environment files across the fleet, characteristic of automated scraping tools.

    reads hb_file_activitysql
    SELECT file_name, process_name, COUNT(DISTINCT device_hostname) AS host_count, MIN(time) AS first_seen FROM hb_file_activity WHERE (instr(',' || LOWER('{{sensitive_files}}') || ',', ',' || LOWER(file_name) || ',') > 0 OR LOWER(file_path) LIKE '%.env%') AND activity_id = 2 AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY file_name, process_name HAVING host_count < 3

    What a hit looks like. A rare file access event where a non-standard process reads a sensitive configuration file.

  7. Synthesize and weigh evidence

    Agent triage

    Is a synthesis of network, script, and process findings to reach a compromise verdict.

  8. Route on triage verdict

    Decision

    Routes the hunt to containment if malicious activity is confirmed.

  9. Isolate host

    Response action

    Is an isolation action to prevent further lateral movement or exfiltration.

  10. Analyst review

    Analyst task

    Is a human validation of findings and tuning.

  11. Close out

    Analyst task

    Is a standard closure for negative results.

Coverage

Scenario coverage

StageCoveredHow, or why not
Script-Based Reverse Shell Deployment
T1059 · T1059.001
Yes script-execution-patterns, process-execution-utilities
C2 Communication and Proxy Tunneling
T1572
Yes network-to-actor-ip
Automated Secret and Credential Scraping
T1552
Yes credential-scraping-prevalence
WordPress REST API and Subdomain Enumeration
T1190
Out of scope Belongs to another part of the '“Next Exploit Opportunities”: How a Threat Actor Used AI to Help Plan and Execute Multiple Types of Cybercrime Activities' series.
AI-Generated Brute Force Campaign
T1110
Out of scope Belongs to another part of the '“Next Exploit Opportunities”: How a Threat Actor Used AI to Help Plan and Execute Multiple Types of Cybercrime Activities' series.
MongoDB Database Exfiltration
T1041
Out of scope Belongs to another part of the '“Next Exploit Opportunities”: How a Threat Actor Used AI to Help Plan and Execute Multiple Types of Cybercrime Activities' series.

Blind spots

  • Needs hb_network_connection with host-level egress IP. Endpoints missing agent coverage contribute no flow data, bypassing the gate. It would answer whether the actor IP was contacted by hosts without agent-based network logging.
  • Needs hb_script_activity with full block content. If script blocks are truncated or highly obfuscated, simple keyword matching for 'tcpclient' will fail. It would answer whether reverse shell payloads were split across multiple blocks or used obfuscation.

Parameters & data

Parameters

ParameterTypeDefaultWhat it is
actor_ipslist[ip]162.243.3.92Known actor-controlled C2 or proxy IP addresses.
lookback_daysnumber14Days of history to examine.
scope_hostslist[host]—Hosts identified in the lead query to focus the expensive behavioral search.
sensitive_fileslist[string].env, id_rsa, aws_access_key, service_account_key.json, credentials.dbFilenames or extensions targeted by automated scraping tools.

Telemetry

SourceCategoryTelemetry
Endpoint telemetry (hb_ surfaces)endpointendpoint
Network telemetrynetworknetwork

Source

Download hunt.md Definition (JSON) An open hunt.md file; it runs anywhere that reads the format.
---
analysis: While single rules alert on individual reverse shell commands, this hunt
  correlates infrastructure (C2 IPs), rare script-block patterns, and a fleet-wide
  prevalence check for secret scraping. This context is essential to differentiate
  between a developer running scripts and an AI-enabled adversary automating secret
  discovery.
blind_spots:
- id: no-network-logging
  question: whether the actor IP was contacted by hosts without agent-based network
    logging
  requires: hb_network_connection with host-level egress IP
  risk: Endpoints missing agent coverage contribute no flow data, bypassing the gate.
  stage: c2-and-tunneling
- id: limited-script-visibility
  question: whether reverse shell payloads were split across multiple blocks or used
    obfuscation
  requires: hb_script_activity with full block content
  risk: If script blocks are truncated or highly obfuscated, simple keyword matching
    for 'tcpclient' will fail.
  stage: reverse-shell-execution
coverage:
- stage: reverse-shell-execution
  status: covered
  steps:
  - script-execution-patterns
  - process-execution-utilities
- stage: c2-and-tunneling
  status: covered
  steps:
  - network-to-actor-ip
- stage: automated-credential-scraping
  status: covered
  steps:
  - credential-scraping-prevalence
- reason: "Belongs to another part of the '\u201CNext Exploit Opportunities\u201D\
    : How a Threat Actor Used AI to Help Plan and Execute Multiple Types of Cybercrime\
    \ Activities' series."
  stage: web-application-enumeration
  status: out_of_scope
- reason: "Belongs to another part of the '\u201CNext Exploit Opportunities\u201D\
    : How a Threat Actor Used AI to Help Plan and Execute Multiple Types of Cybercrime\
    \ Activities' series."
  stage: targeted-credential-brute-force
  status: out_of_scope
- reason: "Belongs to another part of the '\u201CNext Exploit Opportunities\u201D\
    : How a Threat Actor Used AI to Help Plan and Execute Multiple Types of Cybercrime\
    \ Activities' series."
  stage: database-collection-exfiltration
  status: out_of_scope
guardrails:
  claims: no_unsupported
  evidence: citation_required
  missing_data: not_benign
  telemetry: untrusted
hunt:
  applicability: campaign-specific
  handoff: promote-to-detection
  justification: As AI-assisted cybercrime toolchains lower the skill barrier for
    script generation and automated scanning, a behavioral baseline for sensitive
    file access and reverse shell patterns is required to catch intrusions that bypass
    standard signature-based rules.
  methodology: model-assisted
  trigger: intel-report
hypothesis: An intruder is deploying AI-generated scripts for reverse shells and automated
  secret-scraping toolkits, using a centralized C2 infrastructure to coordinate post-exploitation
  activity.
labels:
- hunt
- attack.t1059
- attack.t1059.001
- attack.t1572
- attack.t1552
- attack.t1105
- attack.t1071.001
- command and control
- credential access
- execution
- exfiltration
- initial access
name: AI-Assisted Execution and C2 Tunneling
parameters:
  actor_ips:
    default:
    - 162.243.3.92
    description: Known actor-controlled C2 or proxy IP addresses.
    from:
      kind: article
      observed: '2026-10-21'
      ref: unit42-ai-cybercrime
    type: list[ip]
  lookback_days:
    default: '14'
    description: Days of history to examine.
    type: number
  scope_hosts:
    default: []
    description: Hosts identified in the lead query to focus the expensive behavioral
      search.
    type: list[host]
  sensitive_files:
    default:
    - .env
    - id_rsa
    - aws_access_key
    - service_account_key.json
    - credentials.db
    description: Filenames or extensions targeted by automated scraping tools.
    type: list[string]
provenance:
  authors:
  - name: Huntbase hunt generation
    org: huntbase.io
  generated:
    by: huntbase-hunt-generation
    from: https://unit42.paloaltonetworks.com/ai-assisted-cybercrime-analysis/
    gates:
    - dry-run
    - lint
    model: hb_google/gemini-3-flash-preview
rationale: Focus first on hosts that trigger the lead query for 162.243.3.92. If empty,
  the hunt is a baseline check for rare secret scraping across the whole estate.
references:
- name: "Unit 42 \u2014 AI-Assisted Cybercrime Analysis"
  url: https://unit42.paloaltonetworks.com/ai-assisted-cybercrime-analysis/
related:
- hunt: vast-ai-gpu-cracking-abuse
  reason: Detection of cloud-based hash cracking using Vast.ai is a separate behavioral
    signal handled by infrastructure-specific hunts.
  relation: out-of-scope-alternative
- hunt: ai-web-exploit-db-exfil
  relation: follows
scenario:
  stages:
  - name: WordPress REST API and Subdomain Enumeration
    observables:
    - /wp-json/wp/v2/users
    - 162.243.3.92
    - WordPress author sitemaps
    - Subdomain enumeration (LMS, student portal, administration dashboard)
    slug: web-application-enumeration
    tactic: initial-access
    techniques:
    - T1190
  - name: AI-Generated Brute Force Campaign
    observables:
    - Brute force generator script
    - Wordlist with 117 usernames and 28 passwords
    - Multiple failed WordPress login attempts
    slug: targeted-credential-brute-force
    tactic: credential-access
    techniques:
    - T1110
  - name: MongoDB Database Exfiltration
    observables:
    - MongoDB collection dump
    - Exfiltration manifest file
    - Student and faculty PII records
    slug: database-collection-exfiltration
    tactic: exfiltration
    techniques:
    - T1041
  - name: Script-Based Reverse Shell Deployment
    observables:
    - Base64-encoded PowerShell reverse shell
    - VBScript payload delivery
    - QubesOS VM setup script with ncat
    slug: reverse-shell-execution
    tactic: execution
    techniques:
    - T1059
    - T1059.001
  - name: C2 Communication and Proxy Tunneling
    observables:
    - 162.243.3.92
    - Python-based C2 listener
    - SSH tunnel for Wi-Fi hash collection
    - Vast.ai connection
    - Discord webhooks
    slug: c2-and-tunneling
    tactic: command-and-control
    techniques:
    - T1572
  - name: Automated Secret and Credential Scraping
    observables:
    - Go-based credential-scanning toolkit
    - Extraction of .env values
    - S3 signed URLs
    - Google Cloud service account keys
    - CDN API keys
    slug: automated-credential-scraping
    tactic: credential-access
    techniques:
    - T1552
  summary: The BUGSTER threat actor uses jailbroken AI assistants to coordinate multi-stage
    attacks including WordPress enumeration, targeted brute-force campaigns, and MongoDB
    exfiltration against educational institutions. The operation leverages automated
    pipelines for Wi-Fi password cracking via cloud GPUs, credential scraping for
    cloud secrets, and Python-based command-and-control infrastructure.
series:
  index: 2
  slug: next-exploit-opportunities-how-a-threat-actor-used-ai-to-help-plan-and-execute-multiple-types-of
  title: "\u201CNext Exploit Opportunities\u201D: How a Threat Actor Used AI to Help\
    \ Plan and Execute Multiple Types of Cybercrime Activities"
  total: 2
severity: high
targets:
  analyst:
    name: Tier-2 analyst
    role: analyst
  endpoint:
    category: endpoint
    name: Endpoint telemetry (hb_ surfaces)
    telemetry:
    - endpoint
  hunter:
    agent: true
    name: Hunt agent
  network:
    category: network
    name: Network telemetry
    telemetry:
    - network
tlp: clear
type: investigation
---


# AI-Assisted Execution and C2 Tunneling

This hunt examines the execution and command-and-control phases of an intrusion, focusing on behaviors associated with AI-assisted cybercrime toolchains like BUGSTER. It uses a gated flow to first identify network leads to known actor infrastructure before fanning out into behavioral analysis of script execution, utility misuse, and rare credential-scraping processes. We look for specific PowerShell reverse shell signatures, ncat listeners, and automated searches for sensitive environment files and API keys.

## network-to-actor-ip
<!-- Network connections to actor infrastructure -->
Identifies hosts communicating with known actor infrastructure at 162.243.3.92 to establish initial scope.

```sqlite target=network role=scoping params=(actor_ips=actor_ips, lookback_days=lookback_days)
~~~yaml
expected: A hit indicates a host reaching out to the actor's primary infrastructure.
  Silence suggests no known C2 traffic in this window.
reads:
- device_hostname
- direction
- dst_endpoint_ip
- dst_endpoint_port
- protocol
- time
silence: not_evidence_of_absence
source: hb_network_connection
verified: dry-run
verified_at: '2026-10-22'
~~~
SELECT device_hostname, dst_endpoint_ip, dst_endpoint_port, direction, protocol, time FROM hb_network_connection WHERE instr(',' || '{{actor_ips}}' || ',', ',' || dst_endpoint_ip || ',') > 0 AND time >= datetime('now', '-{{lookback_days}} days')
```

## read-lead
<!-- Read lead connections -->
```agent target=hunter
cite: required
context:
- network-to-actor-ip
max_iterations: 3
objective: Analyze which hosts in the network-to-actor-ip results show confirmed communication
  to {{actor_ips}}.
success_criteria: A per-host verdict on whether the network lead is actionable.
tools:
- endpoint
- network
```

## is-lead-real
<!-- Is the lead real? -->
if~: "the read-lead verdict identifies at least one host with confirmed network activity to {{actor_ips}}" (confidence: high, judge=hunter)
then: → deep-dive
indeterminate: → analyst-review
unavailable: → analyst-review (blind_spot: no-network-logging)
else: → credential-scraping-prevalence

## deep-dive
<!-- Execution and Scraping Deep Dive -->
parallel:
- → script-execution-patterns
- → process-execution-utilities
- → credential-scraping-prevalence
join: → triage

## script-execution-patterns
<!-- Script-based reverse shell activity -->
Identifies script blocks containing reverse shell signatures or AI-generated C2 patterns, filtered by the initial scope.

```sqlite target=endpoint role=detection-candidate params=(lookback_days=lookback_days, scope_hosts=scope_hosts)
~~~yaml
expected: Execution of reverse shell code or VBScript droppers. High confidence when
  matching scoped hosts.
reads:
- device_hostname
- script_content
- script_name
- time
silence: not_evidence_of_absence
source: hb_script_activity
verified: dry-run
verified_at: '2026-10-22'
~~~
SELECT device_hostname, script_name, script_content, time FROM hb_script_activity WHERE (LOWER(script_content) LIKE '%tcpclient%' OR LOWER(script_content) LIKE '%wscript.shell%') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')
```

## process-execution-utilities
<!-- Execution of C2 and shell utilities -->
Finds process command lines associated with tunneling utilities like ncat and reverse shells.

```sqlite target=endpoint role=triage params=(lookback_days=lookback_days, scope_hosts=scope_hosts)
~~~yaml
expected: A hit suggests manual or scripted execution of networking tools commonly
  used by the actor for shells.
reads:
- device_hostname
- process_cmd_line
- process_name
- time
silence: not_evidence_of_absence
source: hb_process_activity
verified: dry-run
verified_at: '2026-10-22'
~~~
SELECT device_hostname, process_name, process_cmd_line, time FROM hb_process_activity WHERE (LOWER(process_cmd_line) LIKE '%ncat%' OR LOWER(process_cmd_line) LIKE '% -enc %') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')
```

## credential-scraping-prevalence
<!-- Rare access to sensitive files -->
Identifies rare processes accessing secrets or environment files across the fleet, characteristic of automated scraping tools.

```sqlite target=endpoint role=baseline params=(lookback_days=lookback_days, sensitive_files=sensitive_files)
~~~yaml
baseline:
  compare: first_seen
  window: '{{lookback_days}}d'
expected: A rare file access event where a non-standard process reads a sensitive
  configuration file.
prevalence:
  by: device_hostname
  key:
  - file_name
  - process_name
  rare_below: 3
reads:
- activity_id
- device_hostname
- file_name
- file_path
- process_name
- time
silence: not_evidence_of_absence
source: hb_file_activity
verified: dry-run
verified_at: '2026-10-22'
~~~
SELECT file_name, process_name, COUNT(DISTINCT device_hostname) AS host_count, MIN(time) AS first_seen FROM hb_file_activity WHERE (instr(',' || LOWER('{{sensitive_files}}') || ',', ',' || LOWER(file_name) || ',') > 0 OR LOWER(file_path) LIKE '%.env%') AND activity_id = 2 AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY file_name, process_name HAVING host_count < 3
```

## triage
<!-- Synthesize and weigh evidence -->
```agent target=hunter
cite: required
context:
- read-lead
- script-execution-patterns
- process-execution-utilities
- credential-scraping-prevalence
max_iterations: 6
objective: Determine if any host exhibits signs of an AI-assisted intrusion. Even
  if network activity to {{actor_ips}} is absent, treat matches in script-execution-patterns
  or process-execution-utilities as high-confidence indicators of malicious execution.
success_criteria: A verdict of malicious | suspicious | benign for every host in the
  context.
tools:
- endpoint
- network
```

## route-on-triage
<!-- Route on triage verdict -->
if~: "the triage verdict is malicious for at least one host based on execution or scraping signals" (confidence: high, judge=hunter)
then: → contain-host
indeterminate: → analyst-review
unavailable: → analyst-review (blind_spot: limited-script-visibility)
else: → analyst-review

## contain-host
<!-- Isolate host -->
```action target=endpoint
~~~yaml
approval: required
~~~
Isolate the host and revoke any cloud access keys or credentials identified in the scraping activity.
```
→ analyst-review

## analyst-review
<!-- Analyst review -->
```manual target=analyst
Review the cited script blocks, process utility execution, and file access events. Verify if the process accessing sensitive files is an authorized developer tool or an unexpected scraper.
```
→ end

## close-out
<!-- Close out -->
```manual target=analyst
Log that no hosts contacted the known actor IP and that secret-file access patterns matched the baseline across the fleet.
```
→ end

Run it

Take this hunt into your environment.

Open it in Huntbase to run every step against your own connections, with Scout weighing the evidence and your analysts in command. Or take the open hunt.md file anywhere that reads the format.

Machine-drafted by huntbase-hunt-generation using hb_google/gemini-3-flash-preview, gated by dry-run, lint, then reviewed by a person.