Attack: SSH brute-force from Kali against a TrueNAS 13.1 host. Defense: detect in logs and block the attacker with pf
.
A TrueNAS server and a Kali Linux host run on a segmented lab network. Kali performs reconnaissance, finds SSH (port 22) open, and launches a brute-force attempt with the ssh-brute
NSE script. On defense, the activity is detected in /var/log/auth.log
and the source IP is immediately blocked with the system firewall.
ssh-brute
Review authentication logs on the server to confirm repeated failures and the source IP.
pf
Block the attacker to stop further attempts while you continue incident response.
pf
is enabled# enable pf (if not already)
sudo pfctl -e
# check status / rules
sudo pfctl -sr
Edit /etc/pf.conf
and add a line replacing ATTACKER_IP
with the source:
block in quick from ATTACKER_IP to any
pf.conf
.sudo pfctl -f /etc/pf.conf
sudo pfctl -sr # confirm rule is present
This immediately cuts off the brute-force source while you proceed with standard IR: scoping, additional log review, credential hygiene, and hardening.