For the complete documentation index, see llms.txt. This page is also available as Markdown.

Maltrail

Maltrail exposes a Python HTTP service with a web login. The observed service identified itself as Maltrail 0.52 in the page footer and was vulnerable to command injection through the login username field.

Discovery

Enumerate all TCP ports because Maltrail may listen on a high port:

nmap -sC -sV -p- TARGET -oA nmap/nmap.full

Observed indicators:

8338/tcp open  http  Python http.server 3.5 - 3.10
|_http-title: Maltrail
| http-robots.txt: 1 disallowed entry
|_/
|_http-server-header: Maltrail/0.52

Confirm the application and version in the browser or with web fingerprinting:

whatweb http://TARGET:8338

The version is displayed at the bottom of the Maltrail page.

Default Credentials

The documented default credentials successfully authenticated to the web interface:

admin:changeme!

Username Command Injection

The login username is passed into a shell command used to log failed authentication attempts. Command substitution in the username field can therefore execute a command even when a random password is supplied.

Start a listener:

Create a Base64-encoded Python reverse shell payload:

Enter the resulting value in the username field using this form and submit any password:

Successful execution returned a shell as snort:

References

  • https://github.com/stamparm/maltrail

  • https://github.com/advisories/GHSA-6655-8f3g-xp52

  • https://github.com/rvzsec/maltrail-rce

Last updated