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

Zabbix

Zabbix can expose useful local configuration and database credentials from a low-privileged shell. In the observed path, readable Zabbix web config led to the Zabbix database, cracked GUI credentials, local-only frontend access, and script execution as zabbix.

Local Enumeration

Zabbix was running locally:

127.0.0.1:10050  zabbix_agentd
127.0.0.1:10051  zabbix_server

Relevant processes:

/usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
/usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf

Useful config paths:

/etc/zabbix/zabbix_agentd.conf
/etc/zabbix/zabbix_server.conf
/etc/zabbix/web/zabbix.conf.php
/usr/share/zabbix/ui/conf/maintenance.inc.php

The Zabbix web config was readable:

cat /etc/zabbix/web/zabbix.conf.php | grep -v "^#"

Useful database settings:

$DB['TYPE']     = 'MYSQL';
$DB['SERVER']   = 'localhost';
$DB['PORT']     = '0';
$DB['DATABASE'] = 'zabbix';
$DB['USER']     = 'zabbix';
$DB['PASSWORD'] = 'password123';

Check the server and agent versions from the shell:

The output showed:

Zabbix Database Credentials

Connect to MySQL and inspect Zabbix users:

Observed users:

Crack the bcrypt hashes with Hashcat mode 3200:

Working Zabbix credential:

Access Local Zabbix GUI

The Zabbix frontend existed under the Apache site:

The maintenance config explained why browsing remotely showed maintenance mode and why localhost access was needed:

The frontend directory was present under /usr/share/zabbix/, and the writable config check showed:

Use a reverse port forward to browse the local Zabbix GUI:

Browse locally:

Login with:

Zabbix Script Execution

Use the Zabbix GUI to execute commands as zabbix:

Successful command output:

Stage a reverse shell script readable by Zabbix:

Edit the script to call back on the listener port:

Run it through a cloned Zabbix script and catch the shell:

Successful shell:

Last updated