Question

CP Firewall - Delayed TCP reply - TCP packet out of state: First packet isn't SYN; tcp_flags: FIN ACK

Asked by: DesCaffreys

OK, I'll try and explain this as best I can,

Some months ago I set up an Anti-spam/Anti-virus gateway on my network.  I placed it in a DMZ.  When originally set up checkpoint was at version NG FP3.  My problem is the following;

As part of the AS/AV gateways spam detection I was trying to allow it communicate with two spamcop servers, vmx1 and vmx2.spamcop.net.  The Reporting call goes out on TCP port 587.  I also expect a reply over this connection.

I set up two security rules ;

1. my_gateway to any over any for tcp 587 accept log

when this rule failed to produce the goods I later added

2. vmx1 and vmx2.spamcop.net to my_gateway over any for any accept log

The call out to vmx1 or vmx2.spamcop.net:587 goes out, no problems.  However, subsequent replies are dropped by the firewal, for example;

vmx2.spamcop.net (tcp 587) to my_gateway (origin outbound source port) dropped ...
... reason 'TCP port out of state: first packet isn't SYN tcp_flags: FIN-ACK

OK, so I thought,

1. the call is going out
2. the reply is being sent
3. the firewall is stopping the reply

So then I thought that the session was timing out in the state table.  I then went to the customised TCP service object for port 587 and changed it from the default timeout of 3600 seconds to 7200 seconds.

No change, packets still going out and replies still being stopped.

The firewall has been upgraded to NGX R65 in the meantime and still no change.

I believe there may be a delay in the reply by necessity, hence my efforts to extend the timeout.  Is there any way I can exempt this specific type of call from the usual 'State' checks.  I'm GUESSING SmartDefence is at the core of this.

Thankfully, the AS/AV gateway performs quite well despite this because it uses other checks, but I'd like to see if it improves with these calls working, and besides, it's one of those nagging problems!

I'd love to know if anyone has come across this specific issue or indeed, something akin to it.

cheers


This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-09-16 at 19:16:43ID22832300
Tags

out

,

tcp

,

first

,

syn

,

state

Topic

Checkpoint Firewall

Participating Experts
1
Points
500
Comments
15

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. SYN/ACK not forwarded to 2nd NIC
    Hi, I have a curious problem. My box (linux) is trying to send mail to a target. Between my box and the target there is a linux box 2.2.12 with 4 NICs but (for now) _without_ any filtering rules at all (all default to ACCEPT). Only 2 NICs are up: eth0 to external net and e...
  2. SYN-ACK Communication
    I am having a problem with two particular servers sending mail to me. I have logged the network traffic and see the syn packet on port 25 just like numerous other incoming mails. Yet my server never responds with an ack to the packet. Only happenpng to two incoming ser...
  3. Upgrading Checkpoint NG to Checkpoint NGX
    Hi Expert-Exchange Members I am trying to upgrade CheckPoint NG too Checkpoint NGX. I thought it would be a case on inserting the CD and running the setup, but now I have two version of Checkpoint on on machine. Could someone explan how I would install Checkpoint NGX on the...
  4. OMA/EAS with ISA and Checkpoint NG
    We have one main Exchange 2003 SP2 with OWA on a Windows 2003 SP 1 machine. OWA is configured with CA successfully and accessible via Bluecoat SG proxy appliance. We are now trying to implement OMA and Exchange ActiveSync(EAS); however, it seems the Bluecoat device is unabl...
  5. Test SYN-ACK
    Good morning all. I need to know how to test syn-ack command to see if there is a response. The problem i have is that a printer is not working at remote site that is controlled in belguim. One of the lads from has tested it and says he is not getting a response although h...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: grimkinPosted on 2007-09-17 at 02:00:25ID: 19903600

HI,

If you can disable SD for a short time to test then that would be ideal :)

Otherwise you can:

1 run the "fw ctl chain"  to get the inand outbound chains
2 set up a "fw monitor" to capture all comms on port 587 with the "-p all" switch
3 debug in wireshark to see at which stage in the chain the packet is being dropped (see below). IF you see your packet constantly reaching only a certain step in the chain then the likelihood is that the one after it will be the culprit.

Set up Wireshark to interpret FW-1 captures:

1 Edit -> Preferences -> Protocols -> FW-1 -> tick all the boxes
2 Edit -> Preferences -> Protocols -> Ethernet -> Tick the box for "Attempt to interpret as FW-1 monitor file"

Let me know if you need more info on this,

CHeers

 

by: DesCaffreysPosted on 2007-09-17 at 09:38:09ID: 19906235

Hi grimkin,

I haven't had a chance to try this stuff yet, but i'll get to it as soon as possible.  One thing I noticed on the log viewer is that if i look at the predifined SmartDefence logs, there is no mention or these dropped calls.  Can I therefore say that smartdefence is not the culprit and we're talking about straight old fashioned stateful inspection?

Thanks

 

by: grimkinPosted on 2007-09-17 at 16:08:24ID: 19909133

Hiya, looks that way but SmartDefence is a bit of a dark horse .. it would be good to disable it just to prove that it's not responsible .. What platform are you on?I can't remember offhand but there are commands to show what is being dropped but not logged, I'll find them tomorrow.

 

by: DesCaffreysPosted on 2007-09-17 at 17:30:31ID: 19909485

Thanks again grimkin,

I'm looking for details on the use of fw monitor(I'm more of a tcpdump man myself), i'll follow that up.

By the way, the firewall is sitting on W2K Server SP4.

To complicate things, my access is via secure remote because the box is in london and i'm in ireland (via a KVM over IP which has been restricted to admin SR and specific intrenal addresses).  Therefore, I can't do anything too risky on the box which may cut my access.

Cheers

 

by: grimkinPosted on 2007-09-18 at 01:37:59ID: 19911095

To see traffic dropped but not logged:

fw ctl zdebug + drop | grep <host ip or port number>

I know this is a linux command but you can run it without the grep (tedious) or you can download a freeware port of grep for windows (dead handy).

FW monitor user guide is here: http://www.checkpoint.com/techsupport/downloads/html/ethereal/fw_monitor_rev1_01.pdf

 

by: DesCaffreysPosted on 2007-09-18 at 17:47:48ID: 19917648

grimkin,

I sorry about delays in getting back but I've been having other issues more visible to the users which have to be attended to as priority.  

Here's what I've done so far,

I captured abuot 170K packets through fw monitor,
moved inside the network and used ethereal to decode capture file,
filtered by ip and port and saved subset,
despite the expect duplicate entries, i.e. hitting outside, then DMZ, there seemed to be quite a number of packets listed in their info as either

[TCP Dup Ack] or [TCP Retransmission], somewhat worrying.

One thing that strikes me a strange is that there appears to be somewhat of a 3 to 1 pattern in the packets.  What I mean is that there appears to be instances where, for example, I get three [TCP Retransmission ] packets coming from my mail gateways internal DMZ address followed by 1 from it's external address.  Similarly, I may get 1 [TCP Retransmission] packets from the spamcop.net server to the gateways extrenal address followed by 3 to the DMZ address.  The behaviour is not 100 percent consistent, but prevalent enough to warrent attention or better explanation.

In the meantime, instead of disabling SmartDefence, as suggested, I disabled 'Drop out of state TCP packets' under 'Stateful Inspection' tab of Global properties.  Sure enough, the packets are no longer appearing in the logs as dropped but indeed accepted.  However, I'm not yet in a position to see if this has had any effect of the gateway itself.

Either way, I don't see this as a real answer. Any ideas on the greater implications of the action taken?

also for info, I was watching the logs after pushing the change and noticed that the behaviour seems to be that several calls, maybe 10 or 20, will go out to the spamcop servers, then there may be a delay of several minutes, I'd say about 5, then a torrent of replies come back.  Presumabley this is the most efficient use of bandwidth for spamcop, but just to let you know the observations.

Cheers

 

 

by: DesCaffreysPosted on 2007-09-18 at 20:23:58ID: 19918164

Just as an update, i'm starting to see spamassassin rules being triggered which I don't recall seeing before ;

1.558 received via a relay in bl.spamcop.net

I'm hoping this is confirmation that the replies are no getting in.

However, doesn't it seem a bit general to have to disable the above mentioned setting (disabling 'Drop out of state TCP packets'), just to enable this improved service.


 

by: DesCaffreysPosted on 2007-09-18 at 20:28:57ID: 19918185

My mistake,

having checked the number of times spamassassin rules have been triggered via maia mailguard, i see the above rule has been triggered some 6968 times.

Does this mean that the replies have been getting through prior to the changes and even with the dropped packets?

 

by: grimkinPosted on 2007-09-19 at 01:56:01ID: 19919052

Hi Des,

If you run the fw monitor with the "-p all" switch you will get one capture entry per step in the chain *per packet* - this will give you roughly 12-16 entries per packet in the capture log and this will account for the duplicates you can see, its actually just 1 or 2 packets.

I've just noticed that I omitted something in the wireshark setup:

Edit -> preferences -> columns -> New -> Title: FW Chain, Format: FW-1 monitor if/direction

This will give you another column in the capture and if you have set up the other settings as i explained in the first post then you should be able to see entries beside this e.g. i0,i1,i2 .. I6,I7,I8 ... o1,o2 ...O5,O6 etc etc.
This is the position of the packet in the chain as described by the output of fw ctl chain.

Here is an example of a firewall chain:
in chain (11):
      0: -7f800000 (a0973cd8) IP Options Strip (ipopt_strip)
      1: - 2000000 (a0e4cf80) vpn decrypt (vpn)
      2: - 1fffff8 (a0e50d54) l2tp inbound (l2tp)
      3: - 1fffff6 (a097488c) Stateless verifications (asm)
      4: - 1fffff0 (a0e4ca90) vpn decrypt verify (vpn_ver)
      5: - 1000000 (a098a66c) SecureXL conn sync (secxl_sync)
      6:         0 (a093eae8) fw VM inbound  (fw)
      7:   2000000 (a0e4dfe0) vpn policy inbound (vpn_pol)
      8:  10000000 (a098a800) SecureXL inbound (secxl)
      9:  7f600000 (a096f950) fw SCV inbound (scv)
      10:  7f800000 (a0973f24) IP Options Restore (ipopt_res)
out chain (9):
      0: -7f800000 (a0973cd8) IP Options Strip (ipopt_strip)
      1: - 1ffffff (a0e4c99c) vpn nat outbound (vpn_nat)
      2: - 1f00000 (a097488c) Stateless verifications (asm)
      3:         0 (a093eae8) fw VM outbound (fw)
      4:   2000000 (a0e4db70) vpn policy outbound (vpn_pol)
      5:  10000000 (a098a800) SecureXL outbound (secxl)
      6:  1ffffff0 (a0e512fc) l2tp outbound (l2tp)
      7:  20000000 (a0e4d494) vpn encrypt (vpn)
      8:  7f800000 (a0973f24) IP Options Restore (ipopt_res)

On the packet capture in Wireshark:

i = pre-inbound
I = post-inbound
o = pre-outbound
O = post outbound

When the packet is with the little "ix", this is it being checked by the kernel at stage x in the chain e.g. AV or vpn decrypt. Big Ix is after the kernel has inspected it then little "ox" is when it's being inspected as it leaves the interface again and so on.

SO .. e.g. you can see the packets (port 587) coming in but only reaching e.g. i3 and then no more entries, you can look at your fw ctl chain output:

If for example stage 3 on the inbound chain is "stateless verifications"  and stage 4 is "vpn decrypt verify" and your packet is getting no further than i3 then your packet is being dropped at stage 4, in this case "vpn decrypt verify" and you have a better idea of where to start looking.

As a side note, I also found this:

"The most common problem is asynchronous routing, meaning that the path that any given packet takes has multiple routes either inbound or outbound.  It may also happen if SmartDefense drops a packet due to a SmartDefense violation, and removes the connection from the connection table.  Once the connection has been removed from the connection table, any packet other than a syn will be dropped with a TCP packet out of state."

 

by: grimkinPosted on 2007-09-19 at 02:12:06ID: 19919113

Forgot to say: R65 is still a bit ropey in places - do you have the possibility to try this with r61 / r62? I know people who have had the out of state prob with NG and upgrading to NGX r61/62 solved the problem ..

 

by: grimkinPosted on 2007-09-28 at 06:06:02ID: 19978326

Hi Des,

Did youget any further?

 

by: DesCaffreysPosted on 2007-09-28 at 09:15:04ID: 19979796

Grimkin,

Sorry for the delay, but I've had a number of other issues arise which have been swallowing my time.

As it stands, I've effectively disabled the TCP out of state drops.  As I said the calls are now appearing in the logs as permitted, as one woold expect.  What are the implications of this action.  Does it pose a serious risk, given my limited number of externally accessible  ip addresses, (2, 1 x fw address, 1 x inbound mx).

I hope to perform more analysis with fw monitor, and will get back asap.  Thanks for your patience and continued support.

   

 

by: DesCaffreysPosted on 2007-10-28 at 12:32:56ID: 20166111

Hi Keith and grimkin,

Apologies to all.  I find myself in a position unable to follow through on Grimkins request for log analysis, due to circumstances beyond my control.

I therefore suggest, subject to your collective approval, that the question be closed.  I would however like to award the points to Grimkin for his efforts.

Please let me know if this is acceptable, and the best way to achieve this.

Thanks and once again, my apologies for this particular outcome.
 

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...