<?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; Yuri</title>
	<atom:link href="http://yurisk.info/author/Author/feed/" rel="self" type="application/rss+xml" />
	<link>http://yurisk.info</link>
	<description>Technical Blog about IT Security and Networking</description>
	<lastBuildDate>Thu, 29 Jul 2010 11:25:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Break free from the GUI dependency – checking Fortigate logs on the cli.</title>
		<link>http://yurisk.info/2010/07/15/break-free-from-the-gui-dependency-checking-fortigate-logs-on-the-cli/</link>
		<comments>http://yurisk.info/2010/07/15/break-free-from-the-gui-dependency-checking-fortigate-logs-on-the-cli/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 19:14:04 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=991</guid>
		<description><![CDATA[Fortinet are doing a lot to keep us away from the command line. And that’s ok in 95% of the cases. But sooner or later you come to meet the 5% of the bad and the ugly when you have no access to the GUI at all. Can you imagine the terror of such situation [...]]]></description>
			<content:encoded><![CDATA[<p>Fortinet are doing a lot to keep us away from the command line. And that’s ok in 95% of the cases. But sooner or later you come to meet the 5% of the bad and the ugly when you have no access to the GUI at all. Can you imagine the terror of such situation ? Fear no more – forewarned is forearmed. Just grab the Fortigate CLI Reference PDF (all in all 754 pages) , learn it by heart then return to my blog . A year has passed quickly, ah ?<br />
Now you are ready for the introduction. One late evening [ and I am sure all security/networking equipment long ago conspired with clients against us to cause troubles at abnormal/non-working hours only] one of the clients asked if I can check something. &#34;No, not something critical but STILL can you check it NOW ..? &#34; , of course ,why not ?<br />
To check something I needed access to the Fortigate logs. All good and well if it were not for the excruciatingly slow connection (in your case it may be blocked GUI management ports, out of band console access, high Fortigate CPU utilization) that made the GUI unusable. As I had not slightest inclination to turn late evening into early morning I did SSH to the machine, run <strong>&#35;show log</strong> and <strong>&#35;get log</strong> commands … and got logging  configuration settings on the firewall.  But where are the logs?<br />
Here&#58;</p>
<div class="cmd">FGT-ugly &#35; execute log display</div>
<p>Hurray ! I got lots of lines running on the terminal, only that it was traffic log and I wanted Event log, and moreover it showed only first 100 lines out of 3400 and I wanted it all. So let’s do it by steps.<br />
Step 1 – know what is served<br />
Run this first to see what you will be presented and what not&#58;</p>
<div class="cmd">FGT-ugly &#35; execute log filter  dump</div>
<div class="cmdout">category&#58; traffic     // each type of log is called category , see later<br />
device&#58; memory     // from where logs are to be read<br />
roll&#58; 0                     // archived version<br />
start-line&#58; 1            // on which line of the logs to start presenting<br />
view-lines&#58; 700      // how many lines to show</div>
<p>Step 2 – I want Event logs now !</p>
<div class="cmd">FGT-ugly&#35; execute log filter  category     //this way you can see all available logs</div>
<div class="cmdout">Available categories&#58;<br />
10&#58; application control<br />
 9&#58; dlp<br />
 6&#58; content<br />
 5&#58; spam<br />
 4&#58; ids<br />
 3&#58; webfilter<br />
 2&#58; virus<br />
 1&#58; event<br />
 0&#58; traffic</div>
<div class="cmd">FGT-ugly&#35; execute log filter  category 1  // switch to Event log </div>
<p>Left is how many lines to show at once .</p>
<div class="cmd">FGT-ugly &#35; execute log filter  view-lines </div>
<p>number    5 – 1000   /// Aha, so we can see maximum 1000 lines per go. Not a problem actually cause every time you hit &#35; execute log display  starting line is increased for the next time by the number of lines shown.<br />
To conclude it all I enabled logging in Putty through which I  connected to the firewall and run </p>
<div class="cmd">FGT-ugly&#35; execute log display</div>
<div class="cmdout">3011 logs found.<br />
1000 logs returned.<br />
1&#58; 2010-07-13 19&#58;10&#58;58 log_id=0143040704 type=event subtype=his-performance pri=information vd=&#8221;root&#8221; action=perf-stats cpu=0 mem=10 total_session=4 msg=&#8221;Performance statistics&#8221;<br />
2&#58; 2010-07-1319&#58;05&#58;58 log_id=0143040704 type=event subtype=his-performance pri=information vd=&#8221;root&#8221; action=perf-stats cpu=0 mem=10 total_session=7 msg=&#8221;Performance statistics&#8221;<br />
3&#58; 2010-07-1319&#58;01&#58;28 log_id=0104032001 type=event subtype=admin vd=root pri=information user=&#8221;admin&#8221; ui=https(21.14.127.14) action=login status=success reason=none profile=&#8221;super_admin&#8221; msg=&#8221;Administrator admin logged in successfully from https(21.14.127.14)&#8221;<br />
4&#58; 2010-07-1319&#58;00&#58;58 log_id=0143040704 type=event subtype=his-performance pri=information vd=&#8221;root&#8221; action=perf-stats cpu=0 mem=10 total_session=5 msg=&#8221;Performance statistics&#8221;<br />
5&#58; 2010-07-1318&#58;55&#58;58 log_id=0143040704 type=event subtype=his-performance pri=information vd=&#8221;root&#8221; action=perf-stats cpu=0 mem=10 total_session=8 msg=&#8221;Performance statistics&#8221;<br />
6&#58; 2010-07-1318&#58;54&#58;09 log_id=0104032003 type=event subtype=admin vd=root pri=information user=&#8221;admin&#8221; ui=https(21.14.127.14) action=logout status=success reason=timeout msg=&#8221;Administrator admin timed out on https</div>
<p>Reference of all log messages known to Fortigate firmware 4 &#58;<br />
<a href="http://docs.fortinet.com/fgt/archives/4.0/techdocs/FortiGate_Log_Message_Reference_01-400-82627-20090528.pdf"> FortiGate_Log_Message_Reference</a></p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/07/15/break-free-from-the-gui-dependency-checking-fortigate-logs-on-the-cli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MAC finder script</title>
		<link>http://yurisk.info/2010/07/02/mac-finder-script/</link>
		<comments>http://yurisk.info/2010/07/02/mac-finder-script/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 05:35:37 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Checkpoint NG/NGX]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Esafe]]></category>
		<category><![CDATA[Fortigate]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Checkpoint]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=959</guid>
		<description><![CDATA[While I don&#8217;t like going down to Layer 2 , recently I had to do it &#8211; I didn&#8217;t know IP address of the Cisco router I wanted to connect to but I had access to the Cisco router sitting in the same network. That would be pretty easy to do #show arp on this [...]]]></description>
			<content:encoded><![CDATA[<p>While I don&#8217;t like going down to Layer 2 , recently I had to do it &#8211; I didn&#8217;t know IP address of the Cisco router I wanted to connect to but I had access to the Cisco router sitting in the same network. That would be pretty easy to do #show arp on this router and then search on Google to whom belongs each MAC  if it wasn&#8217;t the subnet mask of /26. Copy pasting each entry of the ARP table into Google didn&#8217;t look like a lot of fun. So I wrote a python script that reads MAC addresses in bulk from command line and using downloaded beforehand database of MAC-vendor translations prints vendor for each MAC address. It works for &#35;show arp on CIsco,&#35;show mac-address-table on CIsco switches, &#35;arp -en  on Linux (means including Checkpoint), &#35;arp -a on Freebsd ,&#35;show arp of Junos from Juniper, &#35;get sys arp on Fortigate.<br />
Below is the script.<br />
Here&#58;<br />
<strong>mac-database.txt</strong> &#8211; file containing MAC-vendor translation in format &lt;MAC 6 hex digits as a sequence&gt; &lt;VENDOR&gt;, I used <a href="http://standards.ieee.org/regauth/oui/oui.txt"> standards.ieee.org/regauth/oui/oui.txt </a> as the source with a bit of sed, but if you want ready to use file I recommend <strong>nmap-mac-prefixes</strong> from nmap source-code distribution <a href="http://nmap.org/svn/nmap-mac-prefixes">http://nmap.org/svn/nmap-mac-prefixes</a><br />
Download script (to make sure formatting is preserved, an important thing for Python)<br />
<a href="http://yurisk.info/scripts/mac-finder.py">http://yurisk.info/scripts/mac-finder.py</a><br />Script AND mac database from nmap project &#8211; <a href="http://yurisk.info/scripts/mac.tar.gz"> http://yurisk.info/scripts/mac.tar.gz</a></p>
<div class="cmdout">
<pre>
&#35;!/usr/bin/python
&#35;This script accepts MAC addresses from the command line and
&#35;prints vendor for each mac address
&#35; Author&#58;Yuri, yurisk@yurisk.info,06.2010
import sys
import re
&#35;This function removes from MACs colon or dot and returns MAC as a sequence of HEX chars
def dotreplace(matchobj):
&nbsp;&nbsp;       if matchobj.group(0) == &#39;.&#39;&#58;
&nbsp;&nbsp;&nbsp;&nbsp;            return &#39;&#39;
&nbsp;&nbsp;       elif  matchobj.group(0) == &#39;&#58;&#39;&#58;
&nbsp;&nbsp;&nbsp;&nbsp;            return &#39;&#39;
&#35;open file with MAC addresses and vendors database,it has form xxxx &lt;Vendor&gt;
macs=open(&#39;mac-database.txt&#39;,&#39;r&#39;)
macs_lines=macs.readlines()
&#35;Read from stdinput
data = sys.stdin.readlines()
for ppp in data:
       popa=re.search(&#39;.*([a-f0-9]{4}\.[a-f0-9]{4}\.[a-f0-9]{4}).*&#39;,ppp,re.IGNORECASE)
       if popa:
             newpopa=re.sub(&#39;\.&#39;, dotreplace,popa.group(1))[0:6]
             newpopa_re=re.compile(newpopa,re.IGNORECASE)
             for mac_db in macs_lines:
                 vendor=re.search(newpopa_re,mac_db)
                 if vendor:
                    print ppp.strip(),mac_db[7:]
       popalinux = re.search(&#39;.*([a-f0-9]{2}&#58;[a-f0-9]{2}&#58;[a-f0-9]{2}&#58;[a-f0-9]{2}&#58;[a-f0-9]{2}&#58;[a-f0-9]{2}).*&#39;,ppp,re.IGNORECASE)
       if popalinux&#58;
             newpopalinux=re.sub(&#39;&#58;&#39;,dotreplace,popalinux.group(1))[0&#58;6]
             newpopalinux_re=re.compile(newpopalinux,re.IGNORECASE)
             for mac_db in macs_lines&#58;
                 vendor=re.search(newpopalinux_re,mac_db)
                 if vendor&#58;
                    print ppp.strip(),mac_db[7&#58;]

       popadash = re.search('.*([a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}).*',ppp,re.IGNORECASE)
       if popadash:
             newpopadash=re.sub('-',dotreplace,popadash.group(1))[0:6]
             newpopadash_re=re.compile(newpopadash,re.IGNORECASE)
             for mac_db in macs_lines:
                 vendor=re.search(newpopadash_re,mac_db)
                 if vendor:
                    print ppp.strip(),mac_db[7:]
</pre>
</div>
<p>Running it:</p>
<div class="cmd">
[root@darkstar ]# ./mac-finder.py</div>
<div class="cmdout">
&lt;now I copy paste output from arp -a in BSD&gt;<br />$ arp -a<br />
(10.99.99.150) at 00:50:56:95:74:72 on em0 [ethernet]<br />
 (10.99.99.254) at 00:09:0f:31:c8:24  on em0 [ethernet]<br /> &lt;Hit CTRL+D to signal the end of input&gt;<br />
 (10.99.99.150) at 00:50:56:95:74:72 on em0 [ethernet] VMware, Inc.<br />
 (10.99.99.254) at 00:09:0f:31:c8:24 on em0 [ethernet] Fortinet Inc.</div>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/07/02/mac-finder-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Visio stencils for Cisco, Juniper, Fortinet, Checkpoint, Avaya</title>
		<link>http://yurisk.info/2010/06/26/visio-stencils-for-cisco-juniper-fortinet-checkpoint-avaya/</link>
		<comments>http://yurisk.info/2010/06/26/visio-stencils-for-cisco-juniper-fortinet-checkpoint-avaya/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 12:43:25 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Checkpoint NG/NGX]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=942</guid>
		<description><![CDATA[Some links to download Visio stencils of the few most popular vendors.
Juniper
Cisco
Avaya
BlueCoat
 Fortinet
DellCheckpoint happen not to have official stencils set, only Nokia appliances stuff can be found. So someone volunteered and using icons/press releases/PowerPoint presentations done by the Checkpoint turned it into the Visio stencils&#58;
fireverse.orgIf nothing  else helps here you  can find the [...]]]></description>
			<content:encoded><![CDATA[<p>Some links to download Visio stencils of the few most popular vendors.<br />
<a href="http://www.juniper.net/us/en/products-services/icons-stencils/">Juniper</a><br />
<a href="http://www.cisco.com/en/US/products/prod_visio_icon_list.html">Cisco</a><br />
<a href="http://support.avaya.com/css/appmanager/public/support?_nfpb=true&#038;_pageLabel=WNContent_Public&#038;contentid=C20097681410857094">Avaya</a><br />
<a href="http://www.bluecoat.com/resources/productimageslogos">BlueCoat</a><br />
<a href="http://kb.fortinet.com/kb/microsites/search.do?cmd=displayKC&#038;docType=kc&#038;externalId=11091&#038;sliceId=1&#038;docTypeID=DT_KCARTICLE_1_1&#038;dialogID=7440262&#038;stateId=0%200%207442231"> Fortinet</a><br />
<a href="http://www.dell.com/content/topics/topic.aspx/global/products/pvaul/topics/en/visio?c=us&#038;l=en&#038;s=gen">Dell</a><br />Checkpoint happen not to have official stencils set, only Nokia appliances stuff can be found. So someone volunteered and using icons/press releases/PowerPoint presentations done by the Checkpoint turned it into the Visio stencils&#58;<br />
<a href="http://fireverse.org/?page_id=14">fireverse.org</a><br />If nothing  else helps here you  can find the rest&#58;<br />
<a href="http://nag.ru/projects/visio/">nag.ru/projects/visio</a></p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/06/26/visio-stencils-for-cisco-juniper-fortinet-checkpoint-avaya/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where do I download the Checkpoint Splat image</title>
		<link>http://yurisk.info/2010/06/26/where-do-i-download-the-checkpoint-splat-image/</link>
		<comments>http://yurisk.info/2010/06/26/where-do-i-download-the-checkpoint-splat-image/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 07:15:18 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Checkpoint NG/NGX]]></category>
		<category><![CDATA[Checkpoint]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=934</guid>
		<description><![CDATA[The answer is surprisingly simple – at the  Checkpoint.com . On the home page there is a link to download their products  Try Our Products   (SPLAT, SmartDefense, Endpoint). You need a free General account in UserCenter, then you fill general questions form and get a link to download the real production [...]]]></description>
			<content:encoded><![CDATA[<p>The answer is surprisingly simple – at the <a href="http://www.Checkpoint.com"> Checkpoint.com</a> . On the home page there is a link to download their products <a href="http://www.checkpoint.com/try/index.html "> Try Our Products  </a> (SPLAT, SmartDefense, Endpoint). You need a free General account in UserCenter, then you fill general questions form and get a link to download the real production image of whatever you chose to download. You get an evaluation license for 30 days at the same page , without any license upon install you get unlimited 15-days trial.</p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/06/26/where-do-i-download-the-checkpoint-splat-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>8 Things to do before opening ticket with Checkpoint</title>
		<link>http://yurisk.info/2010/06/25/things-to-do-before-opening-ticket-with-checkpoint/</link>
		<comments>http://yurisk.info/2010/06/25/things-to-do-before-opening-ticket-with-checkpoint/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 10:40:53 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Checkpoint NG/NGX]]></category>
		<category><![CDATA[Checkpoint]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=925</guid>
		<description><![CDATA[I’ve been doing Checkpoint quite a lot, actually for years now. And this inevitably involves
communicating with the Checkpoint Technical Assistance Centre (TAC) . And while
you can easily come up with impression that it is pretty bad (look around at  cpug.org for heated flames about that), my view is that a lot depends on you. [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been doing Checkpoint quite a lot, actually for years now. And this inevitably involves<br />
communicating with the Checkpoint Technical Assistance Centre (TAC) . And while<br />
you can easily come up with impression that it is pretty bad (look around at <a href="http://cpug.org"> cpug.org</a> for heated flames about that), my view is that a lot depends on you. The way you manage the ticket and interaction with the Checkpoint TAC is often more important than anything else for successful resolution of the case.<br />
To assist in that I prepared this list of things to do and have in mind before you actually call the TAC and open a case. In my experience following these simple steps will shorten the time and save you nerves substantially.<br />
<br />&nbsp;<strong>1.Understand and state the problem exactly. </strong><br />
Clearly defined problem is half the solution. The problem should be described in measurable terms not qualitative ones.<br />
Not &#34;VPN tunnels flap and fail all the time&#34; but &#34;VPN tunnel between this and this peers is coming up for 3-5 minutes then goes down for 10 minutes also communication between sites stops and I see in SmartViewTracker the following&#8230; &#34;<br />
Not &#34;If I enable URL filtering all works slow&#34; but &#34;If I enable URL filtering it takes 40 seconds to load the same page that I load in 3 secs without URL-filtering, my download rates from different sites decrease by such and such numbers and in logs I see …&#34;<br />
Screenshots of the error messages are very welcome.<br />
<br /><strong>2. &#34;…  burden of proof is on the defendant&#34; – gather all needed info even before you get asked to.</strong><br />
Have you worked in a TAC ? No ? Then let me illustrate. The answering Supporter has no slightest idea what the equipment is on your site, what  the IP addresses are, whether load-balancers/nat-devices/traffic accelerators are involved, not to mention yours being the 10th case today,  in short &#8211; he/she knows nothing about your topology, but you ,on the other hand ,having worked for years with the same set up come to think that this knowledge is a known fact to everyone. So please don’t – when approaching the TAC think of it as preparing a presentation that describes your network topology in 10 minutes to a complete stranger on the street (no need to practice this though <img src='http://yurisk.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).<br />
Topology info you will most probably need to supply&#58;<br />
 IP addresses of interfaces and routes of all the devices that are  involved in the traffic having a problem.<br />
All NAT/IPS/load balancing/acceleration tempering going on in your network .<br />
Changes in topology that were done just before the problem occurred.<br />
<br /><strong>3.	Provide Cpinfo files from all the Checkpoint devices involved.</strong><br />
Checkpoint Support engineer most probably has no access to your firewall. And still she/he has to fully understand its configuration and state. The closest to accessing the firewall thing is providing Cpinfo file. If you have a distributed Checkpoint setup do it for all devices as well.<br />
It is also advisable to make sure that all your devices have the latest Cpinfo  utility installed [sk30567]. Unfortunately regular users can’t download it from Checkpoint Usercenter you will need at least Partner account with them.<br />
<br />NOTE Regarding handing over files to the Checkpoint TAC. When you supply them Cpinfo files you provide complete information about your firewall – its rules, objects and their properties etc. Think of it as if you were giving them the one-to-one copy of the firewall. So if you have some privacy/confidentiality reservations take it into account .<br />
<br /><strong>4.	Do a packet capture that also includes the problematic traffic.</strong><br />
Should you have any sort of case demanding serious debug be prepared to attach to the case captured traffic while replicating the problem. Of course consider the load on the firewall but usually to see if there are any drops on the traffic Checkpoint will ask you to do <strong>fw monitor –o capture.cap</strong> .<br />
Supplement this capture with output of <strong>fw ctl zdebug drop > dropped.txt</strong><br />
<br /><strong>5.If opening the case through the Checkpoint website and the problem is rather urgent do a follow up call <a href="http://www.checkpoint.com/services/contact/index.html"> Contact list</a>.</strong><br />
When you open a case it is being put in the queue of all other cases waiting to be assigned to Support Engineers. It happens on FIFO basis (each severity level has its own queue I guess). So it may wait there for few good hours. In such cases and when the case justifies it you may call the TAC and ask the person (not demand) to speed up assigning your case to the Technical Engineer.  I used this procedure and usually the case was assigned to someone 15 minutes after my call.<br />
<br /><strong>6.Provide correct and most available means to contact you back.</strong> <br />
Nothing can be more disheartening for a Supporter than to get a case and then chase you for hours/days.<br />
<br /> <strong>7.	If you work for Checkpoint Partner or proudly hold CCSE/CCSE+ certs do actually some debug yourself <img src='http://yurisk.info/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</strong><br />
Working for Checkpoint Partner (as I do) in my opinion not only gives us immediate unrestricted access to the TAC but also the responsibility to do as much as possible to debug the problem ourselves (moreover it sucks to look amateurish) . I should state that I don’t always follow this advice but always try to.<br />
Make the “The NGX Advanced Technical Reference Guide (ATRG) “  [sk31221]  your night reading and you will decrease the number of open tickets by 50% guaranteed .<br />
When you do relevant debug even without being able to understand results  you save many hours of waiting for the TAC Supporter to just ask you for the very same debug and its logs.</p>
<p> <strong>8.	In case of emergency call 911 and ask for remote session.</strong><br />
In urgent cases when you experience heavy downtime be prepared and even ask for remote session with the Supporter that got your case. Checkpoint have the TeamViewer-alike  software that will allow them to connect to your workstation while it is connected to the firewall.  Also the last time I  checked  this software had no (identifiable) keyloggers/Trojans so don’t worry <img src='http://yurisk.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/06/25/things-to-do-before-opening-ticket-with-checkpoint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solaris interfaces &#8211; create assign delete</title>
		<link>http://yurisk.info/2010/06/16/solaris-interfaces-create-assign-delete/</link>
		<comments>http://yurisk.info/2010/06/16/solaris-interfaces-create-assign-delete/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 18:27:10 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=891</guid>
		<description><![CDATA[Working with interfaces in Solaris is pretty much the same as in Linux &#8211; you&#8217;ve got ifconfig, netstat,route. It looks in outputs a bit different but if you&#8217;re used to the *BSD way of things you&#8217;ll find yourself at home. So the most basic thing follows &#8211; bring interface up, assign ipv4 address, save the [...]]]></description>
			<content:encoded><![CDATA[<p>Working with interfaces in Solaris is pretty much the same as in Linux &#8211; you&#8217;ve got <strong>ifconfig, netstat,route</strong>. It looks in outputs a bit different but if you&#8217;re used to the *BSD way of things you&#8217;ll find yourself at home. So the most basic thing follows &#8211; bring interface up, assign ipv4 address, save the change to survive reboot.<br />
<strong>Plumb.</strong> First step sounds a bit strange &#8211; plumbing, but is actually very simple (no need to call for Mario) . You just plumb the interface (I talk about Ethernet-type interfaces) to the IP stack.<br />
- Interface before plumbing &#58;</p>
<div class="cmd">bash-3.00# ifconfig e1000g2</div>
<div class="cmdout">ifconfig&#58; status&#58; SIOCGLIFFLAGS&#58; e1000g2&#58; no such interface</div>
<p>Even an unplumbed interface can be seen with&#58;</p>
<div class="cmd">bash-3.00# dladm show-link</div>
<div class="cmdout">e1000g0         type: non-vlan  mtu: 1500       device&#58; e1000g0<br />
e1000g1         type&#58; non-vlan  mtu&#58; 1500       device&#58; e1000g1<br />
e1000g2         type&#58; non-vlan  mtu&#58; 1500       device&#58; e1000g2</div>
<p>- Now plumbing&#58;</p>
<div class="cmd">bash-3.00# ifconfig e1000g2 plumb<br />
bash-3.00# ifconfig e1000g2</div>
<div class="cmdout">e1000g2&#58; flags=1000842&lt;BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 4<br />
        inet 0.0.0.0 netmask 0<br />
        ether 00&#58;E0&#58;9F&#58;67&#58;98&#58;fb</div>
<p><strong> Assing IP and bring it up.</strong> This one is well known.</p>
<div class="cmd">bash-3.00# ifconfig e1000g2 inet 192.2.2.3/24 up<br />
bash-3.00# ifconfig e1000g2</div>
<div class="cmdout">e1000g2: flags=1000843&lt;UP,BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 4<br />  inet 192.2.2.3 netmask ffffff00 broadcast 192.2.2.255<br />
        ether 00&#58;E0&#58;9F&#58;67&#58;98&#58;fb</div>
<p><strong> Make this change permanent</strong><br /> So far so good. But if you do restart to the machine now it will lose its interface settings. To save them you create a text file named /etc/hostname.&lt;interface name&gt;  In my case it will be <strong>/etc/hostname.e1000g2</strong> , this alone would plumb interface on start, and now put the IP address inside it in the form &#8216;192.2.2.3/24&#8242; . That is it.</p>
<p>To see if interface is up or down as a device and its duplex/speed parameters&#58;</p>
<div class="cmd">bash-3.00# dladm show-dev</div>
<div class="cmdout">e1000g0         link: up        speed: 1000  Mbps       duplex: full<br />
e1000g1         link&#58; up        speed&#58; 1000  Mbps       duplex&#58; full<br />
e1000g2         link&#58; up        speed&#58; 1000  Mbps       duplex&#58; full</div>
<p><strong> Create/delete logical interface</strong> In Cisco world you would call it assigning secondary ip to the interface. </p>
<div class="cmd">bash-3.00# ifconfig e1000g1 addif 193.92.13.3/24</div>
<p>Created new logical interface e1000g1&#58;1</p>
<div class="cmd">bash-3.00# ifconfig e1000g1&#58;1 up</div>
<div class="cmdout">bash-3.00# ifconfig e1000g1&#58;1<br />
e1000g1:1: flags=1000843&lt;UP,BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 3 <br />
inet 193.92.13.3 netmask ffffff00 broadcast 193.92.13.255 </div>
<p>Remove logical interface&#58;</p>
<div class="cmd">bash-3.00# ifconfig e1000g1 removeif 193.92.13.3<br />
bash-3.00# ifconfig e1000g1&#58;1</div>
<div class="cmdout">ifconfig&#58; status&#58; SIOCGLIFFLAGS&#58; e1000g1&#58;1&#58; no such interface</div>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/06/16/solaris-interfaces-create-assign-delete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to choose the password that noone can guess and you cant remember</title>
		<link>http://yurisk.info/2010/06/09/how-to-choose-the-password-that-noone-can-guess-and-you-cant-remember/</link>
		<comments>http://yurisk.info/2010/06/09/how-to-choose-the-password-that-noone-can-guess-and-you-cant-remember/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 10:29:21 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=887</guid>
		<description><![CDATA[How to choose the password that noone can guess and you cant remember Of course you know what the good password should be &#8211; random letters including capitals, peppered with numbers and enhanced with printable control characters.
The only small but important detail these recommendations seem to forget is that there are may be few hundreds [...]]]></description>
			<content:encoded><![CDATA[<p>How to choose the password that noone can guess and you cant remember Of course you know what the good password should be &#8211; random letters including capitals, peppered with numbers and enhanced with printable control characters.<br />
The only small but important detail these recommendations seem to forget is that there are may be few hundreds in the world that can memorize such incomprehensible sequence of chars. So if someone does decide to follow it such passwords end up being written on the paper and stuck to the monitor (on its back).<br />
I never followed such recommendations but nevertheless found the way to come up with hard to break passwords. Here it is &#8211;  I just take easily memorizeable sentence from some verse/prose , take first letters of each word, capitalize first letter and then add some predefined number that doesn&#8217;t chnage from password to password .Example follows.<br />
This is how the 1st sentence from e.e. cummings turns into password:<br />
<strong>Anyone lived in a pretty how town -&gt; Aliapht7722</strong><br />
As I said previously these are passwords I use also for SSH user access and for the last year brute force efforts went down the drains (so far).<br />
The topic of passwords is actually a big one , and more of human psychology kind rather than crypto-randomness sort of things.<br />
For more about that look for example here&#58;<br />
<a href="http://www.schneier.com/blog/archives/2007/01/choosing_secure.html">www.schneier.com</a><br />
Another way to come up with random but easy to pronounce words for  passwords can be done with scientific approach&#58;<br />
<a href="http://www.multicians.org/thvv/gpw.html">www.multicians.org</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/06/09/how-to-choose-the-password-that-noone-can-guess-and-you-cant-remember/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top 10 usernames used in SSH brute force</title>
		<link>http://yurisk.info/2010/06/04/top-10-usernames-used-in-ssh-brute-force/</link>
		<comments>http://yurisk.info/2010/06/04/top-10-usernames-used-in-ssh-brute-force/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 09:08:23 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Awk weekly]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=874</guid>
		<description><![CDATA[In continuation to yesterday&#8217;s post I thought it would be interesting to know statistics of the usernames used in those bruteforce probes. I thought and I did . Find below awk/sed script to get usernames for failed ssh login attempts and sort it for statistics and also list of the usernames I got from my [...]]]></description>
			<content:encoded><![CDATA[<p>In continuation to yesterday&#8217;s post I thought it would be interesting to know statistics of the usernames used in those bruteforce probes. I thought and I did . Find below awk/sed script to get usernames for failed ssh login attempts and sort it for statistics and also list of the usernames I got from my server. The full list of usernames can be found at the end.<br />
The script&#58;</p>
<div class="cmd"> awk   &#39;/Failed password for/  &#39;  /var/log/secure*  | sed  &#39;s/.* \([[:print:]]\+\) from .*/  \1  /g &#39; | sort | uniq &#45;c | sort &#45;n &#45;k1</div>
<p>And the winners are&#58;</p>
<table summary="The table listing top 10 usernames used in real cracking attampts on SSH service">
<caption>The table listing top 10 usernames used in real cracking attampts on SSH service</caption>
<tr class="thcolor">
<th>Username</th>
<th>Number of times seen</th>
</tr>
<tr>
<td>mysql</td>
<td>232</td>
</tr>
<tr class="cellcolor">
<td>info</td>
<td>252</td>
</tr>
<tr>
<td>postgres</td>
<td>317</td>
</tr>
<tr class="cellcolor">
<td>guest</td>
<td>435</td>
</tr>
<tr>
<td>nagios</td>
<td>452</td>
</tr>
<tr class="cellcolor">
<td>user</td>
<td> 459</td>
</tr>
<tr>
<td>oracle</td>
<td>598</td>
</tr>
<tr class="cellcolor">
<td>admin</td>
<td> 884</td>
</tr>
<tr>
<td>test</td>
<td>1017</td>
</tr>
<tr class="cellcolor">
<td>root</td>
<td>22058</td>
</tr>
</table>
<p>Full list of the usernames <a href="http://yurisk.info/usernames.log">Usernames.log</a></p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/06/04/top-10-usernames-used-in-ssh-brute-force/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SSH brute force is on the rise</title>
		<link>http://yurisk.info/2010/06/03/ssh-brute-force-on-the-rise/</link>
		<comments>http://yurisk.info/2010/06/03/ssh-brute-force-on-the-rise/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 19:31:43 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Awk weekly]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=865</guid>
		<description><![CDATA[SSH brute forcing is still in high demand. I have , for my own testing and pleasure, virtual servers scattered around the world. All of them being of the Linux/BSD family  I manage by SSH. The other quirk of mine is that I have on purpose no static IP at home for various reasons [...]]]></description>
			<content:encoded><![CDATA[<p>SSH brute forcing is still in high demand. I have , for my own testing and pleasure, virtual servers scattered around the world. All of them being of the Linux/BSD family  I manage by SSH. The other quirk of mine is that I have on purpose no static IP at home for various reasons (saving  me money being one of them). And to manage those servers by SSH I implement a very simple security rule – from Any to SSH port allow. Port is left to be standard one – 22. After all that time my server was broken into just once , when I gave access by SSH to the colleague of mine and later he changed the password to something crackable in 5 secs. Since then I  &#8211; first don’t give ssh access to colleagues <img src='http://yurisk.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , and second &#8211; look from time to time at ssh failed attempts logs for amusement.<br />	<br />
My observations so far are &#58;<br />
 &#8211; ssh brute forcing is still/yet/again extremely popular and increasing . On average after unfirewalled access to port 22 is discovered it goes to ~ 5000-6000 attempts per day .<br />
 &#8211; crackers do have some means of communicating between them (market economy ?) – my servers have static IPs and first days after its set up brute force login attempts are as low as 2-10 a day. But once the server IP has been discovered by determined crackers it goes up in numbers very quickly.<br />
 &#8211; origins of the attacks correlate pretty well with the known sources of Spam/Malware &#58; Brazil, China, US etc.<br />
If you’d like to look at your SSH logs and do some stats on failed attempts here is the awk one-liner I use. Enjoy.</p>
<div class="cmd">
awk &#45;&#45;re-interval &#39;/authentication failure/ {}<br />
/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]/ {match($0,/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]/,IP);  IPS[IP[0]]++ } END { for (cracker_ips in IPS) print cracker_ips &#34;  &#34; IPS[cracker_ips]}&#39; /var/log/secure.1 | sort -n -k2 </div>
<div class="cmdout">
190.202.85.3  1<br />
194.192.14.7  1<br />
212.111.199.3  1<br />
222.124.195.1  1<br />
210.71.71.1  2<br />
89.138.195.1  5<br />
212.156.65.7  25<br />
202.117.51.2  32<br />
210.51.48.7  32<br />
115.146.138.5  47<br />
60.191.98.5  88<br />
174.120.208.5  107<br />
61.129.60.2  165<br />
202.103.180.4  175<br />
213.251.192.2  239<br />
91.82.101.4  242<br />
220.173.60.6  264<br />
12.11.210.3  271<br />
144.16.72.1  291<br />
212.118.5.1  360<br />
66.11.122.1  384<br />
211.160.160.1  703<br />
190.12.66.1  999<br />
83.19.184.3  1176<br />
67.213.8.2  4955<br />
199.187.120.2  5312<br />
95.0.180.2  6680<br />
85.131.163.5  7685
</div>
<p>NB Crackers IPs are not sanitized</p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/06/03/ssh-brute-force-on-the-rise/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Change IP address on the interface without losing the connection</title>
		<link>http://yurisk.info/2010/06/02/change-ip-address-on-the-interface-without-losing-the-connection/</link>
		<comments>http://yurisk.info/2010/06/02/change-ip-address-on-the-interface-without-losing-the-connection/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 17:22:59 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Checkpoint NG/NGX]]></category>
		<category><![CDATA[Checkpoint]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=848</guid>
		<description><![CDATA[I happen from time to time to configure from scratch some Checkpoint UTM/Open Server  that is thousand miles away. And from experience the best way to do it is when you have out-of-band fast access to the firewall. Of course not always such well-organized beforehand set up is available. Just like today when I [...]]]></description>
			<content:encoded><![CDATA[<p>I happen from time to time to configure from scratch some Checkpoint UTM/Open Server  that is thousand miles away. And from experience the best way to do it is when you have out-of-band fast access to the firewall. Of course not always such well-organized beforehand set up is available. Just like today when I was asked how to change IP address on the interfcae through which you are connected to the firewall.<br />
Ok, to be more specific &#8211; client had been connected with his UTM through some ISP that included also IP addresses on the WAN (External) interface of the firewall. Time has come to change ISP and accordingly its IP addresses.<br />
All went surprisingly well, my collegue added new IP address on the External interface as the Secondary IP and from then on he could access/manage firewall through this new IP without a hitch. There is one but though &#8211; SSL VPN service was still listening on the old IP and didn&#8217;t work because of that. So we had to remove the new IP as Secondary and put it as the Primary one. For this he asked  my opinion , I set up some improvised lab and here is how to do it .<br />
<br />1) First, for unmanned location I set up in cron to do restart in say 10-15 minutes from now so if something goes wrong restart will discard any changes done in step 2;</p>
<div class="cmdout">
[Expert@R71]# crontab -l<br />
# DO NOT EDIT THIS FILE &#8211; edit the master and reinstall.<br />
# (/tmp/crontab.5649 installed on Wed Jun  2 11:25:53 2010)<br />
# (Cron version &#8212; $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)<br />
27 11 * * * /sbin/reboot</div>
<p>2) Connected through the ssh I did the following two commands on the same line that when finished should not even disconnect you from the ssh. It brings down secondary IP (aliased interface) and assigns this IP to the External interface as the usual Primary one.</p>
<div class="cmd">
ifconfig External:0 down ; ifconfig External 192.168.2.22 netmask 255.255.255.0</div>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/06/02/change-ip-address-on-the-interface-without-losing-the-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
