linuxClamAV

Summary

  • Target exposed SNMP, SMTP, Apache, Samba, and ClamAV-related services.

  • SNMP enumeration revealed valuable system/process details, including an exposed clamav-milter service.

  • The misconfiguration in the ClamAV milter process was later exploited to gain a root shell directly.

🧵 Let's Unpack

🚪 Enumeration

🔍 Nmap Full TCP Scan

nmap -p- -T5 192.168.167.42 -vv

🔎 Detailed Nmap Service Scan

sudo nmap -sC -sN -A -oN nmapFull -p- 22,25,80,139,199,445,60000 -A 192.168.167.42

Key Findings:

  • Open services: SSH, SMTP, HTTP , SMB, SNMP

  • High port 60000 open


SMTP Enumeration (Port 25)

  • Found running: Sendmail 8.13.4/Debian-3sarge3

  • No misconfig or banner leaks observed


SNMP Enumeration (Port 161)

chevron-rightDetailed SNMP findingshashtag

Key Findings:

  • Hostname: 0xbabe.local

  • OS: Linux kernel 2.6.8 (outdated)

  • Running process: clamav-milter observed with full path: /usr/local/sbin/clamav-milter

  • Listening TCP Ports: 25 (SMTP), 80 (HTTP), 139/445 (SMB), 199, 60000

  • UID 3779 shows clamav-milter with parameters hinting socket usage

💡 clamav-milter running and exposed is a strong indicator to search for local exploits.


Initial Foothold (Root Directly)

Found local exploit for clamav-milter vulnerability:

📌 Exploit: https://www.exploit-db.com/exploits/4761

🎯 Exploitation Steps

  1. Compile and run the exploit locally or transfer it via HTTP/SMB.

  2. Exploit opens a reverse shell listener on the target's port 31337.

  1. Got direct root shell 🎉


🧠 Gotcha!

The clamav-milter process running with elevated privileges and exposed via SNMP was the hidden gem. Always inspect process listings in SNMP responses — they can leak exploitable services.


Privilege Escalation

Not needed — root shell gained directly via local misconfiguration exploit.


Last updated