Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-20-2004, 02:38 PM
|
#1
|
Member
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 211
Rep:
|
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
|
|
|
01-20-2004, 03:25 PM
|
#2
|
Member
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 211
Original Poster
Rep:
|
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
|
|
|
01-20-2004, 09:38 PM
|
#3
|
Senior Member
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291
Rep:
|
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.
|
|
|
01-20-2004, 10:03 PM
|
#4
|
Member
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 211
Original Poster
Rep:
|
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
|
|
|
01-21-2004, 08:14 AM
|
#5
|
Senior Member
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291
Rep:
|
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
|
|
|
01-21-2004, 11:59 AM
|
#6
|
LQ Newbie
Registered: Jul 2003
Posts: 17
Rep:
|
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.
|
|
|
01-21-2004, 04:16 PM
|
#7
|
Member
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 211
Original Poster
Rep:
|
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
|
|
|
01-21-2004, 04:18 PM
|
#8
|
Member
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 211
Original Poster
Rep:
|
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
|
|
|
01-21-2004, 07:47 PM
|
#9
|
Senior Member
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291
Rep:
|
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
|
|
|
01-22-2004, 12:10 PM
|
#10
|
LQ Newbie
Registered: Jul 2003
Posts: 17
Rep:
|
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.
|
|
|
01-22-2004, 12:13 PM
|
#11
|
LQ Newbie
Registered: Jul 2003
Posts: 17
Rep:
|
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.
|
|
|
01-22-2004, 05:02 PM
|
#12
|
Member
Registered: Oct 2003
Posts: 47
Rep:
|
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?
|
|
|
01-22-2004, 06:32 PM
|
#13
|
Member
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 211
Original Poster
Rep:
|
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
|
|
|
01-23-2004, 02:55 AM
|
#14
|
Senior Member
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291
Rep:
|
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 09:41 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|