A Debian-first guide to identifying broad automated scanning, reviewing exposed services and applications, and reducing exploitable surface area.
Vulnerability scanning is automated probing designed to identify known weaknesses in exposed services, applications, frameworks, and software versions. It is broader than simple port scanning and often includes checks for known paths, headers, versions, error messages, and protocol behavior.
Scanners may be benign in some contexts, but on public systems they are often the first step toward exploitation.
sudo grep "UFW BLOCK" /var/log/ufw.log | tail -n 100
sudo ss -tulnp
sudo ufw status numbered
sudo journalctl -u caddy --since "1 hour ago"
sudo grep "UFW BLOCK" /var/log/ufw.log | awk '{
for(i=1;i<=NF;i++){
if($i ~ /^SRC=/){
split($i,a,"=");
print a[2];
}
}
}' | sort | uniq -c | sort -nr | head
sudo apt list --installed
sudo systemctl list-units --type=service --state=running
sudo ufw deny from <IP_ADDRESS>
sudo ufw deny 8080
sudo ufw deny 3306
sudo ufw deny 5432
sudo systemctl stop <service_name>
sudo systemctl disable <service_name>
sudo ss -tulnp
sudo systemctl list-units --type=service --state=running
sudo apt update
sudo apt upgrade
sudo grep "Accepted" /var/log/auth.log
sudo grep -Ei "admin|login|api" /var/log/caddy/*.log 2>/dev/null | tail -n 100
Recovery here means reducing exposed software, updating what remains, and confirming that scanning did not progress into deeper activity.
sudo apt update
sudo apt upgrade
sudo apt list --installed
sudo systemctl list-units --type=service --state=running
sudo ufw allow from <trusted_ip> to any port 22
sudo ufw deny 22
sudo journalctl --since "24 hours ago"
# Review application configuration to reduce unnecessary public details
Manual exposure review should come first. Future recommendations may include low-cost infrastructure or monitoring options that improve visibility, but the best defense is still a smaller, cleaner attack surface.
All commands shown are based on Debian-based systems unless otherwise noted.