OS: Debian 12
I'm working on my OPSEC pretty often because security is very important for me. Now I have a new router which opens a port on my computer when I plug in the LAN cable. When I disconnect the LAN cable, the port is closed. I have no port-forwarding configured on my router
No LAN plugged in:
$ sudo ss -lntup Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process udp UNCONN 0 0 192.168.122.1:53 0.0.0.0:* users:(("dnsmasq",pid=2717,fd=5)) tcp LISTEN 0 32 192.168.122.1:53 0.0.0.0:* users:(("dnsmasq",pid=2717,fd=6)) LAN plugged in:
$ sudo ss -lntup Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process udp UNCONN 0 0 192.168.122.1:53 0.0.0.0:* users:(("dnsmasq",pid=2717,fd=5)) udp UNCONN 0 0 0.0.0.0:33955 0.0.0.0:* tcp LISTEN 0 32 192.168.122.1:53 0.0.0.0:* users:(("dnsmasq",pid=2717,fd=6)) When I re-plugin my LAN, it opens another port:
$ sudo ss -lntup udp UNCONN 0 0 192.168.122.1:53 0.0.0.0:* users:(("dnsmasq",pid=2717,fd=5)) tcp LISTEN 0 32 192.168.122.1:53 0.0.0.0:* users:(("dnsmasq",pid=2717,fd=6)) udp UNCONN 0 0 0.0.0.0:49258 0.0.0.0:* What causes this? I don't think this is normal behavior. Even though the state is UNCONN, it seems like a security risk because the port is opened by my LAN cable, right? I use WireGuard. When I disable it, the unconn socket is gone.
Why does it do this?
How can I prevent this from happening?
socat -u udp4-recv:5555 -? Want to hide the process from ss? I'm leaving it as an exercise.