In this section
LX1.1 UAC — The Primary Linux Triage Tool
UAC: Unix Artifact Collector — Your First Tool on a Compromised System
Why you need an automated triage tool
When BASTION-NGE01 is compromised and the attacker is still logged in, you do not have time to run 40 individual commands in the correct order while documenting each one. You need a tool that runs those commands for you — collecting volatile data, log files, filesystem metadata, and system configuration in a single automated pass. The triage tool is to Linux IR what KAPE is to Windows IR: it captures the standard evidence set quickly and consistently, so you can begin analysis immediately instead of spending 45 minutes on manual collection.
UAC (Unix Artifact Collector) is the primary triage tool for Linux incident response. It is open-source, maintained on GitHub, runs as a shell script (no installation required — no package manager, no compilation, no dependencies beyond a POSIX-compliant shell), and collects over 200 artifact categories from Linux, macOS, and other Unix-like systems.
# PREPARATION (on your forensic workstation — do this BEFORE the incident)
# Clone UAC and copy to USB drive / network share
git clone https://github.com/tclahr/uac.git ~/tools/uac
# Copy to USB drive (keep on your IR kit permanently)
cp -r ~/tools/uac /mnt/usb/uac/
# DEPLOYMENT OPTION 1: USB drive (preferred — no network contamination)
# Mount USB on the compromised system, run directly
cd /mnt/usb/uac
sudo ./uac -p ir_triage -o /mnt/usb/output/$(hostname)/
# -p ir_triage : fast profile (3-8 minutes), captures critical evidence
# -o : output directory (on the USB, NOT on the local disk)
# $(hostname) : creates a directory named after the system
# DEPLOYMENT OPTION 2: SCP transfer (when no physical access)
scp -r ~/tools/uac investigator@target:/tmp/uac/
# WARNING: SCP creates an entry in auth.log and wtmp — document this
ssh investigator@target "cd /tmp/uac && sudo ./uac -p ir_triage -o /tmp/uac-output/"
# DEPLOYMENT OPTION 3: Stream output to forensic workstation (zero local writes)
ssh investigator@target "cd /tmp/uac && sudo ./uac -p ir_triage -o /dev/stdout" | \
tar xzf - -C ~/cases/INC-NE-2026-0402/BASTION-NGE01/
# Pipes UAC output directly to your workstation — nothing written to target disk# Two-pass collection for active attacker scenarios
# Pass 1: Triage — capture volatile evidence immediately (3-8 minutes)
sudo ./uac -p ir_triage -o /mnt/usb/output/bastion-nge01-triage/
# While this runs, you can monitor with: ls -la /mnt/usb/output/bastion-nge01-triage/
# Pass 2: Full — capture everything else (15-30 minutes)
sudo ./uac -p full -o /mnt/usb/output/bastion-nge01-full/
# This runs while you begin analyzing the triage output
# Verify output integrity
cd /mnt/usb/output/bastion-nge01-triage/
sha256sum -c hashes.sha256
# Every line should show "OK" — any failure indicates modification after collectionMyth: "Running collection tools on a compromised system contaminates the evidence and makes it inadmissible."
Reality: All live forensic collection modifies the system to some degree — this is an unavoidable physical reality, not a disqualifying flaw. Courts and tribunals routinely accept evidence from live system collection when the investigator documents what modifications occurred, explains why they were necessary, and demonstrates that the modifications did not alter the evidence being analyzed. The chain of custody log (worked artifact above) provides this documentation. Not collecting evidence because of contamination concerns is far worse than collecting with documented, understood modifications — the former leaves you with no evidence at all.
Decision points: choosing the right UAC deployment method
Physical access available (data center, on-site): USB deployment is preferred. No network traffic, no authentication events, no SCP modifications. The cleanest deployment method.
SSH access only (remote server, cloud VM): SCP the UAC directory to the target. Accept the authentication log modification. Consider piping output directly to your workstation to avoid writing to the target's disk.
Multiple systems compromised: Deploy UAC via SSH to all systems in parallel using a tool like pssh or a simple loop: for host in host1 host2 host3; do ssh $host "cd /tmp/uac && sudo ./uac -p ir_triage -o /tmp/uac-out/" & done. This captures triage evidence from all systems before returning for full collection on priority systems.
Container environment: UAC can run inside a container via kubectl exec or docker exec, but some modules may fail (e.g., those requiring kernel module enumeration). Use the ir_triage profile which avoids the most container-incompatible modules.
Troubleshooting: common UAC deployment issues
UAC fails with "Permission denied." UAC must run as root to collect all artifacts. Use sudo ./uac. If sudo is not available and you cannot escalate, UAC will collect what it can with current permissions — but will miss root-owned logs, /proc deep reads for other users' processes, and system configuration files.
UAC fails on Alpine Linux. Some UAC modules depend on GNU coreutils features not available in BusyBox. Use the ir_triage profile which uses the most portable commands. If specific modules fail, the errors are logged in UAC's collection log — the remaining artifacts are still collected successfully.
Output directory runs out of space. A full UAC collection on a server with large log files can produce 500MB-2GB of output. Ensure the output destination (USB drive, /tmp, network share) has sufficient space before starting. Check with df -h /mnt/usb/ before running UAC.
Hash verification shows failures after transfer. The evidence file was corrupted during transfer (network error, incomplete SCP). Re-transfer the specific failed files from the UAC output directory on the target system. If the target system has been modified since collection, the re-transferred files will have different hashes — document this discrepancy.
UAC hangs during the bodyfile generation phase. Large filesystems (millions of files) can cause the bodyfile generation to take 30+ minutes. If you need results quickly, cancel UAC and restart with ir_triage (which skips the bodyfile). Run the full bodyfile generation later as a separate pass.
Try it yourself
Clone UAC on your forensic workstation: `git clone https://github.
Clone UAC on your forensic workstation: git clone https://github.com/tclahr/uac.git. Run it against a test VM (not a production server): cd uac && sudo ./uac -p ir_triage -o /tmp/uac-test/. Examine the output directory structure: find /tmp/uac-test/ -type d | head -20 (directories), wc -l /tmp/uac-test/hashes.sha256 (number of collected files), cat /tmp/uac-test/live_response/process/ps_auxf.txt | head -20 (process listing), ls /tmp/uac-test/logs/ (collected log files). Run the hash verification: cd /tmp/uac-test && sha256sum -c hashes.sha256 | tail -5. You have just deployed UAC and verified the output — the same workflow you will follow in every investigation.
Beyond this investigation
UAC is the starting point of every Linux investigation in this course. In LX4 (SSH Brute Force), you will analyze the authentication logs from UAC's logs/ directory. In LX5 (Web Application Compromise), you will analyze the web server logs. In LX7 (Persistence), you will examine the cron jobs, systemd services, and authorized_keys files from system/ and user/. In LX2 (Filesystem Forensics), you will use the bodyfile for timeline generation. The tool collects the evidence. The subsequent modules teach you to analyze it.
Check your understanding:
1. Why is running UAC from a USB drive preferred over copying it to the compromised system's local disk? 2. What is the difference between the full and ir_triage profiles, and when would you use each? 3. UAC's bodyfile contains filesystem metadata for every file. What analysis technique uses this data, and which module covers it? 4. You run UAC on a compromised system. What modifications does UAC make to the system, and how do you document them for chain of custody?
You are investigating a Linux server and discover evidence of both a cryptominer (resource abuse) and an SSH key theft (lateral movement preparation). The cryptominer is consuming 95% CPU and impacting production. Which do you address first?
Address the lateral movement first. The cryptominer is visible, noisy, and contained to this server — it is causing performance impact but not spreading. The SSH key theft is silent, potentially already exploited, and may have given the attacker access to additional servers. Contain the lateral movement risk: rotate the stolen SSH keys, check the target servers for unauthorized access, and apply network restrictions. Then address the cryptominer: kill the process, remove the binary and persistence mechanisms. Prioritizing the noisy but contained threat over the silent but spreading threat is the most common Linux IR prioritization mistake.
Get weekly detection and investigation techniques
KQL queries, detection rules, and investigation methods — the same depth as this course, delivered every Tuesday.
No spam. Unsubscribe anytime. ~2,000 security practitioners.