<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>yurisk.info &#187; Firewall</title>
	<atom:link href="http://yurisk.info/tag/firewall/feed/" rel="self" type="application/rss+xml" />
	<link>http://yurisk.info</link>
	<description>Technical Blog about IT Security and Networking</description>
	<lastBuildDate>Tue, 07 Sep 2010 12:42:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Don&#039;t rely on SmartViewTracker only &#8211; it may lie</title>
		<link>http://yurisk.info/2009/06/20/185/</link>
		<comments>http://yurisk.info/2009/06/20/185/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 14:11:05 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Checkpoint NG/NGX]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Checkpoint]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=185</guid>
		<description><![CDATA[Funny case of WYSIWYG misleading the uninitiated. The case involved a seemingly normally functioning firewall Checkpoint which after a client created rule to allow FTP from any to his server in DMZ (no Nat involved) refused to allow connections though. The client being quite experienced himself entered SmartViewTracker did filter on the rule (here rule [...]]]></description>
			<content:encoded><![CDATA[<p>Funny case of WYSIWYG misleading the uninitiated. The case involved a seemingly normally functioning firewall Checkpoint which after a client created rule to allow FTP from any to his server in DMZ (no Nat involved) refused to allow connections though. The client being quite experienced himself entered SmartViewTracker did filter on the rule (here rule 77) and saw nothing (of course Log was enabled on the rule) . OK, he thought, he canceled the filter and also started looking on the clean up rule that said Any -&gt; Any = Drop (log enabled)  and &#8230;  again saw no hits at all. And at this stage he approached us with<br />
request to  check Linkproof leading to this firewall as  &#8221; it doesnt pass traffic to my FTP server&#8221;.<br />
I did a usual thing &#8211; ssh -&gt; fw monitor on FTP server IP and , hurra, saw<br />
me reaching FTP server IP but on input interface only &#8211; &#8220;Aha, dropped by a rule<br />
for sure&#8221; , then it took me another minute to prove it (to me and to the client)<br />
with this:</p>
<p>Here:<br />
   194.99.73.13   &#8211; FTP server in DMZ (IP sanitazed of course)<br />
   124.92.11.33    &#8211; my IP</p>
<p>[Expert@firewall2070]# <strong>fw ctl zdebug drop | grep 194.99.73.13  </strong><br />
fw_log_drop: Packet proto=6 124.92.11.33:53408 -&gt; 194.99.73.13:21 dropped by fwhold_expires Reason: held chain expired<br />
fw_log_drop: Packet proto=6 124.92.11.33:53408 -&gt; 194.99.73.13:21 dropped by<br />
 fw_handle_first_packet Reason: Rulebase drop &#8211; rule 77</p>
<p>To remind &#8211; rule 77 was Any -&gt; 194.99.73.13 (Service FTP) = Allow (log)</p>
<p>Why rule didn&#8217;t work is another question &#8211; but reason was messed up rulebase that cleint did, when further<br />
down the rulebase was another rule to the same server partly overlapping this rule, the moment I disabled<br />
second rule all started to work.</p>
<p>So conclusion &#8211; don&#8217;t rely on the SmartviewTracker only for debug , there can be too many<br />
reasons why it is not logging/showing logs as should.</p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2009/06/20/185/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH session timeout in Checkpoint NG/NGX</title>
		<link>http://yurisk.info/2008/09/15/ssh-session-timeout-in-checkpoint-ngngx/</link>
		<comments>http://yurisk.info/2008/09/15/ssh-session-timeout-in-checkpoint-ngngx/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 18:20:11 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Checkpoint NG/NGX]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Checkpoint]]></category>

		<guid isPermaLink="false">http://yurisk.wordpress.com/?p=21</guid>
		<description><![CDATA[Ever got swearing when in the middle of fw monitor / debug session you got abruptly thrown on session timeout ??  Me too. While thinking naively ssh timeout is managed by sshd/ssh configs I was suprised to know CP did it their way. Turned out here we get definitions for interactive session : cat /etc/bashrc &#60;CUT&#62;    [...]]]></description>
			<content:encoded><![CDATA[<p>Ever got swearing when in the middle of fw monitor / debug session you got abruptly thrown on session timeout ??  Me too. While thinking naively ssh timeout is managed by sshd/ssh configs I was suprised to know CP did it their way.</p>
<p>Turned out here we get definitions for interactive session : <strong>cat /etc/bashrc</strong><br />
&lt;CUT&gt;   </p>
<p># By default, log out the user after three minutes of unattended prompt<br />
<strong>export TMOUT=180</strong><br />
export SHELL=/bin/bash<br />
# Take into account idle setting of cpshell, if available<br />
if [ -f /etc/cpshell/cpshell.state ]; then<br />
   idle=`grep idle /etc/cpshell/cpshell.state | sed s/idle=//`<br />
   if [ $idle"UNDEFINED" = "UNDEFINED" ]; then<br />
          idle=3<br />
   fi<br />
  <strong> export TMOUT=`expr $idle \* 60`</strong><br />
fi</p>
<p> </p>
<p>So to change the default timeout for ssh session you can:</p>
<p>1) Set idle variable in /etc/cpshell/cpshell.state to be later multiplied</p>
<p>cat /etc/cpshell/cpshell.state<br />
audit=100<br />
idle=100<br />
scroll=1</p>
<p>2) Change last <strong>export</strong> directly to whatever you wish:</p>
<p><strong>export TMOUT=7000  ;</strong> in seconds</p>
<p>I personally when working on client&#8217;s firewall am setting it manually  when long  debug session is expected:</p>
<p><strong>[Expert@cp]# TMOUT=700<br />
[Expert@cp]# export TMOUT<br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2008/09/15/ssh-session-timeout-in-checkpoint-ngngx/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Telnet from inside Checkpoint firewall</title>
		<link>http://yurisk.info/2008/09/10/telnet-from-inside-checkpoint-firewall/</link>
		<comments>http://yurisk.info/2008/09/10/telnet-from-inside-checkpoint-firewall/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 08:00:30 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Checkpoint NG/NGX]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Checkpoint]]></category>
		<category><![CDATA[NGX]]></category>

		<guid isPermaLink="false">http://yurisk.wordpress.com/?p=14</guid>
		<description><![CDATA[Yesterday I saw a strange problem &#8211; connection from outside to Exchange in a LAN times out, while in Tracker all connections to port 25 are in green. Strange was that through VPN client-to-site and from inside LAN all worked prefectly well. So I wasn&#8217;t sure 100% it wasn&#8217;t a firewall causing this. The next [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I saw a strange problem &#8211; connection from outside to Exchange in a LAN times out, while in Tracker all connections to port 25 are in green. Strange was that through VPN client-to-site and from inside LAN all worked prefectly well. So I wasn&#8217;t sure 100% it wasn&#8217;t a firewall causing this. The next best way to check it would be telnet from inside NGX (R65 in this case) to port 25 to Exchange by its LAN IP &#8230; only that Checkpoint don&#8217;t have telnet client included in their Splat . If I had enough time I&#8217;d compile telnet client statically on some Linux box with the same kernel/libraries then&#8217;d copy it to NGX for testing, but to do it ASAP I hacked a small AWK script that emulates (just enough fo ra test) telnet, below these scripts .</p>
<p>BTW this script made it 100% clear there was some problem with Exchange over which I had no control &#8211; from firewall its port 25 answered very erratically &#8211; once ok , 10 times connection refused. So after a double check</p>
<p>client found that from LAN and VPN it also wasn&#8217;t stable as he first thought .</p>
<p> </p>
<p>General telnet client script :</p>
<p><strong>[Expert@cp]# awk -v ip=192.168.0.1 -v port=25 -f telnet.awk</strong></p>
<p>Where:</p>
<p>  <strong>ip </strong>- IP to connect to</p>
<p>  <strong>port</strong> &#8211; port to connect to</p>
<p>#!/usr/bin/awk<br />
#This is a simple telnet emulation script purpose of which<br />
# is to try to connect to a given IP on a given port using TCP<br />
# and print to the terminal few lines received from the server<br />
# if session is established. It has no functionality but to<br />
# establish a TCP connection and print out received text from the<br />
# server, after that it just exits.It was created to debug<br />
# connectivity issues on Checkpoint NGX firewall that has no built<br />
# in telnet client .<br />
# Client<br />
     BEGIN {<br />
       (&#8220;/inet/tcp/0/&#8221; ip &#8220;/&#8221; port ) |&amp; getline<br />
       print $0<br />
       close((&#8220;/inet/tcp/0/&#8221; ip &#8220;/&#8221; port ))<br />
     }</p>
<p>Next is the same cript with add on for port 80 &#8211; to get some response from web server:</p>
<p>#!/usr/bin/awk<br />
     BEGIN {<br />
   Portandip = (&#8220;/inet/tcp/0/&#8221; ip &#8220;/&#8221; port )<br />
   print &#8220;GET /  HTTP/1.1\n\n&#8221; |&amp; Portandip<br />
   while  ( ((&#8220;/inet/tcp/0/&#8221; ip &#8220;/&#8221; port ) |&amp; getline)&gt;0)<br />
       print $0<br />
       close((&#8220;/inet/tcp/0/&#8221; ip &#8220;/&#8221; port ))<br />
     }</p>
<p> </p>
<p><strong></strong></p>
<p><strong>PS Thanks to Aibulat</strong> (see comments) for info, turns out there is a telnet client available on Splat cd-rom .It is just not installed by default when installing Splat.</p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2008/09/10/telnet-from-inside-checkpoint-firewall/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
