Tomorrow's Labs

Linux CCDC Field Guide

Three service-focused exercises. Learn how each stack works, secure it without destroying availability, and be ready to explain every change.

E-Commerce Storefront

Secure a small Apache and PHP storefront while preserving remote access, the product catalog, and the shopping cart.

Rocky Linux 9

Know the stack

  • Apache: serves the storefront over HTTP.
  • PHP: runs the application logic.
  • PHP sessions: preserve the shopping cart.
  • firewalld: controls network exposure.
  • SELinux: limits web-service access.

Review these paths

  • /etc/httpd/conf/httpd.conf
  • /etc/httpd/conf.d/
  • /etc/php.ini
  • /etc/php.d/99-ecom-ccdc.ini
  • /var/www/html/store/
  • /var/log/httpd/

Two priority tips

1. Secure without breaking availability

Enable firewalld, permit only the storefront traffic, then test the site from another machine after each change.

2. Treat users and PHP as attack surfaces

Audit accounts, sudo access and SSH keys; then disable exposed errors, version disclosure, and insecure session-cookie settings.

CCDC checks

  • Unauthorized users or additional UID 0 accounts.
  • Weak ownership and permissions under the web root.
  • Disabled or modified firewall rules.
  • Unnecessary ports, services, cron jobs, or timers.
  • Insecure PHP settings and exposed error details.
  • RedHavi files, accounts, keys, and persistence.

Useful commands

ss -lntp firewall-cmd --list-all systemctl status httpd getenforce restorecon -RF /var/www/html/store journalctl -u httpd

Practical objective

Open the storefront from another machine, add products to the cart, secure the host, remove RedHavi artifacts, and prove the application still works.

Email with Roundcube

Understand the complete mail path—from SMTP delivery to Maildir storage and remote access through webmail or IMAP.

Ubuntu 22.04

Know the stack

  • Roundcube: provides the webmail interface.
  • Postfix: sends and receives SMTP mail.
  • Dovecot: provides IMAP access.
  • Apache/PHP: hosts Roundcube.
  • Maildir: stores each user's messages.

Review these paths

  • /etc/postfix/main.cf
  • /etc/dovecot/dovecot.conf
  • /etc/dovecot/conf.d/
  • /etc/roundcube/config.inc.php
  • /etc/apache2/conf-enabled/roundcube.conf
  • /home/username/Maildir/

Two priority tips

1. Do not confuse listening with relaying

inet_interfaces = all accepts remote connections. Never use mynetworks = 0.0.0.0/0; that can create an open relay.

2. Follow the message to disk

Send a test attachment, locate it under the recipient's Maildir, and verify ownership and permissions without making mail readable by other users.

CCDC checks

  • Ports 25, 143, 443, and 993.
  • Unauthorized users, sudo access, or SSH keys.
  • Incorrect home, Maildir, and attachment permissions.
  • Stopped Postfix, Dovecot, or Apache services.
  • Modified firewall rules and unnecessary exposure.
  • Unauthorized SMTP relaying and RedHavi persistence.

Useful commands

ss -lntp ufw status verbose postconf -n doveconf -n systemctl --failed journalctl -u postfix -u dovecot

Practical objective

Send an email with an attachment from one user to another, access it from a different machine, and demonstrate where it is stored under the recipient's Maildir.

Splunk Monitoring

Protect the monitoring platform while preserving log ingestion, searches, dashboards, forwarder communication, and evidence needed by the team.

Debian 12 · Splunk 10.0.2

Know the stack

  • Splunk Web: provides searches, dashboards, and administration.
  • splunkd: runs indexing, searches, REST management, and inputs.
  • Forwarders: send approved logs from other systems.
  • Indexes: store searchable event data.
  • Apps: package configuration, scripts, commands, and dashboards.

Review these paths

  • /opt/splunk/etc/system/local/
  • /opt/splunk/etc/apps/*/local/
  • /opt/splunk/etc/apps/*/bin/
  • /opt/splunk/etc/users/
  • /opt/splunk/etc/auth/
  • /opt/splunk/var/log/splunk/

Two priority tips

1. Trace every forwarder and receiver

Inventory approved forwarders, deployment clients, destinations, and receiving ports. Investigate unknown peers or changes to outputs.conf, inputs.conf, and deploymentclient.conf.

2. Audit every path that can execute code

Inspect script:// inputs, alert actions, custom commands, modular inputs, and app bin/ directories. The lab plants ccdc_post as a benign example of this execution path.

CCDC checks

  • Unknown Splunk users, roles, tokens, sessions, or admin changes.
  • Unauthorized forwarders, deployment servers, or output destinations.
  • Malicious scripted inputs, alert actions, commands, or app binaries.
  • /opt/splunk/etc/apps changed to root:splunk mode 0777.
  • The practice app /opt/splunk/etc/apps/ccdc_post/.
  • Unexpected ports such as 8000, 8089, or 9997.
  • System users, sudo access, SSH keys, cron jobs, and RedHavi persistence.

Useful commands

/opt/splunk/bin/splunk status /opt/splunk/bin/splunk list forward-server /opt/splunk/bin/splunk btool inputs list --debug /opt/splunk/bin/splunk btool outputs list --debug ss -lntp journalctl -u Splunkd

Practical objective

Identify every log source and forwarder, locate the ccdc_post scripted input, preserve evidence, and remove the practice app. Restore /opt/splunk/etc/apps to splunk:splunk mode 0755, then prove ingestion, searches, and dashboards still work.