Logo van Hunting Web Backdoors

Hunting Web Backdoors

Community
trilwu
hunting-web-backdoors

Spoor geplaatste webshells en backdoors op in een webbroncodeboom: eerst PHP, maar ook JSP, ASP en Node. Sorteer bestanden in een directory op grote schaal, decodeer statisch lagen van obfuscatie zonder de payload ooit uit te voeren, spoor infecties op waarbij code aan bestanden is toegevoegd en vind nepplug-ins. Gebruik bekende shellfamilies als aanwijzing, niet als bewijs. Gebruik deze skill wanneer je vermoedt dat een webserver is gecompromitteerd, bij het opschonen van een gehackte WordPress-, Magento- of CMS-site, om gedownloade PHP-codebases of plug-ins op verborgen kwaadaardige code te controleren, of wanneer een bestand eval op gedecodeerde invoer bevat.

Add to TypingMind

Overzicht

Uitgevertrilwu
Repositorysecskills
Skillnaamhunting-web-backdoors
Sterren
144
Forks
15
Meegeleverde bestanden
Alleen instructies
LicentieMIT
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door trilwu op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Hunting Web Backdoors in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/trilwu/secskills/tree/main/secskills-core/skills/hunting-web-backdoors
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/trilwu/secskills.git /tmp/secskills
mkdir -p .claude/skills
cp -r /tmp/secskills/secskills-core/skills/hunting-web-backdoors .claude/skills/hunting-web-backdoors
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Hunting Web Backdoors in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Hunting Web Backdoors automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Hunting Web Backdoors niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Hunting Web Backdoors

This is not a vulnerability audit. You are looking for code an attacker already planted — a webshell, a one-line eval backdoor, a fake plugin, a malicious line appended to a legitimate file. The weakness that let them in is auditing-php-applications' job; this skill finds what they left behind.

Two things make it hard. The malicious code is deliberately hidden — obfuscated, split, or buried in a tree of thousands of legitimate files — so a naive grep misses it. And the tells (eval, base64_decode, dynamic calls) appear in plenty of benign code, so a naive grep also drowns you in false positives. The work is the discrimination.

When to Use

  • A web server is suspected or confirmed compromised and you need every shell
  • Cleaning a hacked WordPress, Magento, Joomla, or custom PHP site
  • Vetting a downloaded plugin, theme, or codebase before deploying it
  • A file contains eval, assert, or system on decoded or request-derived input
  • Triaging a web root full of unfamiliar PHP for planted malice

When NOT to Use

  • Finding the vulnerability that allowed the upload — use auditing-php-applications
  • Deep single-sample analysis (a specific shell you want to fully reverse, its C2, its capabilities) — use analyzing-malware
  • The broader incident (scoping, timeline, containment) — use responding-to-incidents; this skill is the source-tree sweep within it
  • Malicious dependencies / package install scripts — use auditing-supply-chain
  • Host-level persistence (cron, systemd, LD_PRELOAD) — use analyzing-linux-persistence

Never Execute to Deobfuscate

The single rule that must not bend: the obfuscated code is the payload. Do not run it, do not "just let PHP decode it," do not replace eval( with echo( and execute the file, do not paste it into an online sandbox that runs it. Deobfuscation is a static transformation:

  • Decode the layers by hand or with a decode-only tool (base64_decode, gzinflate, gzuncompress, str_rot13, hex/\xNN, strrev) applied as string operations, not as executed PHP.
  • If you must automate, use a de-obfuscator that decodes without executing (UnPHP's decoder, a Python reimplementation of the decode chain) — never the PHP interpreter on the sample.
  • Replacing the final eval( with file_put_contents('out.php', ...) and running it is executing the payload if any prior layer has side effects. Decode statically, then read.

"Most webshells are three or four layers of encoding around ten lines of logic" — peel to the logic, do not detonate the wrapper.

Triage a Directory at Scale

You cannot read every file. Rank candidates by cheap signals, then read the top of the list:

bash
# 1. PHP where PHP should not be — uploads, cache, images, media dirs
find wp-content/uploads -name '*.php' -o -name '*.php[0-9]' -o -name '*.phtml' 2>/dev/null

# 2. Recently modified, clustered in time (attackers touch many files at once)
find . -name '*.php' -newermt '2026-07-01' -printf '%T+ %p\n' | sort

# 3. High entropy / long single lines — the shape of packed obfuscation
find . -name '*.php' -exec awk 'length>1000{print FILENAME": "length; nextfile}' {} \;

# 4. The dangerous-sink grep — leads, NOT verdicts (see the FP problem below)
grep -rnE '\b(eval|assert|system|passthru|shell_exec|proc_open|popen|create_function)\s*\(' --include='*.php' .
grep -rnE '(base64_decode|gzinflate|gzuncompress|str_rot13|hex2bin)\s*\(' --include='*.php' .

# 5. Request-driven code execution — the webshell core
grep -rnE '\$_(GET|POST|REQUEST|COOKIE|SERVER)\s*\[[^]]*\]\s*\(' --include='*.php' .
grep -rnE '(eval|assert|system|passthru)\s*\(\s*\$_(GET|POST|REQUEST|COOKIE)' --include='*.php' .

The most reliable single lead is variable execution of request data — $_POST['x'](), ev[a]l($_GET[...]), ass[e]rt($_REQUEST[...]), call_user_func($_GET['f'], ...). Legitimate code almost never dispatches a function name straight from a superglobal.

The Grep Is Not Clean Just Because It Is Empty

A source tree that returns nothing for grep eval can still be backdoored. Attackers defeat the obvious grep deliberately:

  • Concatenation: $a='ev'.'al'; $a($code); or ('e'.'v'.'a'.'l')(...).
  • Variable variables / indirection: $f='system'; $f($_GET['c']);, ${'_'.'GET'}, $$x.
  • Char/hex/octal escapes: "\x65\x76\x61\x6c" is eval; chr(101).chr(118)....
  • Callback sinks: array_map, array_filter, usort, preg_replace_callback, register_shutdown_function, ob_start with a user-controlled callback.
  • String-eval that is not eval: assert($str) (pre-8.0), preg_replace('/./e', $str, ...) (pre-7.0), create_function('', $str) (pre-8.0), mb_ereg_replace with e.
  • Comment and whitespace insertion between token pieces to break naive regex.

So grep is a lead generator, not a coverage guarantee. When grep is empty and you still suspect infection, fall back to: entropy/long-line ranking, mtime clustering, and diffing against a known-good copy (below).

Append-Infections Are the Ones You Miss

The hardest infection is a backdoor appended to or inserted into a legitimate file — index.php, wp-config.php, a theme's functions.php, vendor/ autoloaders. The file is 99% real, so it does not stand out by name, location, or entropy overall. Find these by comparison, not by inspection:

bash
# Diff the tree against a pristine copy of the same CMS/plugin version
# (download the exact version from wordpress.org / the vendor)
diff -rq ./site /known-good/wordpress-6.x/

# WordPress core/plugin integrity via checksums
wp core verify-checksums; wp plugin verify-checksums --all

# git/composer/npm: what changed vs the committed/locked state
git status --porcelain; git diff

If you have no known-good baseline, the tells are: code after the closing ?> of an otherwise-normal file, a lone eval/base64_decode line wedged at the top of a config file, or a <?php ... ?> block whose style clashes with the surrounding file.

Version-Gated Tells Date the Code

The presence of a removed language feature tells you something:

  • preg_replace with the /e modifier — removed in PHP 7.0. Its presence means the backdoor targets (or predates) PHP 5.x.
  • create_function() and string-argument assert() as code execution — removed in PHP 8.0. Common in older shells; on a PHP 8 server they would fault, which is itself a signal about when the code was planted.

Known Families Are Leads, Not Verdicts

Fingerprints speed triage but do not replace reading the code:

IOC strings in this section are bracket-broken — ev[a]l is eval, ass[e]rt is assert. Written literally they match Backdoor:PHP/Chopper and this file, a defensive hunting skill, gets quarantined on download. The grep patterns above are intact and safe to copy. See "Antivirus false positives" in the repo README.

  • China Chopper — a one-liner: <?php @ev[a]l($_POST['pass']);?> (or assert), often under 30 bytes. Tiny, so easy to miss and easy to append.
  • WSO, b374k, c99, r57, indoxploit — full-featured panels; grep their banner strings, characteristic function names, or auth-cookie names as leads.
  • Weevely — generates obfuscated, password-gated shells that change per build; signature matching is weak, so rely on the request-driven-execution and obfuscation signals instead.

A signature hit confirms a shell. It does not confirm you found them all — attackers plant several, and the second one rarely matches the first's family.

When You Confirm One, Assume More

  1. Preserve before you delete. A confirmed shell is evidence — copy it (hash it) to a holding location before removing it, per responding-to-incidents. Deletion alone loses the timeline and, if you miss the entry point, the attacker re-plants within hours.
  2. Find the entry point. A shell got there somehow — a vulnerable upload, a known-CVE plugin, stolen credentials. Hand that to auditing-php-applications (source) or responding-to-incidents (logs); a cleaned site with the hole still open is re-infected by morning.
  3. Keep hunting. One shell found is a reason to raise suspicion of the whole tree, not to close the case. Re-run the sweep after removing the obvious one.

Rationalizations to Reject

  • "grep for eval came back clean, so the tree is clean." Concatenation, hex escapes, and callback sinks all evade it. Empty grep is not coverage — fall back to entropy, mtime, and diff-against-known-good.
  • "I'll just run it to see what it decodes to." That is executing the payload. Decode statically, always.
  • "It uses eval, so it's a backdoor." Templating engines, caches, and frameworks use eval legitimately. The tell is eval on decoded or request-derived input, not eval itself.
  • "It's heavily obfuscated, so it's malicious." Commercial plugins ship obfuscated (ionCube, Zend Guard, licensing). Obfuscation raises suspicion; it does not convict. Decode and read the logic.
  • "I found the shell and deleted it, done." You found a shell. Preserve it, find the entry point, and re-sweep — attackers plant redundancy.
  • "The file is a core CMS file, it must be safe." Append-infections live in exactly those files precisely because you assume that. Verify by checksum.
  • "No known-shell signature matched." Weevely and custom shells match nothing. Signatures are leads; behaviour (request-driven execution, obfuscation) is the evidence.

Reading External Sources

Fetch public advisories, specifications, and vendor reports as Markdown:

bash
curl -sL "https://defuddle.md/<url>"      # scheme in the path is optional

This strips page boilerplate — roughly 78% fewer tokens on a prose page — and returns the full text rather than a summary, so you can grep it and trust a negative result.

Three things it is not for. Fetch JSON and API responses raw, because readability extraction mangles structured data. Fetch authenticated or JavaScript-rendered pages directly, because it retrieves them anonymously. And never route adversary infrastructure (phishing links, C2, malware hosting), client-owned hosts, or engagement URLs through it — the request leaves your machine to a third party, and for live adversary infrastructure it also tips off the operator.

Some sites block the extractor and return an error blob rather than the page — {"error":"Failed to fetch: 418 I'm a teapot"} from freedesktop.org, for instance. That is the fetch being refused, not the source saying the thing does not exist. Re-fetch the URL directly before drawing any conclusion from it.

References

  • auditing-php-applications — the vulnerability that let the shell in
  • analyzing-malware — deep reverse of a single recovered shell, its C2 and capabilities
  • responding-to-incidents — evidence handling, scoping, and the wider IR this sweep sits inside
  • analyzing-linux-persistence — host-level persistence beyond the web root
  • writing-yara-rules — turning a confirmed family into a reusable signature

Veelgestelde vragen

Wat doet de AI-skill Hunting Web Backdoors?

Spoor geplaatste webshells en backdoors op in een webbroncodeboom: eerst PHP, maar ook JSP, ASP en Node. Sorteer bestanden in een directory op grote schaal, decodeer statisch lagen van obfuscatie zonder de payload ooit uit te voeren, spoor infecties op waarbij code aan bestanden is toegevoegd en vind nepplug-ins. Gebruik bekende shellfamilies als aanwijzing, niet als bewijs. Gebruik deze skill wanneer je vermoedt dat een webserver is gecompromitteerd, bij het opschonen van een gehackte WordPress-, Magento- of CMS-site, om gedownloade PHP-codebases of plug-ins op verborgen kwaadaardige code...

Waarom Hunting Web Backdoors gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Hunting Web Backdoors bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Hunting Web Backdoors in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/trilwu/secskills/tree/main/secskills-core/skills/hunting-web-backdoors. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Hunting Web Backdoors gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Hunting Web Backdoors gebruiken?

Zoveel als je wilt. Je kunt Hunting Web Backdoors gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Hunting Web Backdoors gratis?

Ja. Deze skill is door trilwu op GitHub gepubliceerd onder de licentie MIT. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇