File Handling logo

File Handling

Community
zhaji2333
file-handling

当目标存在文件上传(头像/附件/证件)、下载/导出、导入(Excel/CSV/XML)、预览(PDF/Office)、图片/音视频处理、压缩包解压打包、在线编辑器/终端等功能时调用。负责任意文件上传getshell、路径穿越、任意文件读取/删除、LFI/RFI、Zip Slip、CSV注入/公式注入、ImageMagick/FFmpeg攻击深度挖掘。

Overview

Publisherzhaji2333
RepositoryCkSKILLS
Skill namefile-handling
Stars
123
Forks
16
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by zhaji2333 on GitHub. Read the source before you install it.

Installation

Install the File Handling AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/zhaji2333/CkSKILLS/tree/main/.agents/skills/file-handling
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zhaji2333/CkSKILLS.git /tmp/CkSKILLS
mkdir -p .claude/skills
cp -r /tmp/CkSKILLS/.agents/skills/file-handling .claude/skills/file-handling
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable File Handling in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads File Handling on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so File Handling is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

file-handling — 文件与路径安全专项深度挖掘

何时调用(触发条件)

  • 文件上传:头像/附件/证件/导入文件
  • 文件下载/导出:报表、日志、备份
  • 文件预览/处理:PDF/Office、图片裁剪缩放、音视频处理
  • 压缩包处理:在线解压/打包
  • 文件路径参数可控:filename、path、file、template
  • 在线编辑器/IDE、终端/Shell 模拟、数据库查询工具

一、文件操作类场景表(全景)

场景漏洞类型挖掘要点
文件上传(头像/附件/证件)任意文件上传→getshell后缀绕过、MIME绕过、内容检测绕过、二次渲染绕过
文件下载/导出任意文件读取/路径穿越../遍历、绝对路径、编码绕过、符号链接
文件预览(PDF/Office)SSRF/XXE/RCE远程URL加载、OLE对象、宏执行
文件导入(Excel/CSV/XML)XXE/CSV注入/公式注入/反序列化=cmd、外部实体、恶意序列化数据
图片处理(裁剪/缩放/水印)ImageMagick RCE/SSRFMVG/SVG payload、url:协议
视频/音频处理FFmpeg SSRF/文件读取concat协议、file://、HLS playlist
压缩包处理(解压/打包)路径穿越/Zip Slip/符号链接../覆盖关键文件、软链接读取
日志下载/审计导出敏感信息泄露/路径穿越日志中含token/密码、文件名可控

二、漏洞类型全景

类型场景挖掘要点
F1. 任意文件上传头像、附件、导入类型/扩展名/内容校验
F2. 路径穿越下载接口、模板加载../规范化检查
F3. 任意文件读取/删除导出报表、缓存处理路径白名单
F4. 文件包含(LFI/RFI)动态includephp://filter等协议

三、文件上传绕过技术

扩展名:.php5/.phtml/.phar/.htaccess/.user.ini
双扩展:shell.php.jpg / shell.jpg.php
%00截断:shell.php%00.jpg
内容:GIF89a头、图片马

进阶绕过思路:

  • MIME 类型伪造(Content-Type 改为 image/png)
  • 内容检测绕过:图片马 + 二次渲染差异注入
  • 解析差异:nginx 解析漏洞、Apache 多后缀、IIS 分号截断
  • 上传点复用:头像路径 → 包含执行 / 路径可控覆盖
  • .user.ini / .htaccess 覆盖

四、路径穿越与任意文件读写

测试向量:

../ 、 ..%2f 、 %252e%252e%252f 、 ..%c0%af
绝对路径:/etc/passwd、C:\Windows\win.ini
编码:Unicode(\u002e\u002e/)、十六进制、双重编码
符号链接:上传软链接指向敏感文件

验证目标:

  • /etc/passwd、/etc/shadow(读权限)
  • 应用配置文件(数据库密码、AK/SK)
  • 源码文件(.py/.java/.php/.jar)
  • 删除接口:任意文件删除 → 配合 getshell/持久化

五、文件处理引擎攻击

ImageMagick

  • MVG/SVG payload、url: 协议(SSRF)
  • 已知 CVE:ImageTragick 系列

FFmpeg

  • concat 协议、file:// 读取
  • HLS playlist 注入

Office/PDF 预览

  • 宏执行、OLE 对象(RCE)
  • 外部实体(XXE)

压缩包

  • Zip Slip:解压路径穿越覆盖关键文件
  • 符号链接:解压软链接读取任意文件
  • Zip 炸弹:DoS

导入文件

  • CSV 公式注入:=cmd、+HYPERLINK
  • XML/Office:XXE
  • 反序列化对象(.ser/.bin)

六、特殊功能类扩展

场景漏洞类型挖掘要点
在线解压/打包路径穿越/DoSZip炸弹、符号链接攻击
在线编辑器/IDE任意文件读写/RCE文件路径可控、代码执行
终端/Shell模拟命令注入/逃逸命令过滤绕过、沙箱逃逸
数据库查询工具SQL注入/越权查询语句可控、连接信息泄露

七、验证要点

  • 上传:先验证文件落盘与访问路径,再测执行(解析到 Web 目录才可 getshell)
  • 下载/导出:filename 参数可控性 → 穿越读取 → 影响面(配置文件/源码)
  • 预览/处理:远程 URL 加载 → SSRF/XXE 链
  • 解压:Zip Slip 覆盖文件(.htaccess/.user.ini/配置)
  • 修复优先级:上传 getshell / 任意文件读取为 P0-P1

八、修复建议

  • 上传:扩展名+内容白名单、存储与执行目录隔离、随机文件名
  • 下载/读取:路径白名单+规范化校验(realpath 比对)
  • 解压:拒绝 ../ 与符号链接、限制解压大小与文件数
  • 处理引擎:升级补丁、禁用危险协议(url:/concat)
  • 导入:禁止公式执行、禁用外部实体

Frequently asked questions

What does the File Handling AI skill do?

当目标存在文件上传(头像/附件/证件)、下载/导出、导入(Excel/CSV/XML)、预览(PDF/Office)、图片/音视频处理、压缩包解压打包、在线编辑器/终端等功能时调用。负责任意文件上传getshell、路径穿越、任意文件读取/删除、LFI/RFI、Zip Slip、CSV注入/公式注入、ImageMagick/FFmpeg攻击深度挖掘。

Why use File Handling on TypingMind?

Because you install it once and use it with any model. File Handling is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install File Handling in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/zhaji2333/CkSKILLS/tree/main/.agents/skills/file-handling. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use File Handling?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with File Handling?

As many as you like. As long as a model supports skills, you can use File Handling with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the File Handling AI skill free?

Yes. It is published on GitHub by zhaji2333 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇