Snare

Executive Summary
A penetration test was conducted on the target machine 10.115.0.150.18 (hostname: snare.ptd). The assessment revealed critical vulnerabilities, including Remote File Inclusion (RFI) leading to initial access and misconfigured file permissions on /etc/shadow, allowing privilege escalation to root.
Key Findings:
Remote File Inclusion (RFI) in
index.phpleading to code execution.World-writable
/etc/shadowallowing root privilege escalation.Exposed sensitive credentials (password hash modification possible).
Risk Level:
Critical (Unauthenticated RCE + Privilege Escalation to root).
Methodology
Reconnaissance
Nmap Scan Result
Enumeration
Web Application Analysis:

URL structure: http://10.115.0.150.18/index.php?page=home
Suspected Local/Remote File Inclusion (LFI/RFI) vulnerability.
Exploitation
1. Remote File Inclusion (RFI) → RCE
At the first glance the url build like /index.php?page=home, this indicate potential Local File Inclusion or Remote File Inclusion.
Reverse Shell Obtained:
Gained access as www-data.

Stabilized shell:
Privilege Escalation (Root via /etc/shadow Modification)
/etc/shadow Modification)Manual enumaration find that, /etc/shadow can be edit by global user. With the persmission, we can change root hash with crafted one. I will use mkpasswd with password smallcurl.
Discovery:
/etc/shadow had world-writable permissions:
Exploitation:
Generated a new root password hash (smallcurl):
Replaced root’s hash in /etc/shadow.
Logged in as root via SSH or change user (su)

Findings & Vulnerabilities
1. Remote File Inclusion (RFI)
2. World-Writable /etc/shadow
/etc/shadowRecommendations
Remote File Inclusion (RFI)
Sanitize user input in
index.php.Use a whitelist approach for file inclusion.
Disable remote URL inclusion in PHP (
allow_url_include=Off).
/etc/shadow Permission Misconfiguration
/etc/shadow Permission MisconfigurationRestrict
/etc/shadowpermissions:Audit system-critical files for incorrect permissions.
Conclusion
The target machine was fully compromised due to Remote File Inclusion (RFI) and misconfigured /etc/shadow permissions. Immediate remediation is required to prevent unauthorized root access.
Next Steps:
Patch the RFI vulnerability.
Correct
/etc/shadowpermissions.Conduct a full system audit for similar misconfigurations.
Report Author: whymir Date: 28/3/2025
Last updated