LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Reading logwatch for my little Linux server (https://www.linuxquestions.org/questions/linux-security-4/reading-logwatch-for-my-little-linux-server-412940/)

Bjorkli 02-08-2006 05:39 AM

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.

Capt_Caveman 02-08-2006 10:07 AM

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.

Bjorkli 02-09-2006 04:53 AM

/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.

Capt_Caveman 02-09-2006 09:48 PM

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?

Bjorkli 02-10-2006 06:44 AM

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

Capt_Caveman 02-10-2006 12:18 PM

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".

Bjorkli 02-13-2006 02:13 AM

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.

Capt_Caveman 02-13-2006 11:50 PM

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

/sbin/iptables-save > firewall.txt


All times are GMT -5. The time now is 08:31 PM.