linuxClamAV

Enumeration:

Port Scanning:

As always we are going to start with nmap:

┌──(kali㉿kali)-[~/…/Machines/OffsecPG/Practice/ClamAV]
└─$ sudo nmap -sCV -p- --min-rate 4000 -oA nmap/services -vv 192.168.219.42
Starting Nmap 7.95 ( https://nmap.org ) at 2025-10-01 20:03 +03
Nmap scan report for 192.168.219.42                                                                                                                      22:16:40 [40/1003]
Host is up, received echo-reply ttl 61 (0.13s latency).
Scanned at 2025-10-01 20:03:43 +03 for 336s  
Not shown: 65525 closed tcp ports (reset)                                            
PORT      STATE    SERVICE     REASON                                 VERSION
22/tcp    open     ssh         syn-ack ttl 61                         OpenSSH 3.8.1p1 Debian 8.sarge.6 (protocol 2.0)
| ssh-hostkey:                                                                                                                                                             
|   1024 30:3e:a4:13:5f:9a:32:c0:8e:46:eb:26:b3:5e:ee:6d (DSA)                                                                                                             
| ssh-dss AAAAB3NzaC1kc3MAAACBALr/RyBq802QXa1Bh4SQEUHqD+p9TEx3SUvPHACbT0tQqR3aali+ifDiOpqMToVaRfWzYOOsoM2Neg0EPa4KsJIwSTkFqjd/3Ynp3Yzus0nN+gtmbQRKzo8QfStr6IGt6kaI6viXl4z3w
w6ryEkjNnb74KCooHOjyeGPi3o89GVnAAAAFQDSg0dwMrSn9juW/XPvo8S8kVOhDQAAAIARaqFuvZCqiTY8i/PITsr5WvyZm8mQ0nuqB6gW6y1h4jDAvtHO4TIZEMJ5vtPst0w9mVSYGVFlukhCqhbJdBigqH1WB1p7kwC78M9k
23zZmzuwbnzYPiLHpEdfFEWdO62ZoCSFBXWOqe1IZaTaRCgUZPeB1QFXRCQ96VrJizPLUAAAAIEArOALxR78fZrUqmUcYOs5tf8wu5xChAUqAfh1ElJ6r3EjcWwXId12jo1uAz0JmCTluUQhjhNDJB6XIgUzoFzW1NZPjGCkex7
s1+2+TUTmqFr6Nr97k2RIy91Bpuxwg5jzE83cKPCOoWVbYlfzAqNkF4xxznfC3fRtmj2e/L9chzg=                                                                                              
|   1024 af:a2:49:3e:d8:f2:26:12:4a:a0:b5:ee:62:76:b0:18 (RSA)
|_ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAviGcDkDxKzv7w++DXy6q+5AJDpG/q8Um8j4BheW9fgwsOvQCuDvLcPUIKMYEz4aUgkt/sSCXu29XTlu79pEkb48+BnaRCKrHLH/YWM79GT6Q5ie9jP47HjjJeCCBI/c02qpkH
/fjz9FK4HQPC7WtXY9EgW4IMB+pzX2KZxK2PF0=                                                                                                                                    
25/tcp    open     smtp        syn-ack ttl 61                         Sendmail 8.13.4/8.13.4/Debian-3sarge3                                                                
| smtp-commands: localhost.localdomain Hello [192.168.45.186], pleased to meet you, ENHANCEDSTATUSCODES, PIPELINING, EXPN, VERB, 8BITMIME, SIZE, DSN, ETRN, DELIVERBY, HELP
|_ 2.0.0 This is sendmail version 8.13.4 2.0.0 Topics: 2.0.0 HELO EHLO MAIL RCPT DATA 2.0.0 RSET NOOP QUIT HELP VRFY 2.0.0 EXPN VERB ETRN DSN AUTH 2.0.0 STARTTLS 2.0.0 For
 more info use "HELP <topic>". 2.0.0 To report bugs in the implementation send email to 2.0.0 sendmail-bugs@sendmail.org. 2.0.0 For local information send email to Postmas
ter at your site. 2.0.0 End of HELP info                                             
80/tcp    open     http        syn-ack ttl 61                         Apache httpd 1.3.33 ((Debian GNU/Linux))
|_http-title: Ph33r                                                                                                                                                        
| http-methods:                           
|   Supported Methods: GET HEAD OPTIONS TRACE
|_  Potentially risky methods: TRACE                                                 
|_http-server-header: Apache/1.3.33 (Debian GNU/Linux)
139/tcp   open     netbios-ssn syn-ack ttl 61                         Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
199/tcp   open     smux        syn-ack ttl 61                         Linux SNMP multiplexer
445/tcp   open     netbios-ssn syn-ack ttl 61                         Samba smbd 3.0.14a-Debian (workgroup: WORKGROUP)
43523/tcp filtered unknown     host-unreach from 10.73.110.248 ttl 62
58146/tcp filtered unknown     host-unreach from 10.73.110.248 ttl 62
60000/tcp open     ssh         syn-ack ttl 61                         OpenSSH 3.8.1p1 Debian 8.sarge.6 (protocol 2.0)
| ssh-hostkey:                                                                                                                                                             
|   1024 30:3e:a4:13:5f:9a:32:c0:8e:46:eb:26:b3:5e:ee:6d (DSA)                       
| ssh-dss AAAAB3NzaC1kc3MAAACBALr/RyBq802QXa1Bh4SQEUHqD+p9TEx3SUvPHACbT0tQqR3aali+ifDiOpqMToVaRfWzYOOsoM2Neg0EPa4KsJIwSTkFqjd/3Ynp3Yzus0nN+gtmbQRKzo8QfStr6IGt6kaI6viXl4z3w
w6ryEkjNnb74KCooHOjyeGPi3o89GVnAAAAFQDSg0dwMrSn9juW/XPvo8S8kVOhDQAAAIARaqFuvZCqiTY8i/PITsr5WvyZm8mQ0nuqB6gW6y1h4jDAvtHO4TIZEMJ5vtPst0w9mVSYGVFlukhCqhbJdBigqH1WB1p7kwC78M9k
23zZmzuwbnzYPiLHpEdfFEWdO62ZoCSFBXWOqe1IZaTaRCgUZPeB1QFXRCQ96VrJizPLUAAAAIEArOALxR78fZrUqmUcYOs5tf8wu5xChAUqAfh1ElJ6r3EjcWwXId12jo1uAz0JmCTluUQhjhNDJB6XIgUzoFzW1NZPjGCkex7
s1+2+TUTmqFr6Nr97k2RIy91Bpuxwg5jzE83cKPCOoWVbYlfzAqNkF4xxznfC3fRtmj2e/L9chzg=                                                                                              
|   1024 af:a2:49:3e:d8:f2:26:12:4a:a0:b5:ee:62:76:b0:18 (RSA)
|_ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAviGcDkDxKzv7w++DXy6q+5AJDpG/q8Um8j4BheW9fgwsOvQCuDvLcPUIKMYEz4aUgkt/sSCXu29XTlu79pEkb48+BnaRCKrHLH/YWM79GT6Q5ie9jP47HjjJeCCBI/c02qpkH
/fjz9FK4HQPC7WtXY9EgW4IMB+pzX2KZxK2PF0=                                              
60578/tcp filtered unknown     host-unreach from 10.73.110.248 ttl 62
Service Info: Host: localhost.localdomain; OSs: Linux, Unix; CPE: cpe:/o:linux:linux_kernel

Also I will scan for UDP ports:

We can see that we have multiple open ports, we will inspect each one on its own.

SNMP (161):

I will start with snmp, we can use multiple tools to interact with the snmp server, such as onesixtyone, snmpwalk, snmpbulkwalk, snmp-check, etc.

We can see that we can access it with the default community string. We will find under the running processes that clamav is running along with sendmail and snmp, etc.

HTTP (80):

Browsing the website:

Nothing realy interesting, just some binary text.

Exploitation:

Using what we have collected so far, I will search for any public exploits for and clamav:

Or simply using searchsploit:

We will find that we have one written in perl, I will mirror it to my current directory:

We can go through it to understand how the attack goes, and if it has any malicious stuff:

It is just command execution in the recipient field of the email, and this script will open us a bind shell on port 31337, I will run it with perl:

The exploit seems it went correctly.

I will use nmap again to scan if the port opened:

Indeed it is open, I will connect to it using netcat:

We are already root.

I will get the root flag:

Last updated