本文へスキップ
Skillpedia
セキュリティ48k · #4866

hunt-csrf

できること

このツールは、CSRFと呼ばれる攻撃に対してウェブサイトが脆弱でないかを確認するためのものです。この攻撃により、ユーザーが気づかないうちに、本人の代わりにウェブサイトで望まない操作を実行させられてしまうおそれがあります。

使う場面

  • ✓分析する許可を得ているウェブサイトのセキュリティをテストするとき。
  • ✓管理された環境でCSRF攻撃の仕組みを理解したいとき。
  • ✓ウェブサイトが重要なユーザー操作を適切に保護しているかを確認するとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hunt-csrf/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hunt-csrf/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“example.comのパスワード変更ページがCSRFに対して脆弱かどうか確認してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

ツールは、攻撃者がウェブサイトに操作を実行させようとする様子を模擬します。ウェブサイトが、リクエストヘッダーなど偽造されうる情報を信頼して、機密性の高い処理を実行してしまわないかを確認します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

⚠️ AUTHORIZED USE ONLY This skill is for educational purposes or authorized security assessments only. You must have explicit, written permission from the system owner before using this tool. Misuse of this tool is illegal and strictly prohibited.

Mandatory confirmation gate Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:

  1. Ask the user to state the exact target URL, IP, account, or resource.
  2. Ask the user to confirm written authorization and the permitted scope.
  3. Show the exact command(s) and explain their expected effect.
  4. Wait for explicit confirmation in the current conversation.

Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.

Shortcut: a raw HTTP client beats a real cross-origin page for header-check CSRF

A raw HTTP client (curl, Burp Repeater, any scripting client) is not a browser: it will send whatever Origin/Referer header VALUE you set, from any path, on the same connection as your authenticated cookie. Many apps that claim to defend against CSRF only do a naive string check on the incoming Origin/Referer header (does it contain/equal some expected value?) rather than real same-origin enforcement — you can satisfy that check directly by setting the header, with no actual cross-site delivery (hosting an HTML page, a headless browser) required. This is faster and more reliable than building a real attacker page for this exact pattern:

POST /profile HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Origin: https://a-domain-the-app-treats-as-trusted-or-attacker-controlled.example
Cookie: <authenticated session>

username=csrf_poc

If some text names a SPECIFIC origin/domain as the "expected" attacker page, that literal value is often exactly what the server's check is looking for — try it verbatim in Origin (fall back to Referer if Origin alone doesn't flip it). Only build a real cross-origin page (actual browser delivery) when the target does genuine SameSite/fetch-based origin enforcement that a spoofed header can't satisfy.

Autonomous Testing Priority

CSRF only matters on state-changing actions that a browser could be tricked into making cross-site.

Testing flow:

  1. GET the form endpoint to establish a baseline and check what fields exist (look for hidden csrf_token, authenticity_token, _token, csrfmiddlewaretoken fields).
  2. POST the state-changing action without any CSRF token field. Send only the functional parameters (email, amount, etc.).
  3. Use a "simple-request" Content-Type — application/x-www-form-urlencoded, multipart/form-data, OR text/plain are the three CORS "simple" content-types a cross-origin form can send with no preflight. A JSON endpoint is CSRF-resistant only if the server rejects those — if it also accepts a text/plain body (common), craft a text/plain payload that parses as valid JSON (see the JSON-CSRF-via-text/plain section). Don't skip a JSON endpoint on the assumption that application/json alone is protective.
  4. If the action succeeds (2xx, no "invalid token" error) → CSRF is confirmed.

High-value targets (in order of impact):

  • Email/password change → account takeover
  • Money transfer or payment → financial fraud
  • Admin actions (role assignment, user deletion)
  • OAuth social-account linking → persistent ATO

Token bypass techniques when a token IS present:

  • Omit the token field entirely — some frameworks only validate if the field exists, not if it's absent
  • Send an empty value (_token=) — some validate format, not presence
  • Copy a token from another session — some tokens aren't tied to the session

Scope: Don't test CSRF on login forms (no existing session to exploit), logout (no real impact), or read-only GET endpoints.


Crown Jewel Targets

CSRF becomes high-value when it touches state-changing actions with account-level or financial consequences. The highest-paying targets are:

  • Account takeover vectors: OAuth/SSO flows (RelayState manipulation), social account linking/unlinking (Oculus-Facebook, SocialClub), import-friends features that expose OAuth tokens
  • Authentication infrastructure: Login CSRF, session fixation via CSRF, forced account association

…

よくある質問

CSRFとは何ですか?

クロスサイトリクエストフォージェリ(Cross-Site Request Forgery)の略で、すでにログインしているユーザーのブラウザを操作し、そのウェブサイト上で望まない操作を実行させる攻撃です。

このツールを使うのに許可が必要ですか?

はい。ツールを使う前に、システムの所有者から明示的な書面による許可を得る必要があります。許可なく使用することは違法です。

CSRFの影響を受けると、特に危険な操作はどれですか?

パスワードの変更、送金、管理者による操作、アカウントの連携など、重要な情報を変更する操作が最も危険です。

詳細

作者による元の説明

Hunting skill for csrf vulnerabilities.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#4866
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル