Docs menu ▾
The commands, step by step
Run these on the test VM, in order; the # comment is what a pass looks like. As alice means
in her own login: ssh alice@localhost.
Prepare the VM
Add the admin the attacker impersonates, with SSH to log in. Pause automatic updates, which would be blocked mid-demo. Snapshot.
ls /sys/kernel/btf/vmlinux # present
sudo useradd -m -s /bin/bash -G sudo alice && sudo passwd alice
sudo apt install -y openssh-server
sudo systemctl stop unattended-upgrades apt-daily.timer apt-daily-upgrade.timer
Install and scan
Dashboard → Install → make a node key. Run the install command, accept the disclaimer, paste
the key, answer Y to the scan. Skipped the key? sudo genos-enroll with a new one.
curl -fsSL https://genossec.com/install/node.sh | sudo bash
# ends: demo enforcer is active · report accepted
More on supported hosts and what the installer does: Set up a node.
Check it's enforcing
Genos proves its hooks block on this kernel before protecting anything; without "self-test passed" it doesn't run. The dashboard shows Connected.
sudo journalctl -u genos-daemon -n 40 --no-pager
# self-test passed: create, symlink, link, rename, write, truncate, replace, delete,
# move out, link elsewhere, move the folder, mount over the folder ... blocked
# baseline version 1 (0 approved additions) · stream connected
Normal work still works
Reading protected files, sudo, cron and everything outside the protected places are untouched.
sudo cat /etc/sudoers.d/README /etc/cron.d/e2scrub_all >/dev/null && sudo -l # works
echo hi | sudo tee /etc/genos-demo.txt && sudo rm /etc/genos-demo.txt # works: not protected
The attack, as alice
One new file per folder: each refused before it exists, each a ticket.
echo 'alice ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/99-alice
echo '* * * * * root /tmp/x' | sudo tee /etc/cron.d/zz-update
printf '[Service]\nExecStart=/tmp/x\n' | sudo tee /etc/systemd/system/upd.service
echo 'ssh-ed25519 AAAA... attacker' | sudo tee /root/.ssh/authorized_keys2
# each: tee: ...: Operation not permitted
Other ways in, as alice
The same file by rename, link and symlink; the rule written into a file the baseline has; the folder swapped. All refused.
echo 'alice ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/.x >/dev/null
sudo mv /etc/.x /etc/sudoers.d/99-alice # Operation not permitted
sudo ln /etc/.x /etc/sudoers.d/99-alice # Operation not permitted
sudo ln -s /tmp/x /etc/cron.d/zz-link # Operation not permitted
sudo mv /etc/.x /etc/sudoers.d/README # Operation not permitted: README is in the baseline
echo 'alice ALL=(ALL) NOPASSWD:ALL' | sudo tee -a /etc/sudoers.d/README # Operation not permitted
sudo mv /etc/cron.d /etc/cron.d.old # Operation not permitted: no folder swaps
sudo rm -f /etc/.x
Find the tickets
Dashboard → Tickets: one per file, naming this server and alice → root, via sudo. The sudoers file is Privilege Escalation, the others Persistence; the README edit is write, the folder move folder (Defense Evasion, no Approve button). Open one for who, what, when, where and how (Reading a ticket). Dismiss the attack tickets.
Approve a planned change
A change an admin would plan is blocked like any other. Approve its ticket and rerun: it works. A different name is still refused.
echo '0 2 * * * root /usr/local/bin/backup' | sudo tee /etc/cron.d/nightly-backup
# Operation not permitted -> Approve its ticket on the dashboard, then the same command again:
echo '0 2 * * * root /usr/local/bin/backup' | sudo tee /etc/cron.d/nightly-backup # works
echo x | sudo tee /etc/cron.d/nightly-backup-2 # still Operation not permitted
The ticket shows In baseline, the approver and version 2; the server's header reads Install scan + 1 approved · v2.
Take it back
On the ticket, Revoke approval… → confirm: the name is refused again within a second. Restore install baseline on the server's Baseline tab revokes every approval at once.
sudo rm /etc/cron.d/nightly-backup
echo '0 2 * * * root /usr/local/bin/backup' | sudo tee /etc/cron.d/nightly-backup
# Operation not permitted again: the ticket reopens for a fresh decision
Try to switch it off, as alice
Stop the service and plant the file again: still refused. Removing or detaching the checks is refused. Started again, the service reports what was blocked meanwhile.
sudo systemctl stop genos-daemon
echo 'alice ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/99-alice # Operation not permitted
sudo rm /sys/fs/bpf/genos/link_inode_create # Operation not permitted
sudo umount /sys/fs/bpf # refused (must be superuser)
sudo systemctl start genos-daemon # the stopped-time block becomes a ticket
The receipts, and clean up
The journal has a line per refusal and per baseline change. Genos stays on until a reboot: disable it and reboot to remove it, or restore the snapshot.
sudo journalctl -u genos-daemon --no-pager | grep -E 'DENY|BASELINE'
# DENY create /etc/sudoers.d/99-alice ... login=alice comm=tee
# BASELINE v2: added /etc/cron.d/nightly-backup (ticket TKT-..., approved)
# BASELINE v3: removed /etc/cron.d/nightly-backup (ticket TKT-..., revoked)
sudo systemctl disable genos-daemon && sudo reboot
What counts as a pass
A pass is: every step 4, 5 and 9 command refused, and nothing changed at the path; one ticket per file, naming this server and alice; the approved name working on retry and no other; the revoked name refused again; and no DENY for step 3.
What each attack command stands for is below.
What each attack stands for
Each command is a way an intruder with valid admin credentials keeps root after the password is changed. None needs malware or an exploit.
| Plants | Command | Family · MITRE | What the attacker would get |
|---|---|---|---|
| sudoers rule | tee /etc/sudoers.d/99-alice |
Privilege Escalation · T1548.003 | Root for alice with no password, for good |
| cron job | tee /etc/cron.d/zz-update |
Persistence · T1053.003 | A root command every minute that outlives the session |
| systemd service | tee /etc/systemd/system/upd.service |
Persistence · T1543.002 | Root code at every boot, named like an update |
| root SSH key | tee /root/.ssh/authorized_keys2 |
Persistence · T1098.004 | Direct root login with the attacker's key; no sudo log |
| move, link, symlink | mv · ln · ln -s |
the same four | The same files without writing in the folder |
Genos's answer to all five: refused before the file exists, whoever runs it and however it's written, with a ticket naming the login behind it. So are a write into an existing file and a folder swap.
Limits
Not defended in the PoC
- The demo script exercises the original four folders. Since 8 and 9 November the plan covers every
file-based place of Persistence, Privilege Escalation (
/etc/sudoers, accounts and groups, setuid grants anywhere) and Defense Evasion, exec control, the kernel's state and the socket rules; the roadmap has the table. - Users' own start-up files (
~/.bashrc): editing them is everyday work, so they will be reported, not blocked. - A root user who reboots with Genos disabled, in emergency mode, or with BPF LSM left out of the
kernel's
lsm=. A kernel module loads only from the module tree now, which is itself protected.
Expect these to be blocked too
- Any edit to a protected file until an admin approves it:
sed -i, an editor, and root's ssh adding to/root/.ssh/known_hosts. systemctl enableormask: a new link in/etc/systemd/system.- A package install or upgrade that touches a protected place. dpkg asks Genos first; one ticket covers the whole transaction, and it waits for approval before changing anything.
bpftool prog show: it asks to write to Genos's maps and opens a tamper ticket.