Логотип Auditing Php Applications

Auditing Php Applications

Спільнота
trilwu
auditing-php-applications

Перевіряйте вихідний код вебзастосунків на PHP на критичні вразливості, використовуючи специфічний для PHP каталог небезпечних sink-функцій і помилок: ін’єкції об’єктів через unserialize та ланцюжки POP у phar://, обхід автентифікації через нестроге порівняння типів і magic hash, LFI/RFI через обгортки php:// і phar://, динамічні включення файлів і довіру до extract()/суперглобальних змінних, SQL-ін’єкції у запитах, сформованих конкатенацією рядків, і застарілих запитах mysql_*, функції виконання команд і SSRF. Використовуйте цю навичку, коли перевіряєте кодову базу на PHP, застосунок WordPress/Magento/Laravel або плагін на наявність вразливостей, які можна експлуатувати. Загальну методологію аудиту залиште навичці auditing-code-for-vulnerabilities.

Add to TypingMind

Огляд

Видавецьtrilwu
Репозиторійsecskills
Назва навичкиauditing-php-applications
Зірки
144
Форки
15
Файли в пакеті
Лише інструкції
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Усе необхідне — в інструкціях

    Усе потрібне моделі міститься в інструкціях — жодних додаткових файлів для синхронізації.

  • Відкритий вихідний код

    Видавець на GitHub: trilwu. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Auditing Php Applications у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/trilwu/secskills/tree/main/secskills-core/skills/auditing-php-applications
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

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/auditing-php-applications .claude/skills/auditing-php-applications
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Auditing Php Applications в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Auditing Php Applications, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Auditing Php Applications не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Auditing PHP Applications

This is the PHP-specific layer on top of auditing-code-for-vulnerabilities. Take the methodology from that skill — context → attack surface → bug-class hunt → variant analysis → the four-question verification gate — and apply the PHP sink catalog below to it. This skill exists because PHP has footguns no language-agnostic methodology carries: features that turn a file read into remote code execution, and comparison rules that turn == into an auth bypass.

The collection deliberately has no per-language audit skills except this one. PHP earns the exception because it dominates the legacy-web and WordPress/Magento space where critical bugs actually live, and because its dynamic features fail in ways a reviewer must be primed for specifically.

When to Use

  • Reviewing a PHP codebase or plugin for exploitable vulnerabilities
  • Auditing a WordPress, Magento, Joomla, or Laravel application's source
  • Tracing a suspected RCE, LFI, SQLi, or object-injection path in PHP
  • Deciding whether a unserialize, include, or == on user input is exploitable

When NOT to Use

  • General audit methodology, or a non-PHP language — use auditing-code-for-vulnerabilities; this skill assumes it
  • Finding a planted webshell or backdoor rather than a vulnerability — use hunting-web-backdoors
  • Building the deserialization exploit chain once you have the sink — use exploiting-deserialization
  • Black-box testing a running app — use testing-web-applications
  • Reviewing only the diff of a change — use reviewing-code-changes

Sinks by Bug Class

Trace user input (superglobals, headers, uploaded filenames, DB values that were once user input) to each of these. A sink is only a bug when a source reaches it.

Remote code execution

  • Direct eval sinks: eval, assert (string arg, pre-8.0), preg_replace with /e (pre-7.0), create_function (pre-8.0), mb_ereg_replace/mb_eregi_replace with the e option.
  • Command execution: system, exec, passthru, shell_exec, backticks, proc_open, popen, pcntl_exec. Watch escapeshellarg vs escapeshellcmd misuse — escapeshellcmd does not prevent argument injection.
  • Dynamic dispatch: $func() where $func derives from input, call_user_func/call_user_func_array, array_map/usort/ preg_replace_callback with a user-influenced callback.

Object injection (the PHP-defining bug)

  • unserialize() on any user-controlled data is object injection. Exploitation is a POP chain: existing classes with __wakeup, __destruct, __toString, or __call magic methods that do something dangerous when the object is materialized. The vulnerable file often contains no dangerous code at all — the gadget lives in a framework or dependency.
  • phar:// is unserialize in disguise — but version-gated. On PHP before 8.0, any file operation (file_exists, fopen, include, getimagesize, …) on a phar:// path automatically deserializes the Phar's metadata, so a path-traversal or LFI that points a file function at an uploaded .phar (or any file carrying Phar metadata) is object injection with no unserialize call in sight. PHP 8.0 removed that automatic unserialize — only explicit Phar::getMetadata() deserializes now. So the bug is critical on the huge installed base of PHP 7.x and a non-issue on 8.x unless the code calls getMetadata() itself. Check the runtime version before ruling it in or out.
  • Prefer json_decode in remediation; flag every unserialize on non-trusted data regardless of an obvious gadget — the gadget may arrive with the next dependency update.

LFI / RFI and stream wrappers

  • include, require, include_once, require_once with user input.
  • Wrappers that change everything: php://filter/... (read source, and a known RCE chain via convert.iconv/compression filters), php://input (RFI-style body inclusion), data:// (inline payload), phar:// (object injection), expect://, zip://. allow_url_include being on turns LFI into remote RFI.
  • File-read sinks (file_get_contents, readfile, fopen, highlight_file) with traversal give source and secret disclosure.

SQL injection

  • Legacy mysql_query/mysqli_query with string-concatenated input.
  • $wpdb->query("... $var ...") without $wpdb->prepare() — a ->prepare that is present but interpolates outside its placeholders is still injectable.
  • PDO/mysqli used with string building instead of bound parameters. Placeholder usage on the table/column name (which cannot be bound) is a common real hole.

Type juggling and magic-hash auth bypass

  • == and != are loose. strcmp/hash_equals/=== are the safe forms. The classic bypass: if (md5($input) == $stored) where two inputs both hash to a 0e[0-9]+ "magic hash" compare equal, because two numeric strings compare as numbers (0e123 == 0e456 → 0.0 == 0.0).
  • Version matters and it is a trap. In PHP 8.0 the number-vs-string rules changed: 0 == "foo" was true in PHP 7 and is false in PHP 8, so a in_array(0, $userStrings) or 0 == $token bypass that worked on PHP 7 fails on PHP 8. But the 0e magic-hash bypass survives PHP 8, because both sides are numeric strings and still compare as numbers. Check the target PHP version before ruling a juggling bug in or out.
  • strcmp($_GET['x'], $secret) returned NULL (loosely == 0) when passed an array in PHP 7 — an auth bypass; in PHP 8 it throws a TypeError. Same code, different verdict by version.

Superglobal trust and variable variables

  • extract($_GET/$_POST/$_REQUEST) lets a request set arbitrary local variables — overwrites auth flags, config, anything not yet initialized.
  • $$var / ${$key} variable variables, parse_str without a result array (writes into scope), import_request_variables (removed 5.4) — all register_globals-flavoured variable injection.

SSRF and file upload

  • file_get_contents/curl/fopen on a user-supplied URL is SSRF — route the exploitation reasoning through exploiting-ssrf.
  • Uploads: check the destination is outside the web root, the extension is not attacker-chosen (double extensions, .phtml, .php5, null bytes on old PHP), and the server will not execute the type. A validated MIME with an attacker-controlled extension in a web-served directory is RCE.

Ecosystem Context

  • WordPress: nonces are CSRF protection, not authorization — a valid nonce does not mean the user is allowed to act; look for the missing current_user_can() check. $wpdb->prepare is mandatory for interpolation. unfiltered_html, edit_* capabilities, and unauthenticated AJAX/REST (wp_ajax_nopriv_*, permission_callback => '__return_true') are the usual holes.
  • Magento: heavy unserialize history, layout-XML injection, and the admin path/patch level matter for known-CVE reachability.
  • Laravel: mass assignment ($fillable/$guarded), Blade {!! !!} (unescaped) vs {{ }} (escaped), and a leaked APP_KEY enabling cookie/decrypt object injection.

Verify Before You Report

Apply auditing-code-for-vulnerabilities' gate: trace the source to the sink, confirm the path is reachable (auth, routing, and — critically — the PHP version for juggling and removed-function bugs), and demonstrate impact rather than asserting it. A unserialize with no reachable gadget, or a /e regex on PHP 8, is a hardening note, not a critical finding — say which.

Rationalizations to Reject

  • "There's no unserialize, so no object injection." phar:// reaches unserialize through ordinary file functions. Check every file operation whose path a user can influence.
  • "It uses ==, that's fine for a hash check." == on hashes is the magic-hash bypass. Only hash_equals/=== are safe, and the bypass survives PHP 8.
  • "The comparison bug works, I confirmed it." On which PHP version? 0 == "x" and strcmp(array) flipped verdict at PHP 8.0. State the version.
  • "prepare() is called, so the query is safe." Only for values inside placeholders. Interpolated table/column names and text spliced around the placeholders are still injectable.
  • "The nonce check passes, so it's authorized." WordPress nonces are CSRF tokens. Authorization is a separate current_user_can() you must find.
  • "The upload validates the MIME type." MIME is spoofable and irrelevant if the attacker controls the extension and the directory executes PHP.
  • "It's a framework class, the gadget isn't here." POP-chain gadgets live in dependencies by design. The absence of dangerous code in the vulnerable file is normal, not exculpatory.

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-code-for-vulnerabilities — the general methodology and gate this skill sits on top of
  • hunting-web-backdoors — planted malice rather than vulnerabilities
  • exploiting-deserialization — building the POP chain once you find the unserialize/phar:// sink
  • exploiting-ssrf — the exploitation side of a user-controlled URL fetch
  • testing-web-applications — black-box testing of the running application

Поширені запитання

Що робить навичка ШІ Auditing Php Applications?

Перевіряйте вихідний код вебзастосунків на PHP на критичні вразливості, використовуючи специфічний для PHP каталог небезпечних sink-функцій і помилок: ін’єкції об’єктів через unserialize та ланцюжки POP у phar://, обхід автентифікації через нестроге порівняння типів і magic hash, LFI/RFI через обгортки php:// і phar://, динамічні включення файлів і довіру до extract()/суперглобальних змінних, SQL-ін’єкції у запитах, сформованих конкатенацією рядків, і застарілих запитах mysql_*, функції виконання команд і SSRF. Використовуйте цю навичку, коли перевіряєте кодову базу на PHP, застосунок WordP...

Навіщо використовувати Auditing Php Applications у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Auditing Php Applications — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Auditing Php Applications у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/trilwu/secskills/tree/main/secskills-core/skills/auditing-php-applications. TypingMind прочитає файл SKILL.md і встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Auditing Php Applications?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Auditing Php Applications?

Зі скількома забажаєте. У TypingMind ви можете використовувати Auditing Php Applications із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Auditing Php Applications?

Так. На GitHub цю навичку публікує trilwu за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі
Логотип openclaw

Release Openclaw Plugin Testing

openclaw
ОрганізаціяПопулярне

Плануйте та виконуйте передрелізну перевірку плагінів OpenClaw: вбудованих плагінів, артефактів пакетів, команд життєвого циклу, doctor/fix, перевірки конфігурації після повторного перетворення, запуску шлюзу, сумісності SDK, Docker E2E,…

82.2K
391K
Файлів: 1
Відкрити
Логотип openclaw

Solid

openclaw
ОрганізаціяПопулярне

Write, port, review, or test Solid 2 UI in OpenClaw (Control UI, plugin views, Canvas hosts), including state ownership, Lit interop during the migration, native overlays, testing, performance, and…

82.4K
391.7K
Файлів: 9
Відкрити
Логотип openclaw

Auto Qa

openclaw
ОрганізаціяПопулярне

Запускайте автономні кампанії QA, живого тестування та стрес-тестування для всього OpenClaw у незалежних потоках підсистем, із перевіреними виправленнями та звітом із доказами, який можна доповнювати після перерви.

82.2K
391K
Файлів: 5
Відкрити
Логотип openclaw

Autoreview

openclaw
ОрганізаціяПопулярне

Структурований перегляд коду на прямий запит; перевага надається OpenAI/Codex перед Claude.

82.2K
391K
Файлів: 12
Відкрити

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇