Logo: Sh Kb File Upload

Sh Kb File Upload

Communautéit
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.

Iwwersiicht

Editeurdmdhrumilmistry
Repositorysecurity-harness
Skill-Nummsh-kb-file-upload
Stären
42
Forks
11
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    dmdhrumilmistry huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Sh Kb File Upload an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-file-upload
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Sh Kb File Upload an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Sh Kb File Upload automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Sh Kb File Upload net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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.

Firwat Sh Kb File Upload op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Sh Kb File Upload besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Sh Kb File Upload an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-file-upload an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Sh Kb File Upload benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Sh Kb File Upload benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Sh Kb File Upload domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Sh Kb File Upload gratis?

Jo. dmdhrumilmistry huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇