I have an external-facing ftp/webserver (with virtual hosts) running Ubuntu 12.04LTS, and I have some concerns about some network traffic I'm seeing.
Some background. I tried to be as preventive in setting up the computer as possible, perhaps relevant:
- It is directly connected to the internet and independent of our LAN, so that if it were ever compromised the damage can't spread,
- It runs
ufwwith a deny-first rule structure that only allows:- Connections to any ports from the LAN IP address (for admin purposes)
- Connections to ports 21/80 from any IP address (for the services)
apache2is configured to only allow access to potentially 'dangerous' webpages, like admin.php or setup.php from the LAN IP address, and- Other things like automatic updating,
denyhosts, etc.
My concern is I was looking at the output of nethogs this morning and found a lot entries I don't understand (I've removed my server's IP address and cropped the list a bit):
PID USER PROGRAM DEV SENT RECEIVED
? root server.address:80-180.126.248.132:56745 11.879 0.454 KB/sec
? root server.address:80-180.126.248.132:56752 9.568 0.354 KB/sec
8300 jon sshd: jon@pts/0 bond0 5.597 0.323 KB/sec
? root server.address:80-180.126.248.132:56663 6.690 0.185 KB/sec
? root server.address:80-180.126.248.132:56739 5.242 0.170 KB/sec
? root server.address:80-180.126.248.132:56608 4.658 0.170 KB/sec
? root server.address:80-180.126.248.132:56723 5.242 0.162 KB/sec
? root server.address:80-180.126.248.132:56515 4.658 0.150 KB/sec
[...]
3614 www-data /usr/sbin/apache2 bond0 0.292 0.000 KB/sec
3134 www-data /usr/sbin/apache2 bond0 0.292 0.000 KB/sec
3307 www-data /usr/sbin/apache2 bond0 0.292 0.000 KB/sec
3009 www-data /usr/sbin/apache2 bond0 0.292 0.000 KB/sec
3768 www-data /usr/sbin/apache2 bond0 0.000 0.000 KB/sec
3132 www-data /usr/sbin/apache2 bond0 0.000 0.000 KB/sec
3384 www-data /usr/sbin/apache2 bond0 0.000 0.000 KB/sec
So my question, and obvious concern, is what are these connections? Why are they owned by root and without a PID? Why are there so many?
Another answer suggested that similar entries in the other direction (i.e., from a random port to an external port 80 owned by root with no PID) signify connections to external websites, but I don't know if the reverse is the case as I also have listings for apache2... I'd like to think I'm pretty experienced with Linux at a user-level, but system administration is a little new to me. The system has chkrootkit and rkhunter installed, but running them didn't turn anything up. I would obviously like to know if I have a problem, but I'd also like to understand what's going on...
Appendix
For interest, the following is the result of my sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing)
New profiles: skip
To Action From
-- ------ ----
Anywhere ALLOW IN lan.address
80 ALLOW IN Anywhere
21/tcp ALLOW IN Anywhere
80 ALLOW IN Anywhere (v6)
21/tcp ALLOW IN Anywhere (v6)