Sh Kb File Uploadのロゴ

Sh Kb File Upload

コミュニティ
dmdhrumilmistry
sh-kb-file-upload

Knowledge base for finding unrestricted/insecure file upload - uploads that allow dangerous file types, execution in the upload dir, path control over the stored name, or missing content validation, leading to RCE, XSS, or overwrite. Use when hunting file-upload issues. CWE-434/436/616, OWASP A04/A05:2021.

概要

公開者dmdhrumilmistry
リポジトリsecurity-harness
スキル名sh-kb-file-upload
スター
42
フォーク
11
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    dmdhrumilmistryがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Sh Kb File Upload」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-file-upload
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dmdhrumilmistry/security-harness.git /tmp/security-harness
mkdir -p .claude/skills
cp -r /tmp/security-harness/plugins/security-harness/skills/sh-kb-file-upload .claude/skills/sh-kb-file-upload
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでSh Kb File Uploadを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にSh Kb File Uploadを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Sh Kb File Uploadは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Unrestricted File Upload - Hunter Knowledge Base

Uploads become dangerous when the app trusts the client-provided type/name, stores files where they can be executed or served, or skips content validation. Worst case: upload a web shell and get RCE.

What to hunt

  • Executable upload + reachable path (CWE-434): uploading .php/.jsp/.aspx/.py (or a bypass variant) into a directory the web server executes -> RCE.
  • Type/extension trust: validating only the client Content-Type or extension (spoofable); no server-side content/magic-byte check.
  • Path control over stored name: attacker sets the filename/path (traversal ../, overwrite of an existing file, null byte, double extension shell.php.jpg, trailing dot/space, case tricks, NTFS Alternate Data Stream shell.asp:.jpg, or a name like shell.p.phphp that becomes shell.php after a single-pass, non-recursive strip of a blacklisted extension).
  • Upload-then-validate race window: the app writes the file to a web-reachable path first and deletes it afterward if validation fails - an attacker who requests the file fast enough (or repeatedly re-uploads to widen the window) can get it executed before it's removed.
  • Content-driven XSS / SVG / HTML / polyglot: uploading .svg/.html served inline on the app origin -> stored XSS; image polyglots; .xml-backed formats -> XXE.
  • Missing limits: no size/rate limit -> DoS; zip-bomb; decompression bombs.
  • Metadata/EXIF or antivirus gaps; server-side image processing (ImageMagick "ImageTragick") RCE.

Sinks / patterns (grep targets)

Upload handlers and where they write: request.files, MultipartFile, multer, formidable, move_uploaded_file, save(/saveAs(, fs.writeFile(uploadPath), os.path.join(upload_dir, filename), secure_filename (Flask - check it's actually used), Content-Type checks, extension allowlist/denylist. Also how the file is later served (static route over the upload dir) or processed (image libs).

Detection recipe

  1. graft grep "request.files|MultipartFile|multer|move_uploaded_file|save(|writeFile|upload" --json.
  2. For each upload: How is the type validated (extension? content-type? magic bytes?). Is the stored name attacker-controlled? Where is it stored, and is that path executable or served inline on the app origin?
  3. Trace the stored filename for traversal/overwrite; check size/count limits.

Payloads / PoC

  • Web shell: shell.php with <?php system($_GET['c']); ?> if PHP execution reachable; .jsp/.aspx equiv.
  • Bypasses: double extension shell.php.jpg, null byte shell.php%00.jpg, case shell.PhP, trailing dot/space shell.php., spoofed Content-Type: image/png with PHP body, magic-byte prefix + code, alternative interpreter extensions often missing from blacklists (.phtml, .php5, .pht, .shtml, .asp;.aspx), URL-encoded extension exploit%2Ephp, polyglot image+payload files (e.g. built with ExifTool) that pass magic-byte/dimension checks.
  • Stored XSS: upload poc.svg containing <script>...</script> or poc.html, served inline.
  • Traversal/overwrite: filename ../../app/config.py (zip-slip for archives).
  • PoC: upload the file, then request its served URL and observe execution/script/overwrite.

False-positive filters

  • Server-side content validation (magic bytes / re-encode image) and an extension allowlist (not denylist), with a server-generated random stored name (client name discarded).
  • Uploads stored outside the webroot / on object storage with Content-Disposition: attachment and a non-executing content-type, served from a separate origin/domain.
  • Size/count/rate limits enforced; archives validated before extraction.
  • Validation happens before the file is written to any web-reachable path (no upload-then-delete-on-fail race window).
  • Per-directory config overrides disabled (Apache AllowOverride None, IIS handler mappings locked) so a smuggled .htaccess/web.config in the upload dir can't grant execution; on Windows, 8.3 short-filename generation disabled (fsutil behavior set disable8dot3 1) so a blocked long name can't be reached via its short alias.

CWE / OWASP / severity

CWE-434 (unrestricted upload), CWE-436 (interpretation conflict), CWE-616. OWASP A04/A05:2021. Upload->RCE -> critical; stored XSS via upload -> high; overwrite/DoS -> per impact.

Chaining hints

Upload web shell -> RCE -> secrets/lateral (chain terminus); SVG/HTML upload -> stored xss -> admin takeover; filename control -> path-traversal overwrite; XML-backed upload -> xxe; feeds injection (processing the file with a shell).

Mitigation

Allowlist expected extensions and validate content (magic bytes / re-encode images) before the file touches any web-reachable path; discard the client filename and generate a random server-side name; store outside the webroot or on object storage served from a separate origin with Content-Disposition: attachment and a safe content-type; disable per-directory config overrides and short-filename generation; enforce size/count/rate limits; scan for malware; keep image-processing libraries patched.

よくある質問

AIスキル「Sh Kb File Upload」では何ができますか?

Knowledge base for finding unrestricted/insecure file upload - uploads that allow dangerous file types, execution in the upload dir, path control over the stored name, or missing content validation, leading to RCE, XSS, or overwrite. Use when hunting file-upload issues. CWE-434/436/616, OWASP A04/A05:2021.

TypingMindでSh Kb File Uploadを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Sh Kb File Uploadはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにSh Kb File Uploadをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-file-uploadを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Sh Kb File Uploadを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Sh Kb File Uploadで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもSh Kb File Uploadを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Sh Kb File Upload」は無料ですか?

はい。dmdhrumilmistryがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇