How-Tos

How-To: Check Whether Your Cacti Server Lets Guests In, and Lock It Down Until the Patch Ships

Leave a comment

The unpatched Cacti zero-day in this week’s news only works if guest access is on. Here’s how I check a Cacti box and close that door. You’ll need admin access to Cacti and its database.

1. Test it from the outside

Open your Cacti URL in a private browser window. If you can see graphs without logging in, guest access is on. From a terminal, the login form’s field names give it away:

# replace with your own Cacti URL
curl -s https://cacti.example.internal/graph_view.php | grep -c 'login_username'
# 1 or more = you got a login form (good)
# 0 = graphs were served without a login (guest is on)

2. Turn guest access off

In Cacti, go to Console > Configuration > Settings > Authentication and set Guest User to No User, then save. Under Console > Users, make sure the built-in guest account is disabled. Then double-check in the database:

mysql cacti -e "SELECT name, value FROM settings WHERE name='guest_user';"
mysql cacti -e "SELECT id, username, enabled FROM user_auth WHERE username='guest';"

An empty value or 0 for guest_user means no guest user is set. The guest account should not show as enabled.

3. Fence off the web UI

Cacti has no business being reachable from the internet. In nginx, limit it to your management network (example ranges, so use your own):

location /cacti/ {
    allow 10.0.0.0/8;
    deny all;
}

Run sudo nginx -t && sudo systemctl reload nginx to test and reload. On Apache, a Require ip line inside the Cacti directory block does the same job.

4. Look for signs it already ran

The exploit chain rewrites poller entries and leaves non-numeric-value warnings in the log. Look over the script-type poller items for commands you don’t recognize, and grep the Cacti log (the path varies by distro):

mysql cacti -e "SELECT local_data_id, arg1 FROM poller_item WHERE action <> 0 ORDER BY local_data_id;"
sudo grep -i 'non-numeric' /var/log/cacti/cacti.log

If anything looks off, take the box offline and rotate every SNMP string and device credential Cacti held. Then patch as soon as a fixed release lands.

God Bless, and May the Source Be with You!

References & Further Reading

Subscribe (RSS) Follow How-Tos via RSS

Leave a note

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.