meltedinhex/analyst-ai-pack / skills/analyzing-webshells
analyzing-webshells
VerifiedAnalyzes suspected webshells (PHP, ASPX/ASP, JSP) by detecting dynamic-execution sinks, input-to-sink data flow, and common encoder/obfuscation chains, then decoding obvious layers to reveal the command interface. Activates for requests to analyze a webshell, identify a PHP/ASPX/JSP backdoor, or deobfuscate server-side malicious scripts.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 2.8 KB |
| references/api-reference.md | markdown | 1.4 KB |
| scripts/analyst.py | script | 3.4 KB |
references/api-reference.md
View on GitHub# API Reference: Analyzing Webshells
## Overview
`scripts/analyst.py` scans a server-side script (PHP/ASPX/JSP) for dynamic-execution sinks,
request-input-to-sink data flow, and encoder chains, and best-effort decodes base64/raw-deflate
layers that wrap webshell logic. It reads the file statically, executes nothing, and defangs URLs.
## Dependencies
| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | base64, zlib, regex, JSON, file IO |
## Core functions
### `scan(path)`
Returns language, execution sinks, input sources, an input-to-sink flow flag, encoder chains,
decoded layers, defanged URLs, and a webshell likelihood flag.
### `_decode_layers(text)`
Decodes base64 (and raw-deflate) blobs and keeps those whose plaintext contains execution sinks.
## Detection logic
- **Sinks**: PHP `eval`/`system`/`passthru`/`preg_replace /e`; ASPX `eval`/`Process.Start`;
JSP `Runtime.exec`/`ProcessBuilder`.
- **Input flow**: a sink plus `$_GET`/`$_POST`/`Request`/`getParameter` raises confidence.
- **Encoders**: `base64_decode`, `gzinflate`, `str_rot13`, `FromBase64String`, `\x` hex.
## Usage
```bash
python scripts/analyst.py scan shell.php
```
## Sources
- MITRE ATT&CK T1505.003 Web Shell — https://attack.mitre.org/techniques/T1505/003/
- Server-side execution sink and encoder-chain patterns from public webshell research
- PHP/ASP/JSP language execution APIs from their official documentation
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |