hunting-web-backdoors
Skill11 starsChanged 3 months agoApache-2.0View on GitHub
Hunt for planted webshells and server-side backdoors on web infrastructure — recently-changed files in web roots, dangerous-callable content signatures (eval/system/base64), YARA scans, web-server log anomalies (POST to static-looking paths, rare user agents), and web-server processes spawning shells. Use when a web server is suspect or a post-exploitation foothold is likely, not when testing for the vulnerability that would allow one. A webshell hides in plain sight as a valid file; find it by change, content, and behavior.
Files
Hunting Web Backdoors
A webshell is a legitimate-looking file in a place that serves code, dropped
after an attacker got write access, that turns an HTTP request into command
execution. It is among the most durable footholds on internet-facing systems and
among the easiest to overlook, because it is a valid .php/.aspx/.jsp file
sitting in a directory full of valid files. You cannot find it by asking "is this
malware" one file at a time; you find it by three orthogonal lenses — what
changed, what the content can do, and how the file behaves when requested —
and by trusting the overlap.
Confirm the host is in scope per AGENTS.md. Preserve before you poke: on a live suspect server, capture the web root and logs (and memory, if warranted) before touching files, so timestamps and the shell itself are not contaminated by your own activity.
When to Use
- A web server is suspected of harboring a planted shell or backdoor
- Sweeping web roots after a confirmed or suspected exploitation
- Confirming or refuting a hunt lead or alert pointing at web infrastructure
- Establishing whether a known web vulnerability was actually used to plant a shell
When NOT to Use
- Testing for the upload/RCE flaw itself — use
testing-web-applications; this skill hunts the result, that one finds the hole - Deep analysis of a shell you already found — hand the sample to
analyzing-malware - Generic hypothesis-driven hunting across all telemetry — use
hunting-threats; this is the web-root-specific procedure - On-host artifacts beyond the web root (registry, services) — use
investigating-windows-endpoints, orresponding-to-incidentsfor a Linux host - Confirmed active intrusion — switch to
responding-to-incidents
Three Lenses (trust the overlap)
1. Change — what appeared or was modified in the web root. New or recently
modified files in served directories, especially upload/, images/, tmp/,
and cache paths that should never contain executable content:
# Recently modified server-executable files under the web root
find /var/www -type f \( -name '*.php' -o -name '*.aspx' -o -name '*.jsp' \
-o -name '*.ashx' \) -mtime -30 -printf '%TY-%Tm-%Td %p\n' | sort
# Executable content where only static assets belong
find /var/www/uploads -type f -name '*.php'Corroborate timestamps against $MFT/$UsnJrnl (Windows) or inode change time
(stat), because mtime is trivially forged.
2. Content — what the file can do. Webshells cluster around a small set of dangerous callables and obfuscation. Grep first, then YARA for known families:
grep -rInE 'eval\(|assert\(|system\(|exec\(|passthru\(|shell_exec\(|popen\(|base64_decode\(|gzinflate\(|str_rot13\(|\$_(GET|POST|REQUEST|COOKIE)\[' /var/www
yara -r webshells.yar /var/www # e.g. the neo23x0/signature-base rulesHigh-signal patterns: input superglobal passed straight into a callable
(system($_GET[...])), long base64/gzinflate blobs, and one-liner "god shells".
Watch for benign look-alikes (templating, sanitizers) — content is a lead, not a
verdict.
3. Behavior — how it is reached and what it spawns. Web-server access logs and process lineage betray shells that survive a content grep:
- POST requests to files that should only be GET static assets; requests to a file no page links to; a single client IP hitting one odd path repeatedly.
- Rare or scripted user agents, and 200s on paths that 404 for everyone else.
- The web-server user (
www-data,IIS APPPOOL) spawningcmd,powershell,/bin/sh,whoami, ornc— a near-certain execution tell in EDR/Sysmon.
awk '$6 ~ /POST/ {print $7}' /var/log/apache2/access.log | sort | uniq -c | sort -n | tailRationalizations to Reject
- "No AV hit, so the server's clean." Bespoke and heavily-obfuscated shells evade signatures. Hunt by change and behavior, not just content.
- "It's a valid PHP file, so it's fine." Every webshell is a valid file. Validity is the disguise, not the exoneration.
- "The timestamp is old, ignore it."
mtimeis attacker-controllable. Corroborate with$MFT/USN/ctime and log evidence. - "One grep pass covered it." A grep misses novel obfuscation; pair it with behavior (logs, process lineage) and change detection.
- "Found one, done." Attackers plant several and re-drop after cleanup. Sweep the whole root and check for re-appearance.
Deliverable
# Web Backdoor Hunt <WSH-###> Date: <UTC> Analyst: <name>
Host / web root / scope: <server, path, in-scope confirmation>
Lenses run: change / content / behavior — what each surfaced
Findings: <file path, family/signature, first-seen, how reached>
Evidence: <log lines, YARA hit, process-spawn event — timestamped>
Entry vector: <upload/RCE flaw if identifiable — hand to testing-web-applications>
Scope of access: <what the shell could/did do; other artifacts found>
Conclusion: backdoored / not / could-not-determine Confidence: <>
Handoffs: <sample to analyzing-malware; incident to responding-to-incidents>Save the web root snapshot, logs, and YARA output as
{tool}_{host}_{YYYYMMDD_HHMMSS}.{ext} and log findings via
maintaining-engagement-state. ATT&CK: T1505.003 (Server Software Component:
Web Shell), with T1190 as the usual entry — re-verify before citing.
References
testing-web-applications— the upload/RCE flaw that let a shell be plantedanalyzing-malware— deep analysis of a recovered shellhunting-threats— the broader hypothesis-driven hunt this specializesresponding-to-incidents,investigating-windows-endpoints— the escalation once a shell is confirmedwriting-yara-rules,engineering-detections— turning a found family into detection
Other versions1 project uses a version of this.
Word for word · 1
- EvilFreelancer/secs★ 11100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository50 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- analyzing-binariesSkill
- analyzing-malwareSkill
- analyzing-memory-imagesSkill
- analyzing-network-trafficSkill
- analyzing-phishing-emailsSkill
- attacking-active-directorySkill
- attacking-wireless-networksSkill
- auditing-code-for-vulnerabilitiesSkill
- auditing-mcp-serversSkill
- auditing-supply-chainSkill
- container-securitySkill
- cracking-passwordsSkill
- engineering-detectionsSkill
- enumerating-network-servicesSkill
- escalating-linux-privilegesSkill
- escalating-windows-privilegesSkill
- establishing-persistenceSkill
- exploiting-cloud-platformsSkill
- hardening-cloud-postureSkill
- hunting-threatsSkill
- iac-securitySkill
- investigating-aws-incidentsSkill
- investigating-azure-incidentsSkill
- investigating-gcp-incidentsSkill
- investigating-m365-entraSkill
- investigating-windows-endpointsSkill
- maintaining-engagement-stateSkill
- managing-vulnerabilitiesSkill
- mapping-attack-techniquesSkill
- orchestrating-vulnerability-researchSkill
- performing-reconnaissanceSkill
- performing-social-engineeringSkill
- producing-threat-intelligenceSkill
- recognizing-deceptionSkill
- reporting-security-findingsSkill
- responding-to-incidentsSkill
- reviewing-cryptographySkill
- securing-ai-systemsSkill
- testing-apisSkill
- testing-ics-ot-protocolsSkill
- testing-mobile-applicationsSkill
- testing-web-applicationsSkill
- threat-modelingSkill
- transferring-filesSkill
- triaging-security-alertsSkill
- vetting-agent-extensionsSkill
- writing-sigma-rulesSkill
- writing-yara-rulesSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

