LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 01-20-2004, 03:38 PM   #1
di11rod
Member
 
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 207

Rep: Reputation: 32
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
 
Old 01-20-2004, 04:25 PM   #2
di11rod
Member
 
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 207

Original Poster
Rep: Reputation: 32
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
 
Old 01-20-2004, 10:38 PM   #3
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: KirraMail Live Email Server
Posts: 1,281

Rep: Reputation: 61
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.
 
Old 01-20-2004, 11:03 PM   #4
di11rod
Member
 
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 207

Original Poster
Rep: Reputation: 32
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
 
Old 01-21-2004, 09:14 AM   #5
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: KirraMail Live Email Server
Posts: 1,281

Rep: Reputation: 61
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
 
Old 01-21-2004, 12:59 PM   #6
gfyspf
LQ Newbie
 
Registered: Jul 2003
Posts: 17

Rep: Reputation: 0
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.
 
Old 01-21-2004, 05:16 PM   #7
di11rod
Member
 
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 207

Original Poster
Rep: Reputation: 32
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
 
Old 01-21-2004, 05:18 PM   #8
di11rod
Member
 
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 207

Original Poster
Rep: Reputation: 32
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
 
Old 01-21-2004, 08:47 PM   #9
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: KirraMail Live Email Server
Posts: 1,281

Rep: Reputation: 61
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
 
Old 01-22-2004, 01:10 PM   #10
gfyspf
LQ Newbie
 
Registered: Jul 2003
Posts: 17

Rep: Reputation: 0
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.
 
Old 01-22-2004, 01:13 PM   #11
gfyspf
LQ Newbie
 
Registered: Jul 2003
Posts: 17

Rep: Reputation: 0
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.
 
Old 01-22-2004, 06:02 PM   #12
nidputerguy
Member
 
Registered: Oct 2003
Posts: 47

Rep: Reputation: 15
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?
 
Old 01-22-2004, 07:32 PM   #13
di11rod
Member
 
Registered: Jan 2004
Location: Austin, TEXAS
Distribution: CentOS 6.5
Posts: 207

Original Poster
Rep: Reputation: 32
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
 
Old 01-23-2004, 03:55 AM   #14
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: KirraMail Live Email Server
Posts: 1,281

Rep: Reputation: 61
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
programs making outbound connections six6 Debian 2 11-04-2004 12:04 AM
suspicious sgi_fam behavior jbeiter Linux - Security 2 09-07-2004 06:24 AM
suspicious log activity hoedad Linux - Newbie 3 07-26-2004 08:33 AM
cannot make outbound anonymous ftp connections kvankawala Linux - Software 1 03-23-2004 01:30 PM
Suspicious network traffic Config Linux - Security 9 03-09-2003 08:23 AM


All times are GMT -5. The time now is 11:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration