suspicious outbound connections
Hey, I was checking my router's (standalone Linksys) outbound connection log. I found the following coming from my Mandrake 9.2 box:
192.168.1.103 198.147.128.161 2293 192.168.1.103 68.1.196.71 1850 192.168.1.103 195.93.34.10 60829 192.168.1.103 195.93.34.9 56450 My box is configured as a web server and that's it. Has someone hacked my box and installed another app that's serving some other purpose? What should I look for in netstat? I ask also because right now I can't seem to ssh in or access webmin. The webserver is still running, though. Very suspicious. Appreciatively, di11rod |
more info
Rebooted machine and now I can ssh in and webmin is running.
Checked access log for http. Looks like many of the IP addresses listed in the outbound connections are in here making requests for my web content. So perhaps this is what proxied connections do... But here's something a little wierd from a plain netstat listing-- tcp 0 0 myhost:http gtw13-2.esc13.net:1927 FIN_WAIT2 tcp 0 0 myhost:http gtw13-2.esc13.net:1565 FIN_WAIT2 tcp 0 0 myhost:http gtw13-2.esc13.net:1566 FIN_WAIT2 tcp 0 0 myhost:http gtw13-2.esc13.net:1349 FIN_WAIT2 This is pretty weird. The reason I'm still curious is because not all the IP addresses in the outbound connection log are found in the http access log... Appreciatively, di11rod |
Put a IDS like snort on all your boxes, then you amy have a little more to go on for finding out if anything is going in or out of your network.
|
thanks
Yeah, I've installed Snort, but it's pretty complex. Still trying to figure out how to configure it.
I've also got the mysql option for it, too. di11rod |
Me too. iv'e only recently installed it as well, just learning to secure my network. It is rather confusing not knowing what traffic you should be concerned about
|
securing your box's...
Snort is a great tool to use. I highly recommend setting it up with mysql and using acid as an a php front end. You will need to spend a some time configuring the rules to meet your needs but it can be very useful.
The other thing you should really do is setup a firewall with iptables. It is a little confusing when you first do it but after a while it becomes second nature. This way you can just close all your ports except the ones you know you need. |
got snort... ACID....
Ok, so last night I installed Snort with ACID and mysql. Very useful. I immediately detected attempts at exploiting my phpnuke webapp that I had fortunately protected against using mod_rewrite directives.
But my router's outbound connection log is still filled with this stuff hitting other IP's in high port ranges. Snort has no mention of this. 192.168.1.103 12.175.0.35 46539 192.168.1.103 152.163.252.104 35150 192.168.1.103 152.163.252.134 48852 192.168.1.103 152.163.253.71 48571 192.168.1.103 152.163.253.99 41322 192.168.1.103 152.163.252.8 46011 192.168.1.103 152.163.252.165 50044 192.168.1.103 152.163.252.40 57982 192.168.1.103 152.163.252.164 34968 192.168.1.103 152.163.252.132 35283 192.168.1.103 152.163.252.65 58144 192.168.1.103 152.163.252.163 56647 192.168.1.103 152.163.252.226 54502 192.168.1.103 152.163.253.98 54781 192.168.1.103 152.163.253.5 50809 192.168.1.103 152.163.252.195 53771 192.168.1.103 152.163.252.136 49678 192.168.1.103 152.163.252.100 49376 192.168.1.103 152.163.252.200 36982 192.168.1.103 152.163.253.70 42457 192.168.1.103 152.163.252.225 50325 192.168.1.103 152.163.252.194 48227 192.168.1.103 152.163.253.104 59420 192.168.1.103 152.163.252.38 40574 The IP on the left is my own. The IP in the middle is the destination. The 5-digit number on the far right is the destination port number. It looks like my computer is port scanning. No alerts from snort, though. Any ideas? di11rod |
I think it's proxied connections
Ok. I think it's my box responding to proxied connections requesting web pages. Anyone in agreement with this?
di11rod |
Iptables are a little confusing at first, i have a script i would like to use bit i'm not exactly sure how to apply it
|
di11rod,
It is difficult to tell what your outbound connections are. But the best way to test would be to shutdown your web server for the night and take a look at your log. If you are still getting the traffic take a look at the other processes running on your box. ps -aef there must be something doing it. |
fotoguy,
most people just put their iptables as a startup script. it is best habit to flush everything at the top of your script and to log everything. There are tons of examples on line, it is easiest- to customize someone elses script when you are just getting started. |
Ports and such
You mentioned that you are running a web server? So you have incoming port connections from a misc higher port number to your box, port 80. They you have outbound connections to that higher port number from your port 80. So:
Client port 13000 > You port 80 You port 80 > client 13000 So you should expect to see outbound connections from your port 80 to high port numbers. Maybe I'm missing something but this seems reasonable. Also wouldn't a trojan of some kind be contacting one port and not a bunch of random ones? |
thanks
Ndcomputerguy,
Thanks for the vote of confidence. I was thinking that, too. If it were a trojan, why would it be skipping around to all those different port numbers without any rhyme or reason. But then I thought maybe it was a clever probing algorithm that was avoiding detection by the targets by only hitting them randomly. To be sure, I'll shut off httpd for a couple hours and see what is logged. thanks everyone, di11rod |
gfyspf
Unfortunatley my motherboard died on my linux box so i have to run windoze at the moment till i get my new, but i was told you can add it to the /etc/rc.d/init.d/iptables script. I'm not sure where to add it to the script i.e top.middle or bottom, since there is already a fair amount stuff in there. |
All times are GMT -5. The time now is 05:03 AM. |