<?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; Fortigate</title>
	<atom:link href="http://yurisk.info/tag/fortigate/feed/" rel="self" type="application/rss+xml" />
	<link>http://yurisk.info</link>
	<description>Yuri Slobodyanyuk&#039;s blog on IT Security and Networking</description>
	<lastBuildDate>Mon, 16 Apr 2012 17:23:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Finally GEO location blocking has arrived to Fortigate</title>
		<link>http://yurisk.info/2012/02/09/finally-geo-location-blocking-has-arrived-to-fortigate/</link>
		<comments>http://yurisk.info/2012/02/09/finally-geo-location-blocking-has-arrived-to-fortigate/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 18:35:47 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=1810</guid>
		<description><![CDATA[It was predictable thing for Fortinet to do as everyone else has already been doing so. I haven’t verified myself but according to the informed source (can only say his name &#8211; Hen) they are using Maxmind database . So let’s see how to do it . First you create in New Address dialog window [...]]]></description>
			<content:encoded><![CDATA[<p>It was predictable thing for Fortinet to do as everyone else has already been doing so.<br />
I haven’t verified myself but according to the informed source (can only say his name &#8211; Hen) they are using<br />
<a "href=http://www.maxmind.com/"> Maxmind database</a> . So let’s see how to do it .<br />
First you create in New Address dialog window the Geography type object specifying the country. As you can only pick one country per address use Address Groups to combine few countries together.<br />
After creating such Address object you can use it in Firewall Policy just as you would the usual Address.<br />
Personal Note: While there is an ongoing fuss/hysteria about the cyberwar being waged that started 2 weeks ago when Saudi “hackers” DDOS’ed few Israel websites, from what I see in the field it is more of a FUD campaign, one of the byproducts of which is rush of many website owners in Israel to block Saudi Arabia IPs (or any Arabic world IPs for that matter). What happened in fact was that most of DDOS came from anywhere but Arab world (Russia, China,US) , from botnets-for-hire.<br />
The only reason I can think of why you would use Geo location block is to lower noise/size of logs by silently dropping traffic from unwanted countries.<br />

<a href='http://yurisk.info/2012/02/09/finally-geo-location-blocking-has-arrived-to-fortigate/fortigate_geolocation1/' title='Fortigate_geolocation1'><img width="150" height="150" src="http://yurisk.info/wp-content/uploads/2012/02/Fortigate_geolocation1-150x150.png" class="attachment-thumbnail" alt="Fortigate_geolocation1" title="Fortigate_geolocation1" /></a>
<a href='http://yurisk.info/2012/02/09/finally-geo-location-blocking-has-arrived-to-fortigate/fortigate_geolocation2/' title='Fortigate_geolocation2'><img width="150" height="150" src="http://yurisk.info/wp-content/uploads/2012/02/Fortigate_geolocation2-150x150.png" class="attachment-thumbnail" alt="Fortigate_geolocation2" title="Fortigate_geolocation2" /></a>
<a href='http://yurisk.info/2012/02/09/finally-geo-location-blocking-has-arrived-to-fortigate/fortigate_geolocation3/' title='Fortigate_geolocation3'><img width="150" height="150" src="http://yurisk.info/wp-content/uploads/2012/02/Fortigate_geolocation3-150x150.png" class="attachment-thumbnail" alt="Fortigate_geolocation3" title="Fortigate_geolocation3" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2012/02/09/finally-geo-location-blocking-has-arrived-to-fortigate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert Fortigate  diagnose sniffer packet output into tcpdump format understood by Wireshark</title>
		<link>http://yurisk.info/2012/02/06/convert-fortigate-diagnose-sniffer-packet-output-into-tcpdump-format-understood-by-wireshark/</link>
		<comments>http://yurisk.info/2012/02/06/convert-fortigate-diagnose-sniffer-packet-output-into-tcpdump-format-understood-by-wireshark/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 18:06:31 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=1803</guid>
		<description><![CDATA[Running diagnose sniffer packet on Fortinet Fortigate unit outputs human-readable packet information and packet data . Only that sometimes you would like to have the traffic sniffed at Fortigate in Wireshark-readable format so that it can be analyzed by all powerful Wireshark. For this case Fortinet came up with the script and application that takes [...]]]></description>
			<content:encoded><![CDATA[<p>Running <strong> diagnose sniffer packet</strong> on Fortinet Fortigate unit outputs human-readable packet information and packet data . Only that sometimes you would like to have the traffic sniffed at Fortigate in Wireshark-readable format so that it can be analyzed by all powerful Wireshark.<br />
For this case Fortinet came up with the script and application that takes text output of this sniffer command and parses it into tcpdump format (.cap) which you can later open in Wireshark.<br />
I guess there are other scripts available that do just that (after all it is just parsing the text file) , but from Fortinet you can find it here:<br />
<a href="http://kb.fortinet.com/kb/viewContent.do?externalId=11186&#038;sliceId=1">kb.fortinet.com/kb/viewContent.do?externalId=11186&#038;sliceId=1</a> </p>
<p>Or by searching their website for<br />
<strong>fgt2eth.pl<br />
fgt2eth.zip</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2012/02/06/convert-fortigate-diagnose-sniffer-packet-output-into-tcpdump-format-understood-by-wireshark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limit maximum size of scanned files in Fortigate firmware 4</title>
		<link>http://yurisk.info/2011/10/03/limit-maximum-size-of-scanned-files-in-fortigate-firmware-4/</link>
		<comments>http://yurisk.info/2011/10/03/limit-maximum-size-of-scanned-files-in-fortigate-firmware-4/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 17:58:46 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=1715</guid>
		<description><![CDATA[New operating systems are supposed to better user experience .. I thought. Well, so I thought, until today, when I had a need to lower the maximum size of files to be scanned by Fortigate 80C . It was a matter of few clicks in the good old version 3 via management GUI but in [...]]]></description>
			<content:encoded><![CDATA[<p>New operating systems are supposed to better user experience .. I thought. Well, so I thought, until today, when I had a need to lower the maximum size of files to be scanned by Fortigate 80C . It was a matter of few clicks in the good old version 3 via management GUI but in version 4 I spent some 20 minutes digging its GUI high and low and then finally opened Command Reference and found how to do it the CLI way.<br />
Here is the solution :</p>
<div class="cmd">
FTG80C# config antivirus service http<br />
FTG80C(http)# sho</p>
<p>config antivirus service &#8220;http&#8221;<br />
    set scan-bzip2 disable<br />
    set uncompnestlimit 12<br />
    set uncompsizelimit 10<br />
end</p>
<p>FTG80C(http) # set uncompsizelimit 2<br />
FTG80C(http) # end</p>
<p>FTG80C# config antivirus service ftp<br />
FTG80C(ftp) # set</p>
<p>scan-bzip2         enable scanning of bzip2 compressed files<br />
uncompnestlimit    uncompnestlimit<br />
uncompsizelimit    uncompsizelimit</p>
<p>FTG80C(ftp) # set uncompsizelimit</p>
<p><value>    max uncompressed size to scan (1-50MB or use 0 for unlimited)</p>
<p>FTG80C(ftp) # set uncompsizelimit 2<br />
FTG80C(ftp) # end</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2011/10/03/limit-maximum-size-of-scanned-files-in-fortigate-firmware-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best open source Netflow/sFlow analyzing software</title>
		<link>http://yurisk.info/2010/12/12/best-open-source-netflowsflow-analyzing-software/</link>
		<comments>http://yurisk.info/2010/12/12/best-open-source-netflowsflow-analyzing-software/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 20:47:54 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Fortigate]]></category>
		<category><![CDATA[Netflow]]></category>
		<category><![CDATA[Stories]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=1464</guid>
		<description><![CDATA[People ask me frequently what software I would   recommend   for Netflow analysis , especially with security implementations in mind.  I made my choice a long ago and haven&#8217;t been complaining so far &#8211; Nfsen graphical frontend that has Nfdump as its data processing backend . It provides most flexibility, configurability; its filter syntax is very [...]]]></description>
			<content:encoded><![CDATA[<p>People ask me frequently what software I would   recommend   for Netflow analysis , especially with security implementations in mind.  I made my choice a long ago and haven&#8217;t been complaining so far &#8211; <a href="http://nfsen.sourceforge.net/" target="_blank" >Nfsen</a> graphical frontend that has Nfdump as its data processing backend . It provides most flexibility, configurability; its filter syntax is very tcpdump-like; graphic front provides just enough of interactivity; the alerts system is just amazing.Moreover it supports not only Netflow but sFlow as well,so all Fortigate appliances with the last OS can be monitored this way.</p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/12/12/best-open-source-netflowsflow-analyzing-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do not miss the long awaited addition to the Fortigate 4 MR2 – sFlow data export</title>
		<link>http://yurisk.info/2010/10/14/do-not-miss-the-long-awaited-addition-to-the-fortigate-4-mr2-sflow-data-export/</link>
		<comments>http://yurisk.info/2010/10/14/do-not-miss-the-long-awaited-addition-to-the-fortigate-4-mr2-sflow-data-export/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 20:38:54 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=1269</guid>
		<description><![CDATA[Great news – now Fortigate supports exporting data flows statistics to an external server using sFlow protocol (twin of Netflow from the Cisco world). I configured it in about a minute and it just works. To collect the sFlow data I use nfdump/Nfsen , that I found to be the most stable and versatile, not [...]]]></description>
			<content:encoded><![CDATA[<p>Great news – now Fortigate supports exporting data flows statistics to an external server using <a href="http://www.sFlow.org/" target="_blank">sFlow protocol</a> (twin of Netflow from the Cisco world). I configured it in about a minute and it just works. To collect the sFlow data I use <a href="http://nfsen.sourceforge.net/" target="_blank">nfdump/Nfsen</a> , that I found to be the most stable and versatile, not to mention being the rare one supporting both Netflow and sFlow.<br />
You first set external server IP and destination port , here it is 10.99.99.158 and UDP 7774, and then enable flow export per interface. Example follows, here I did it on Fortigate 100.</p>
<div class="cmdout"># show system  sflow</div>
<div class="cmdout">config system sflow</div>
<div class="cmdout">
<p>set collector-ip 10.99.99.158</p>
<p>set collector-port 7774</p>
<p>end</p>
<p># show system  interface  dmz1</p>
<p>config system interface</p>
<p>edit &#8220;dmz1&#8243;</p>
<p>set vdom &#8220;root&#8221;</p>
<p>set ip 10.99.99.254 255.255.255.0</p>
<p>set allowaccess ping https ssh snmp<br />
set type physical<br />
set wccp enable<br />
<strong>set sflow-sampler enable</strong><br />
next<br />
end</p>
</div>
<p><a href="http://kb.fortinet.com/kb/microsites/search.do?cmd=displayKC&amp;docType=kc&amp;externalId=FD32024&amp;sliceId=1&amp;docTypeID=DT_KCARTICLE_1_1&amp;dialogID=5703765&amp;stateId=0%200%205701875" target="_blank">Fortigate article</a></p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/10/14/do-not-miss-the-long-awaited-addition-to-the-fortigate-4-mr2-sflow-data-export/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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 target="_blank" 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>1</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>
		<category><![CDATA[Checkpoint]]></category>
		<category><![CDATA[Esafe]]></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 [...]]]></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>2</slash:comments>
		</item>
		<item>
		<title>Fortigate BGP &#8211; configure and debug</title>
		<link>http://yurisk.info/2010/03/26/fortigate-bgp-configure-and-debug/</link>
		<comments>http://yurisk.info/2010/03/26/fortigate-bgp-configure-and-debug/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 14:56:12 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=647</guid>
		<description><![CDATA[Everyone today speaks BGP: Cisco routers, Juniper routers and ScreenOS firewalls, Fortigate does it,even SonicWall have it as planned feature So question is not whether but how. The opportunity to see how it works on Fortigate recently presented itself and here is the sum up of how I configured and debugged Fortigate BGP set up. [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone today speaks BGP: Cisco routers, Juniper routers and ScreenOS firewalls, Fortigate does it,even SonicWall  have it  as planned feature  So question is not whether but how. The opportunity to see how it works on Fortigate recently presented itself and here is the sum up of how I configured and debugged Fortigate BGP set up.<br />
Task at hand: configure BGP peering with Bogon Route project by Team Cymru <a href="http://www.team-cymru.org/Services/Bogons/routeserver.html"> www.team-cymru.org/Services/Bogons/routeserver.html </a> . More information about the Bogon Routes can be found at the source &#8211; <a href="http://www.team-cymru.org/Services/Bogons/">www.team-cymru.org/Services/Bogons </a>. But in few words they advertise to you routes that are never to be seen in your network for legitimate reasons. Those are networks not only from RFC 1918 but those reserved by RIPE for special purposes, and those unallocated to anyone as of now.<br />
 What we need to know for this set up is this:</p>
<ul>
<li>They advertise all the networks with no-export community</li>
<li>also they attach 65333:888  community (as per their site)</li>
<li>they use md5 password authentication </li>
<li>they don&#8217;t expect you to advertise to them anything</li>
<li>in advertised networks next hop is their advertising router </li>
<li>their AS number is 65333</li>
</ul>
<p>Based on all the above my Fortigate BGP peer had to :</p>
<ul>
<li>enable multihop peering</li>
<li>use MD5 password authentication</li>
<li>have route-map to attach no-export community so that we don&#8217;t  inadvertently advertise learned routes to other peers ( just safety net , in case BGP peer stops attaching no-export community to their routes) </li>
<li>set next hop for the learned routes to Null 0 interface.</li>
</ul>
<p>Let&#8217;s start configuring something. Important surprise here – in Fortigate GUI you can only set  3 parameters:<br />
<i>As number , Peer Ip</i> and <i>networks</i> to be advertised, the rest is to be done on the  command line . So here it goes<br />
1) Configuring route-map to set no-export community on learned networks and force next hop to be some reserved Ip (192.0.2.1 )  that in turn is statically routed to Null interface ,</p>
<div class="cmd">config router route-map<br />
    edit &#8220;NO-EXPORT&#8221;<br />
            config rule<br />
                edit 3<br />
                    set set-community &#8220;no-advertise&#8221;<br />
                    set set-ip-nexthop 192.0.2.1<br />
                next<br />
            end<br />
    next<br />
End </div>
<p>2) Configure BGP peer</p>
<div class="cmd">(root) # show router bgp<br />
config router bgp<br />
    set as 65002<br />
        config neighbor<br />
            edit 84.22.96.5<br />
                set ebgp-enforce-multihop enable<br />
                set remote-as 65333<br />
                set route-map-in &#8220;NO-EXPORT&#8221;<br />
                set password &#8220;yuiyui&#8221;<br />
            next<br />
        end<br />
        config redistribute &#8220;connected&#8221;<br />
            set status enable<br />
        end</div>
<p>3) Configure static blackhole route for the reserved IP used as the next hop for this.</p>
<div class="cmd">(root) # sh router static<br />
config router static<br />
        edit 3<br />
        set blackhole enable<br />
        set dst 192.0.2.1 255.255.255.255<br />
    next<br />
End</div>
<p>Validation phase.<br />
All configs are as good as the prove that it works.</p>
<p> List shortly all the peers </p>
<div class="cmd">(root) # get router info bgp summary</div>
<pre>BGP router identifier 10.250.250.2, local AS number 65002
BGP table version is 159
2 BGP AS-PATH entries
0 BGP community entries

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
84.22.96.5   4  65333       4       6      159    0    0 00:00:48        0

Total number of neighbors 1 </pre>
<p>List all BGP neighbors and their peering state</p>
<div class="cmd">My-FG (root) # get router info bgp neighbors</div>
<pre>
BGP neighbor is 84.22.96.5, remote AS 65333, local AS 65002, external link
  BGP version 4, remote router ID 84.22.96.5
  BGP state = Established, up for 00:00:58
  Last read 00:00:58, hold time is 180, keepalive interval is 60 seconds
  Configured hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    Route refresh: advertised and received (old and new)
    Address family IPv4 Unicast: advertised and received
  Received 4 messages, 0 notifications, 0 in queue
  Sent 6 messages, 0 notifications, 0 in queue
  Route refresh request: received 0, sent 0
  Minimum time between advertisement runs is 30 seconds

 For address family: IPv4 Unicast
  BGP table version 160, neighbor version 159
  Index 3, Offset 0, Mask 0x8
  Community attribute sent to this neighbor (both)
  Inbound path policy configured
  Route map for incoming advertisements is *NO-EXPORT
  0 accepted prefixes
  19 announced prefixes
  Connections established 1; dropped 0
  External BGP neighbor may be up to 255 hops away.
Local host: 10.250.250.2, Local port: 9188
Foreign host: 84.22.96.5, Foreign port: 179
Nexthop: 10.250.250.1</pre>
<p> See the routes learned through the BGP protocol</p>
<div class="cmd">(root) #  get router info bgp network</div>
<pre>
BGP table version is 161, local router ID is 10.250.250.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 5.0.0.0          192.0.2.1                0             0 65333 65333 i
*> 14.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 23.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 31.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 36.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 37.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 39.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 42.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 49.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 100.0.0.0        192.0.2.1                0             0 65333 65333 i
*> 101.0.0.0        192.0.2.1                0             0 65333 65333 i
*> 102.0.0.0        192.0.2.1                0             0 65333 65333 i
*> 103.0.0.0        192.0.2.1                0             0 65333 65333 i
*> 104.0.0.0        192.0.2.1                0             0 65333 65333 i
*> 105.0.0.0        192.0.2.1                0             0 65333 65333 i
*> 106.0.0.0        192.0.2.1                0             0 65333 65333 i
*> 169.254.0.0      192.0.2.1                0             0 65333 65333 i
*> 172.16.0.0/12    192.0.2.1                0             0 65333 65333 i
*> 176.0.0.0/8      192.0.2.1                0             0 65333 65333 i
*> 177.0.0.0/8      192.0.2.1                0             0 65333 65333 i
*> 179.0.0.0/8      192.0.2.1                0             0 65333 65333 i
*> 181.0.0.0/8      192.0.2.1                0             0 65333 65333 i
*> 185.0.0.0/8      192.0.2.1                0             0 65333 65333 i
 </pre>
<p>List routes that are currently installed in the routing table that were learned by BGP .</p>
<div class="cmd">(root) # get router info routing-table bgp</div>
<pre>
B       5.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
B       14.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
B       23.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
B       31.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
B       36.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
B       37.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
B       39.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
B       42.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
</pre>
<p>After all is configured and saved (and probably doesn&#8217;t work) comes the bgp debug round.<br />
Enable bgp debug on the appliance</p>
<div class="cmd">#diag ip router bgp all enable</div>
<p>Enable debug output to console</p>
<div class="cmd">diag debug enable</div>
<p>To stop this output </p>
<div class="cmd">diagnose  debug disable</div>
<p>To verify that debug is on</p>
<div class="cmd"># diag ip router bgp show</div>
<pre>BGP debugging status:
  BGP events debugging is on
  BGP debug level: INFO </pre>
<p>If nothing after that happens try clearing all BGP sessions</p>
<div class="cmd">#exec router clear bgp all</div>
<p>The good way to judge something new is to compare it with something you already know. To continue<br />
With that logic I cross-reference debug output seen on Fortigate with the one seen on the Cisco BGP peer. That<br />
way you  can decide what is more informative and who wins the race (Cisco of course, what you thought?). </p>
<p> <strong>Case 1</strong><br />
<u>One of the peers is configured with wrong AS number.</u><br />
In Fortigate you see this:</p>
<pre>BGP: 84.22.96.5-Outgoing [FSM] State: Idle Event: 3
BGP: 84.22.96.5-Outgoing [NETWORK] FD=15, Sock Status: 0-Success
BGP: 84.22.96.5-Outgoing [FSM] State: Connect Event: 17
BGP: 84.22.96.5-Outgoing [ENCODE] Msg-Hdr: Type 1
BGP: 84.22.96.5-Outgoing [ENCODE] Open: Ver 4 MyAS 65002 Holdtime 180
BGP: 84.22.96.5-Outgoing [ENCODE] Open: Msg-Size 45
BGP: 84.22.96.5-Outgoing [DECODE] Msg-Hdr: type 3, length 23
BGP: %BGP-3-NOTIFICATION: received from 84.22.96.5 2/2 (OPEN Message Error/Bad Peer AS.) 2 data-bytes
</pre>
<p>Now let&#8217;s compare to the debug from Cisco</p>
<div class="cmd">#debug ip bgp events  </div>
<pre>
Mar 24 13:14:55.572: %BGP-3-NOTIFICATION: sent to neighbor 10.250.250.2 2/2 (peer in wrong AS) 2 bytes FDEA FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 002D 0104 FAEA 01B4 0AFA EA02 1302 0201 1400 0100 0132 0222 0012 0222 00
</pre>
<p><strong>Case 2</strong><br />
<u>MD5 authentication is set on Cisco but not on the Fortigate.</u> Again for comparison<br />
debug from Fortigate and debug from Cisco<br />
Cisco:</p>
<pre>Jan  5 10:42:14.299: %TCP-6-BADAUTH: No MD5 digest from 10.250.250.2 (1037) to 84.22.96.5(179)</pre>
<p>Fortigate:</p>
<pre>
84.22.96.5-Outgoing [FSM] State: Connect Event: 9
BGP: [RIB] Scanning BGP Network Routes...
84.22.96.5-Outgoing [FSM] State: Connect Event: 9
BGP: [RIB] Scanning BGP Network Routes...
</pre>
<p><strong>Case 3 </strong><u> (that actually happened when I configured this Fortigate) is mismatched MD5 password on either side</u></p>
<p>Fortigate:<br />
Doing summary listing showed peering as down :</p>
<pre>84.22.96.5   4  65333     934    1036        0    0    0    never Connect </pre>
<p>Cisco:</p>
<pre>*Mar 24 13:40:28.800: BGP: Regular scanner event timer
*Mar 24 13:40:28.800: BGP: Import timer expired. Walking from 1 to 1
*Mar 24 13:40:42.764: %TCP-6-BADAUTH: Invalid MD5 digest from 10.250.250.2(11064) to 84.22.96.5(179)
 </pre>
<p> <strong>Case 4 </strong><u>On Cisco ttl-security is enabled while on Forigate ebgp multi-hop is not .</u><br />
There is no such thing as TTL security on the Fortigate by the way, all you can do to handle this state is enable ebgp-multihop and them it starts sending BGP packets with ttl = 255 .</p>
<p>Cisco:</p>
<pre>Jan  7 13:01:36.992: %BGP-4-INCORRECT_TTL: Discarded message with TTL 2 from 10.250.250.2</pre>
<p> Forigate:</p>
<pre>
BGP: 84.22.96.5-Outgoing [FSM] State: OpenConfirm Event: 11
BGP: 84.22.96.5-Outgoing [ENCODE] Msg-Hdr: Type 4
BGP: 84.22.96.5-Outgoing [ENCODE] Keepalive: 13548 KAlive msg(s) sent
84.22.96.5-Outgoing [FSM] State: OpenConfirm Event: 10
BGP: 84.22.96.5-Outgoing [ENCODE] Msg-Hdr: Type 3
BGP: %BGP-3-NOTIFICATION: sending to 84.22.96.5 4/0 (Hold Timer Expired/Unspecified Error Subcode) 0 data-bytes
BGP: 84.22.96.5-Outgoing [FSM] State: Idle Event: 3
BGP: 84.22.96.5-Outgoing [NETWORK] FD=14, Sock Status: 111-Connection refused
BGP: 84.22.96.5-Outgoing [FSM] State: Connect Event: 18
</pre>
<p> <strong>Bonus Case </strong> Bug-not-a-feature thing on the Fortigate – when configuring MD5 password for  BGP authentication you get Cross-Site vulnerability protection for free <img src='http://yurisk.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Don&#8217;t ask  me how XSS is connected to cli configuration of BGP …</p>
<div class="cmd"> set password  &lt;2AEARep&gt;</div>
<p><span class="cmdout">The string contains XSS vulnerability characters<br />
value parse error before &#8221;<br />
Command fail. Return code -173</span></p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/03/26/fortigate-bgp-configure-and-debug/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fortigate firewall demo  free access. Also FortiManager and FortiAnalyzer</title>
		<link>http://yurisk.info/2010/02/03/fortigate-firewall-demo-free-access-also-fortimanager-and-fortianalyzer/</link>
		<comments>http://yurisk.info/2010/02/03/fortigate-firewall-demo-free-access-also-fortimanager-and-fortianalyzer/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 18:37:25 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=488</guid>
		<description><![CDATA[As someone said best things in life are free. Here are links to the demo Forigate firewall, ForiAnalyzer and FortiManager open to access from anywhere . So that you can familiarize yourself with the Management GUI look and feel. NOTE: Access is read-only. NOTE 2: No , it is not me being so generous, it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>As someone said best things in life are free.<br />
Here are links to the demo Forigate firewall, ForiAnalyzer and FortiManager open to access from anywhere . So that you can<br />
familiarize yourself with the Management GUI look and feel.<br />
NOTE: Access is read-only.<br />
NOTE 2: No , it is not me being so generous, it&#8217;s Fortinet caring for us.<br />
<strong>Fortigate 300 :</strong><br />
user:demo<br />
password: fortigate<br />
<a target="_blank" href="https://fortigate.com"> fortigate.com</a><br />
<strong>ForiAnalyzer 800:</strong><br />
user:demo<br />
password: fortianalyzer<br />
<a target="_blank" href="https://www.fortianalyzer.com">fortianalyzer.com </a><br />
<strong>FortiManager 400:</strong><br />
user:demo<br />
password: fortimanager<br />
<a target="_blank" href="https://www.fortimanager.com">fortimanager.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/02/03/fortigate-firewall-demo-free-access-also-fortimanager-and-fortianalyzer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

