| Linode Forum https://forum.linode.com/ |
|
| Blocked outbound packets https://forum.linode.com/viewtopic.php?f=19&t=8638 |
Page 1 of 1 |
| Author: | theNADS [ Sun Apr 01, 2012 9:16 am ] |
| Post subject: | Blocked outbound packets |
I recently enabled outbound logging on my linode vps just to see what would happen and I am seeing lots of logs via logcheck similar to the following: System Events =-=-=-=-=-=-= Mar 31 19:50:51 vps kernel: Drop illegal outgoing pkt: IN= OUT=eth0 SRC=***.**.***.*** DST=90.212.12.241 LEN=8800 TOS=0x00 PREC=0x00 TTL=64 ID=13994 DF PROTO=TCP SPT=80 DPT=59187 WINDOW=986 RES=0x00 ACK URGP=0 The blocked outgoing packets are mainly from port 80 but some originate from port 25. My iptables rules are briefly as follows: # Open the folliwng incoming ports # iptables -A INPUT -p tcp -m tcp --dport 25 -m state --state NEW -j ACCEPT iptables -A INPUT -p tcp -m tcp --dport 80 -m state --state NEW -j ACCEPT iptables -A INPUT -p tcp -m tcp --dport 443 -m state --state NEW -j ACCEPT # # Open the folliwng outbound ports # iptables -A OUTPUT -p tcp --dport 25 -m state --state NEW -j ACCEPT iptables -A OUTPUT -p tcp --dport 53 -m state --state NEW -j ACCEPT iptables -A OUTPUT -p udp --dport 53 -m state --state NEW -j ACCEPT iptables -A OUTPUT -p tcp --dport 80 -m state --state NEW -j ACCEPT iptables -A OUTPUT -p udp --dport 123 -m state --state NEW -j ACCEPT iptables -A OUTPUT -p tcp --dport 443 -m state --state NEW -j ACCEPT # # Logging options - can produce a lot of info! # iptables -A OUTPUT -j LOG --log-prefix "Drop illegal outgoing pkt: " The Debian squeeze server has always been kept updated and has ossec on it monitoring any file changes. The server seems to run as intended and I can see some of the ip address my server is trying to send packets to connecting to my apache web server. Therefore, if this looks like normal behavior, are my iptables too strict or does this look like abnormal behavior? |
|
| Author: | hoopycat [ Sun Apr 01, 2012 10:04 am ] |
| Post subject: | |
Most likely, those are outgoing packets for incoming HTTP connections (i.e. someone is requesting a web page on your server). Since none of your rules explicitly allow outgoing packets for established connections with source port 80, it is hitting the logging rule. Good news: not a difficult fix. Starting the rules with "-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT" and "-A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT" should do the right thing. Bad news: if your web server is up, your firewall rules aren't doing anything. -P INPUT DROP and (if you dare) -P OUTPUT DROP will make them start working. Might want to allow port 22 inbound before you do that. |
|
| Author: | theNADS [ Sun Apr 01, 2012 10:23 am ] |
| Post subject: | |
I only posted a brief selection of my iptables. The full script just copied from the server is as follows: Code: ##!/bin/bash My default policy is drop everything and I use ssh on a nonstandard port restricted to my own lan ip addresses. I am no iptables expert so feel free to slap me down for anything that is not right and I will adjust as necessary. |
|
| Author: | hoopycat [ Sun Apr 01, 2012 10:05 pm ] |
| Post subject: | |
OK, that pretty much covers that. Could you paste the output of "iptables -L -n -v"? I wonder if things are going together in a weird order... |
|
| Author: | theNADS [ Mon Apr 02, 2012 7:00 am ] |
| Post subject: | |
Ok here is the output: Code: root@vps:~# iptables -L -n -v I have blanked out my ssh port and lan ip address range but they are shown correctly. It seems to match my script rules to me. Do you think I need to be concerned about the blocked outgoing packets? Let me know what you think? |
|
| Author: | theNADS [ Mon Apr 02, 2012 3:11 pm ] |
| Post subject: | |
Here is another example of a logcheck e-mail I am receiving. The ip addresses my server is trying the contact on a high port seem to be consumer broadband ip addresses. Code: This email is sent by logcheck. If you no longer wish to receive Both these ip addresses show up in my apache log as windows computers using a firefox brower --> 2.222.60.12 - - [02/Apr/2012:11:02:16 +0100] "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" & 80.176.146.14 - - [02/Apr/2012:11:43:51 +0100] "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20100101 Firefox/11.0" Does it look like my server is misbehaving? |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|