<?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; NGX</title>
	<atom:link href="http://yurisk.info/tag/ngx/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>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>
