The idea
Lucian keeps the systems running at Pennard Aquarium. The life-support controller, the box that watches the tank pumps, was broken into and is now contained: cut off from the network, but the attacker's tools are still on it. Eradication is the phase that removes them.
The trap in eradication is treating the visible part as the whole problem. An attacker who went to the trouble of getting in plans to stay: a process you kill restarts, a file you delete reappears, an account you never noticed lets them log straight back in. Each of those is a foothold: something the attacker left on the box to stay in or get back in. Lucian's job is to find every foothold and remove it, then prove the box is clean, so recovery can put it back in service without handing it back to the attacker.
Steps
-
Something is beaconing
Eradication starts by finding what the attacker left running.
pgrepsearches the process list;-aprints each match with its process id, and by default it matches against the program's name, not the longer command line, so it will not trip over other commands that merely mention the name.Lucian looks for the process the investigation flagged, then reads the script behind it to see what it is.
controller:~# pgrep -a aqua-telemetry controller:~# cat /usr/local/bin/aqua-telemetry
-
Killing the process is only the symptom
pkillsends a kill signal to every process with the name you give it, so one command stops the beacon. Lucian kills it and checks it is gone.Then he asks the question that separates eradication from first aid: if a process keeps a channel open, what makes sure it stays open? He checks the usual place that starts things on a schedule: cron, the program that runs listed commands at set times. Each account has its own list, called a cron table.
controller:~# pkill aqua-telemetry controller:~# pgrep -a aqua-telemetry controller:~# crontab -l
-
Watch it come back
Rather than wait for the next minute, Lucian runs
aqua-watchonce by hand, which is exactly what the cron job does every minute. It is the quickest way to see what the persistence actually does.If killing the process were enough, running the watchdog would do nothing useful. Watch what happens instead.
controller:~# /usr/local/bin/aqua-watch controller:~# pgrep -a aqua-telemetry
-
Find the way back in
A restart mechanism keeps the attacker's tool alive. A second kind of persistence keeps the attacker alive on the box: a way to log back in whenever they like, with no implant needed at all. The most common is an account they added.
Lucian takes the attacker's seat for a moment, from the machine the intrusion came from, to see whether that door is still open. He tries to log in to the controller as
aqua-svc, an account that should not exist.attacker:~# sshpass -p reef-backdoor-01 ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5 aqua-svc@10.0.1.10 id
-
Remove every foothold
Now Lucian removes the whole set, in an order that does not fight itself: stop the running beacon, take away the schedule that restarts it, delete the scripts so there is nothing left to run, and remove the account that is the way back in.
He works the list in that order: kill the process, then
crontab -rto drop the schedule, thenrmthe two scripts, thendeluserto remove the account.controller:~# pkill aqua-telemetry controller:~# crontab -r controller:~# rm /usr/local/bin/aqua-telemetry /usr/local/bin/aqua-watch controller:~# deluser aqua-svc controller:~# ls /usr/local/bin/aqua-telemetry
-
Prove the box is clean
Eradication is a claim, and a claim needs checking. Lucian tests each foothold the way he found it: the beacon is not running, the schedule is empty, and the attacker's account can no longer log in.
Two checks run on the controller. The third runs from the attacker's machine, because that is where the login came from.
controller:~# pgrep -a aqua-telemetry controller:~# crontab -l attacker:~# sshpass -p reef-backdoor-01 ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5 aqua-svc@10.0.1.10 id
Run these steps on real machines