Common attacks and weaknesses
- Spoofed traps polluting monitoring.
- Information disclosure with SNMPv1/v2c.
Receives SNMP traps (alerts) sent by devices.
The monitoring server collects metrics, alerts or logs from devices over port 162. It travels in clear text: anyone on the path can read it.
| Service | Port | Transport | Description | Reference | Updated |
|---|---|---|---|---|---|
| snmptrap | 162 | TCP, UDP | SNMPTRAP | - | - |
// source: IANA service name and port number registry
Linux
sudo ss -ltnup 'sport = :162' # process listening on 162
sudo lsof -nP -i :162macOS
sudo lsof -nP -i :162
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 162 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 162 netstat -ano | findstr :162
From another machine
nmap -p 162 -sV <host> sudo nmap -sU -p 162 <host> nc -zv <host> 162
Block it in the firewall
sudo ufw deny 162/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 162" -Direction Inbound -LocalPort 162 -Protocol TCP -Action Block # Windows
Receives SNMP traps (alerts) sent by devices.
Port 162 is registered for UDP and TCP. In practice the service mostly uses UDP.
It is rated 4/10 (moderate) when exposed to the Internet. Spoofed traps polluting monitoring. Accept traps only from known devices.
On Linux run "ss -ltnup 'sport = :162'", on macOS "lsof -nP -i :162", and on Windows "netstat -ano | findstr :162" to see the local process. From another machine, "nmap -p 162 <host>" shows whether it is reachable.