LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-08-2006, 05:39 AM   #1
Bjorkli
Member
 
Registered: Jul 2003
Location: Norway
Posts: 65

Rep: Reputation: 15
Reading logwatch for my little Linux server


I usually go through the logwatch e-mail every day, usually just to see if the brute force SSH attempts have startet to guess the allowed usernamed (so far they haven't), and who uses the email server (usually just my family). But today I got this on top:

Quote:
--------------------- Kernel Begin ------------------------

Logged 535 packets on interface eth0
From 72.3.241.114 - 6 packets
To 192.168.1.103 - 6 packets
Service: 40344 (tcp/40344) (,eth0,none) - 6 packets
From 72.5.148.2 - 3 packets
To 192.168.1.103 - 3 packets
Service: 36213 (tcp/36213) (,eth0,none) - 3 packets
From 72.21.45.194 - 381 packets
To 192.168.1.103 - 381 packets
Service: 37643 (tcp/37643) (,eth0,none) - 1 packet
Service: 37768 (tcp/37768) (,eth0,none) - 10 packets
Service: 37769 (tcp/37769) (,eth0,none) - 10 packets
Service: 37789 (tcp/37789) (,eth0,none) - 3 packets
Service: 37794 (tcp/37794) (,eth0,none) - 6 packets
Service: 37795 (tcp/37795) (,eth0,none) - 6 packets
Service: 37796 (tcp/37796) (,eth0,none) - 6 packets
Service: 37797 (tcp/37797) (,eth0,none) - 12 packets
Service: 37798 (tcp/37798) (,eth0,none) - 12 packets
Service: 37929 (tcp/37929) (,eth0,none) - 12 packets
Service: 37930 (tcp/37930) (,eth0,none) - 12 packets
Service: 38027 (tcp/38027) (,eth0,none) - 12 packets
Service: 38028 (tcp/38028) (,eth0,none) - 12 packets
Service: 38129 (tcp/38129) (,eth0,none) - 12 packets
Service: 38130 (tcp/38130) (,eth0,none) - 12 packets
Service: 38223 (tcp/38223) (,eth0,none) - 12 packets
Service: 38224 (tcp/38224) (,eth0,none) - 12 packets
Service: 38321 (tcp/38321) (,eth0,none) - 12 packets
Service: 38322 (tcp/38322) (,eth0,none) - 12 packets
Service: 38422 (tcp/38422) (,eth0,none) - 12 packets
Service: 38423 (tcp/38423) (,eth0,none) - 12 packets
Service: 38536 (tcp/38536) (,eth0,none) - 12 packets
Service: 38537 (tcp/38537) (,eth0,none) - 12 packets
Service: 38637 (tcp/38637) (,eth0,none) - 12 packets
Service: 38638 (tcp/38638) (,eth0,none) - 12 packets
Service: 38741 (tcp/38741) (,eth0,none) - 12 packets
Service: 38742 (tcp/38742) (,eth0,none) - 10 packets
Service: 38842 (tcp/38842) (,eth0,none) - 12 packets
Service: 38843 (tcp/38843) (,eth0,none) - 12 packets
Service: 38947 (tcp/38947) (,eth0,none) - 12 packets
Service: 38948 (tcp/38948) (,eth0,none) - 12 packets
Service: 39048 (tcp/39048) (,eth0,none) - 12 packets
Service: 39049 (tcp/39049) (,eth0,none) - 12 packets
Service: 39189 (tcp/39189) (,eth0,none) - 12 packets
Service: 39190 (tcp/39190) (,eth0,none) - 12 packets
Service: 39307 (tcp/39307) (,eth0,none) - 5 packets
From 72.36.168.243 - 16 packets
To 192.168.1.103 - 16 packets
Service: 37047 (tcp/37047) (,eth0,none) - 16 packets
From 72.37.157.36 - 74 packets
To 192.168.1.103 - 74 packets
Service: 39149 (tcp/39149) (,eth0,none) - 3 packets
Service: 39162 (tcp/39162) (,eth0,none) - 5 packets
Service: 39181 (tcp/39181) (,eth0,none) - 4 packets
Service: 39213 (tcp/39213) (,eth0,none) - 4 packets
Service: 39365 (tcp/39365) (,eth0,none) - 6 packets
Service: 39374 (tcp/39374) (,eth0,none) - 6 packets
Service: 39381 (tcp/39381) (,eth0,none) - 6 packets
Service: 39396 (tcp/39396) (,eth0,none) - 6 packets
Service: 39426 (tcp/39426) (,eth0,none) - 3 packets
Service: 39445 (tcp/39445) (,eth0,none) - 8 packets
Service: 39790 (tcp/39790) (,eth0,none) - 6 packets
Service: 39795 (tcp/39795) (,eth0,none) - 7 packets
Service: 39811 (tcp/39811) (,eth0,none) - 4 packets
Service: 39829 (tcp/39829) (,eth0,none) - 6 packets
From 72.232.30.34 - 3 packets
To 192.168.1.103 - 3 packets
Service: 36217 (tcp/36217) (,eth0,none) - 3 packets
From 192.168.1.100 - 51 packets
To 192.168.1.255 - 51 packets
Service: netbios-ns (udp/137) (,eth0,none) - 51 packets
From 192.168.1.103 - 1 packet
To 81.191.59.159 - 1 packet
Service: ingreslock (tcp/1524) (,none,eth0) - 1 packet

---------------------- Kernel End -------------------------
But I am not sure if I should worry or not. I saw the word netbios-ns in the list above, and instantly thought about netbios attacks (I have heard of em, but know very little else about em), and started to wonder what service 36217 etc was. I can't remember ever installing any service that could be useful for Layered Technologies in Dallas / Texas. I just dobblechecked the firewall too. Only had 8 ports open for web, mail and amule.

Redhat has been on that list before (usually starts something at 4 am each night, but thought it might have been daily yum or something (got Fedora 1 installed), so I have not worried about this top section of the logwatch (mostly because I have no clue how to read it).

But should I worry about above? Any tips what I should look for in this list, when looking for compromise of security?

Hope u can help.
 
Old 02-08-2006, 10:07 AM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Do you have any log rules in you're firewall? Is the log martians or rp_filter set to "1" ? (check /proc/sys/net/ipv4/conf/default/)

Also remember that logwatch simply provides summaries of the notable events. Check the normal system logs for the full entries (for Redhat-ish systems this will be /var/log/messages and /var/log/secure). Post any that aren't clear.
 
Old 02-09-2006, 04:53 AM   #3
Bjorkli
Member
 
Registered: Jul 2003
Location: Norway
Posts: 65

Original Poster
Rep: Reputation: 15
/proc/sys/net/ipv4/conf/default/rp_filter is 1
/proc/sys/net/ipv4/conf/default/log_martians is 0 (martians...?)

cat /var/log/messages | grep 72.21.45.194 gives (3 out of many entries)
Quote:
Feb 7 04:07:16 linux kernel: IN=eth0 OUT= MAC=00:0d:56:57:23:45:00:04:ed:05:0f:19:08:00 SRC=72.21.45.194 DST=192.168.1.103 LEN=44 TOS=0x00 PREC=0x00 TTL=42 ID=0 DF PROTO=TCP SPT=80 DPT=39190 WINDOW=5840 RES=0x00 ACK SYN URGP=0
Feb 7 04:09:02 linux kernel: IN=eth0 OUT= MAC=00:0d:56:57:23:45:00:04:ed:05:0f:19:08:00 SRC=72.21.45.194 DST=192.168.1.103 LEN=44 TOS=0x00 PREC=0x00 TTL=42 ID=0 DF PROTO=TCP SPT=80 DPT=39307 WINDOW=5840 RES=0x00 ACK SYN URGP=0
Feb 7 04:09:23 linux kernel: IN=eth0 OUT= MAC=00:0d:56:57:23:45:00:04:ed:05:0f:19:08:00 SRC=72.21.45.194 DST=192.168.1.103 LEN=44 TOS=0x00 PREC=0x00 TTL=42 ID=0 DF PROTO=TCP SPT=80 DPT=39307 WINDOW=5840 RES=0x00 ACK SYN URGP=0
Feb 7 04:10:35 linux kernel: IN=eth0 OUT= MAC=00:0d:56:57:23:45:00:04:ed:05:0f:19:08:00 SRC=72.21.45.194 DST=192.168.1.103 LEN=44 TOS=0x00 PREC=0x00 TTL=42 ID=0 DF PROTO=TCP SPT=80 DPT=39307 WINDOW=5840 RES=0x00 ACK SYN URGP=0
and secure did not log anything for that timespan.

Problem is I am to green to make anything sensible out of the above. My best bet i that some Texan search engine indexed my webpages.
 
Old 02-09-2006, 09:48 PM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Quote:
Originally Posted by Bjorkli
My best bet i that some Texan search engine indexed my webpages.
I don't believe so. The traffic is inbound with a source port of 80, which would suggest either it's a reply from some webserver you were contacting (there is an Apache server running on that IP) or it's a scan of some type (many poorly constructed firewalls will blindly allow all traffic with a source of 80 to allow outgoing web access). Layered Technologies (Layer3) is a general hosting and ISP, so any IPs in that netblock could be residential users as well.

Could you describe your network layout and which IPs belong to which hosts? Also what type of firewall are you using?
 
Old 02-10-2006, 06:44 AM   #5
Bjorkli
Member
 
Registered: Jul 2003
Location: Norway
Posts: 65

Original Poster
Rep: Reputation: 15
Got a very simple layout. ADSL modem (192.168.1.254), Windows machine .100, Linux 3 server 192.168.1.102 and Linux 2 server 192.168.1.103 (Which is where this log is taken from. The webserver at port 80 is Apache 1.3.28.)

I use the default iptables firewall, but it has been configured using webmin and firestarter, and /etc/sysconfig/iptables looks like this:
Quote:
# Firewall configuration written by redhat-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
 
Old 02-10-2006, 12:18 PM   #6
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Quote:
Originally Posted by Bjorkli
Got a very simple layout. ADSL modem (192.168.1.254), Windows machine .100, Linux 3 server 192.168.1.102 and Linux 2 server 192.168.1.103 (Which is where this log is taken from. The webserver at port 80 is Apache 1.3.28.)
But how are they connected together? Is one of those systems acting as a router or are all 3 plugged into the ADSL modem somehow?

I use the default iptables firewall, but it has been configured using webmin and firestarter
In that case it's likely that the firewall is different from what's in /etc/sysconfig/iptables. Could you post the output of /sbin/iptables-save > firewall and post the contents of "firewall".
 
Old 02-13-2006, 02:13 AM   #7
Bjorkli
Member
 
Registered: Jul 2003
Location: Norway
Posts: 65

Original Poster
Rep: Reputation: 15
Ah. The ADSL modem is actually a combined box having 4 ethernet ports, wireless, firewall all inn the same box . All machines are connected directly up to the box using ethernet ports. Then I use the adsl modem / router / wireless / firewall webpage settings to redirect ports. For example, Port 80 and 22 goes to the Linux 2 machine, port 2222 to the Linux 3 machine, port 21 (ftp) goes to Windows machine and so forth.

I have an older version of this ADSL modem.
 
Old 02-13-2006, 11:50 PM   #8
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Ok that makes more sense, could you post the content of firewall.txt after doing this:

/sbin/iptables-save > firewall.txt
 
  


Reply



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
linux dedicated server problem reading all .pk3 files rronald Linux - Games 0 01-07-2006 04:57 PM
Linux reading carlosinfl Linux - General 1 01-28-2005 01:01 AM
Reading mail from Exchange server gbrewste Linux - Software 1 06-19-2004 02:45 PM
Error reading WWW server response (HTTP Header)?? cuboctahedron Linux - Newbie 7 02-20-2003 04:10 AM
reading mails from MS exchange server shoot2kill Linux - General 2 04-11-2002 01:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:49 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
Open Source Consulting | Domain Registration