Skip to main content
skill CX Codex

service-process-exploitation — Claude Code skill: install

service-process-exploitation is a Claude Code skill for detecting code execution inside a legitimate service process. It examines child processes, outbound connections, and file changes.

Apache-2.0 ★ 71 updated 2026-11-15

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Problem99-io/kodeblue --skill service-process-exploitation -a claude-code
Open on GitHub

What service-process-exploitation does

The skill guides investigations into attacks that run under a web service’s own process. It looks for spawned children, including a service starting its interpreter again, unexpected outbound traffic, and new files in directories the service can write to.

It also covers attacks with no child process: changes to code, templates, and other static files can reveal activity, but startup-generated writes need to be distinguished from later changes. A brief command may end before the next process snapshot, so request and connection logs matter too.

What it helps with

  • find a child process launched by a network service
  • detect outbound traffic outside a service’s usual destinations
  • spot new files in a writable web directory
  • separate startup file writes from later changes

Example prompts for the agent

  • Investigate possible code execution inside this web service process.
  • Check which child processes the service launched and where it connected.
  • Find service file changes that did not happen at startup.

How to install service-process-exploitation

1Skills CLI (Vercel)

npx skills add Problem99-io/kodeblue --skill service-process-exploitation -a claude-code

2Manually: put the files in place

~/.claude/skills/service-process-exploitation/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/service-process-exploitation/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about service-process-exploitation

How do I install service-process-exploitation in Claude Code?

Run npx skills add Problem99-io/kodeblue --skill service-process-exploitation -a claude-code. The skill file is located at ~/.claude/skills/service-process-exploitation/SKILL.md.

What does service-process-exploitation do?

It helps investigate code running inside a service process by examining child processes, outbound connections, and file changes.

Why might a process snapshot miss a command?

A short-lived child may exit before the next snapshot. The skill also checks request and connection logs, along with traces left in files.

Source text

SKILL.md · Apache-2.0
---
name: service-process-exploitation
description: Detect exploitation that runs INSIDE a legitimate service process — web-app RCE, unsafe deserialization, template/expression injection, interpreter abuse — where the attacker's code masquerades as the normal service and may drop nothing or start no child at all.
metadata:
  kodeblue-bundled: true
---

# In-process service exploitation (living off the land)

A whole class of compromise never spawns an obvious shell, drops no binary, and
may never complete an outbound connection. The attacker gets code execution
*inside* a running service — a web-app RCE, an unsafe deserialization
(`!!js/function`, Java/Python pickle, YAML/XML), a template or expression
injection, or an interpreter the app exposes — and runs their code AS that
service's own process. It looks like the service doing its job. Detect it on the
tells it cannot hide, not on a dropped file or a strange binary name.

## 1. Lineage, not the binary name
The child process is often the *same* binary the baseline already trusts (node
re-exec'ing node via `execFileSync`, python spawning python, php-fpm spawning
php). A trusted name is not a trusted event.
- The anomaly is that a long-running **service process forked/exec'd at all**.
  nginx, node, java, php-fpm, gunicorn, postgres and the like rarely spawn
  children in normal operation; when they do it is a known, repeating pattern (a
  worker pool, a documented sidecar) the baseline shows.
- `host_exec ["ps","-eo","pid,ppid,user,lstart,etime,cmd","--forest"]` and find
  children whose parent is a network service. `host_exec ["readlink","-f","/proc/<pid>/exe"]`;
  a `(deleted)` or `memfd:` exe is a strong IOC. `host_list /proc/<pid>/fd` — a
  `socket:[…]` on fds 0/1/2 is an interactive shell.
- The parent (the service) is *how they got in*. Name it in the report — that is
  the real fix, not just killing the child.

## 2. A snapshot miss is not an all-clear
These children are often sub-second (an exec to read a file, run `id`, probe a
port) and gone before the next snapshot. **Absence from `sensor_snapshot` does
not exonerate.** Hunt the *traces* a transient exec leaves:
- the request that triggered it in the request log or the app's own log
  (stack traces, 500 bursts, a probe that turned into a success),
- new or modified files under paths the service can write (see §4),
- connection traces in app/auth logs for attempts already gone,
- a re-launcher (cron/systemd/timer) if they wanted persistence — see
  [persistence-hunting].

## 3. Outbound attempts count, even when they fail
The post-exploitation step is usually a call home: a reverse shell, a stage-two
download, exfil. **A refused or timed-out connection is still an IOC** — "the C2
port was closed" means the attempt happened, not that it was benign.
- The decisive signal is a **service reaching outside its baselined egress set**
  (its database, its known upstream APIs). *Any* other outbound from that
  process — to an internal neighbour or a public IP, on any port — is suspicious.
- `host_exec ["ss","-tunap"]` for current state; correlate with app logs for
  attempts that have already closed.
- Name the destination before calling it hostile: many services call their
  vendor on their own (update checks, usage stats, certificate renewal), often
  only once a day, so learning misses them. Skill
  [outbound-destination-check] covers the name lookups, the setting that makes
  the call and the timing against the process start.

## 4. Writable app/web directories are drop zones
Code running as the service can write wherever the service can — its own web
root, upload, cache or build dirs. Those are **not** the protected system paths
kodeblue guards by default, so they must be watched explicitly. A new file under
a service-writable web root (`.php`/`.jsp`/`.js`/`.sh`, or anything executable)
is a webshell until proven otherwise. Inside a container, reach them as the
service sees them: `host_list /proc/<pid>/root/<path>` (also `tmp`, `var/tmp`,
`dev/shm` there).

## 5. Execution with no child and no drop
The quietest case: the service process itself does the attacker's work — it
rewrites its own code or assets (a defacement, an injected script), changes
stored data, or reads secrets — with no child, no new file in a temp dir and no
outbound. The tell is a **write by the service to files that are static while it
runs**: its code, templates, built assets, config.

**Rule out startup writes first.** Many applications write files every time they
start: translations filled from a default language, compiled or minified assets,
caches, generated config. Before you call a write an attack:
1. Get the process start time (`ps -o pid,lstart,etime,cmd -p <pid>`) and the
   file times (`host_list` shows mtimes).
2. Writes in the first minutes after a start, repeated after every restart, and
   never while the process has been running a while, are startup behaviour.
   Name it in the server-role definition so the next agent does not repeat the
   investigation.
3. A write long after the start, with no restart, deploy or admin session to
   explain it, is the service doing something it does not normally do.

Never confirm a theory with your own action: killing a supervised service makes
the runtime restart it, and the restart repeats the startup writes. Compare the
new write times with the restart you caused before you call them a second wave.

## Containing it
- `kill_process` ends the attacker's code, but a supervised service comes back
  at once. The new process is clean only if what it loads is clean: a payload in
  stored state (database rows, uploaded files, a poisoned cache) runs again.
- A container restart keeps its writable layer; tampered files survive it. Say
  in the report that the container must be **recreated from its image**, and that
  attacker-created data (accounts, uploads, tokens) is for a human to remove.

## Setting up the detections (learner)
The learner's procedure already creates the main monitors for each network
service: `process` with `no_children` (code execution), `sockets` with
`no_outbound` and the known `allow_remotes` (egress), and fast `file` monitors on
the directories an attacker writes first, with `contain` where it is safe. In
addition:
- Record each service's legitimate outbound set in the `Server role and
  services` definition, so a new destination is judged against it.
- `integrity_watch_add` the service's static code and asset files that stay the
  same while it runs (after checking §5's startup writes), so an in-place change
  is seen.
- Capture the host-specific version with `skill_write` once you know the
  services, e.g. "node-app-egress-and-webroot".

## Verdict
A service process that execs a child, re-execs its own interpreter, opens an
outbound outside its egress set, gains a new file under its writable web root,
or rewrites its static files outside its startup window — with no deploy, admin
login, or config-management run to explain it — is suspicious, and malicious when
two of these coincide. "The binary is one we know" and "nothing was in the last
snapshot" are not causes (see [false-positive-playbook]).

[persistence-hunting]: ../persistence-hunting/SKILL.md
[false-positive-playbook]: ../false-positive-playbook/SKILL.md
[outbound-destination-check]: ../outbound-destination-check/SKILL.md

© Problem99-io · Apache-2.0 · Problem99-io/kodeblue

Similar skills

All skills for Security →

From the same set13

The whole set →
containment-verification containment-verification is a Claude Code skill that inspects the host after security actions like block_ip, kill_process, quarantine_file, or stop_unit to confirm they hold. CX Codex +1 ★ 71repo stars linux-intrusion-triage linux-intrusion-triage is a Claude Code skill for examining a Linux host that may have been compromised. It guides the initial checks in sequence, using kodeblue’s read-only tools. CX Codex +1 ★ 71repo stars false-positive-playbook false-positive-playbook is a Claude Code skill that helps agents prove security findings are benign. It checks package logs, deployments, and admin sessions instead of guessing. CX Codex +1 ★ 71repo stars web-app-attack-chain web-app-attack-chain is a Claude Code skill that rebuilds a web app attack from request logs. It identifies successful in-app actions and lists the cleanup a person must handle. CX Codex +1 ★ 71repo stars kodeblue-self-integrity kodeblue-self-integrity is a Claude Code skill that investigates changes to kodeblue binaries, engine, and configuration. It analyzes whether modifications or watcher downtime stem from tampering. CX Codex +1 ★ 71repo stars service-restart-forensics service-restart-forensics is a Claude Code skill that investigates stopped or restarted services. It checks the replacement process and identifies when this host cannot reveal the cause. CX Codex +1 ★ 71repo stars outbound-destination-check outbound-destination-check is a Claude Code skill that inspects unexpected outbound connections to separate regular vendor phone-home calls from potential intruder traffic. CX Codex +1 ★ 71repo stars container-breakout-detection container-breakout-detection is a Claude Code skill that discovers code escapes from containers to the host. It inspects host namespaces, runtime sockets, and kernel parameters. CX Codex +1 ★ 71repo stars

Project sponsors

Companies that keep this analytics open