<?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>Henry&#039;s Points</title>
	<atom:link href="http://henrydu.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://henrydu.com/blog</link>
	<description>Think analog, act digital</description>
	<lastBuildDate>Wed, 04 Aug 2010 18:08:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JVM Memory Management</title>
		<link>http://henrydu.com/blog/coding/jvm-memory-management-345.html</link>
		<comments>http://henrydu.com/blog/coding/jvm-memory-management-345.html#comments</comments>
		<pubDate>Wed, 04 Aug 2010 18:08:45 +0000</pubDate>
		<dc:creator>hengdu</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://henrydu.com/blog/?p=345</guid>
		<description><![CDATA[JVM is still an application running on the OS. It&#8217;s interesting to know how JVM manages memory. Better performance in production servers is possible with proper configuration of JVM parameters, particularly those related to memory usage and garbage collection. The allocation of memory for the JVM is specified using -X options.
Heap Size

-Xms: initial java heap [...]]]></description>
			<content:encoded><![CDATA[<p>JVM is still an application running on the OS. It&#8217;s interesting to know how JVM manages memory. Better performance in production servers is possible with proper configuration of JVM parameters, particularly those related to memory usage and garbage collection. The allocation of memory for the JVM is specified using -X options.</p>
<p><strong>Heap Size</strong></p>
<ul>
<li>-Xms: initial java heap size.</li>
<li>-Xmx: maximum java heap size.</li>
</ul>
<p><strong>Stack Size</strong></p>
<ul>
<li>-Xss:     the stack size for each thread.</li>
</ul>
<p><strong>The snippet for Java Option.</strong></p>
<blockquote><p>JAVA_OPTS=&#8221;-Xms256m -Xmx2200m -Xss384k&#8230;</p></blockquote>
<p>Generally, a JVM is using the following rules to manage memory:</p>
<ul>
<li> When a JVM is invoked to run an application, it will ask the operating system for enough memory to run the JVM itself and some free memory for the application to create new objects.</li>
<li>When a new object is created, the JVM will allocate memory for that object out of the free memory area.</li>
<li>When the free memory area is getting too small, the JVM will ask the operating system for more.</li>
<li>When a object is no longer used by the application, it will be destroyed. Its memory will be freed up and merged back to the free memory area.</li>
<li>When the free memory area is used up, and there is no more additional memory available from the operating system, the JVM will stop the application and issue the &#8220;Out of memory error&#8221;.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://henrydu.com/blog/coding/jvm-memory-management-345.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Vista Firewall Turn On/Off</title>
		<link>http://henrydu.com/blog/how-to/windows-vista-firewall-turn-onoff-339.html</link>
		<comments>http://henrydu.com/blog/how-to/windows-vista-firewall-turn-onoff-339.html#comments</comments>
		<pubDate>Fri, 12 Feb 2010 00:11:19 +0000</pubDate>
		<dc:creator>hengdu</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://henrydu.com/blog/?p=339</guid>
		<description><![CDATA[Windows Vista has three level of firewall profile: Domain Profile, Private Profile and Public Profile. All firewall is on by default. If we want to turn off firewall for our own user, we may go to Windows Vista System Administraion -&#62; Firewall and Advanced Security Center. We see the configuration is complicated. There are tons [...]]]></description>
			<content:encoded><![CDATA[<p>Windows Vista has three level of firewall profile: Domain Profile, Private Profile and Public Profile. All firewall is on by default. If we want to turn off firewall for our own user, we may go to Windows Vista System Administraion -&gt; Firewall and Advanced Security Center. We see the configuration is complicated. There are tons of rules and policies for inbound and outbound traffic. Is there any simple way to turn on or turn off the firewall for our own user? Of course, the default firewall is turn on. The answer is YES.</p>
<p>We can go to Control Panel -&gt; User Account. We need to click on &#8220;Turn User Account Control on or off&#8221;.</p>
<p><a href="http://henrydu.com/blog/wp-content/uploads/2010/02/howto-turn-off-vista-firewall-1.png"><img class="aligncenter size-medium wp-image-340" title="howto-turn-off-vista-firewall-1" src="http://henrydu.com/blog/wp-content/uploads/2010/02/howto-turn-off-vista-firewall-1-300x225.png" alt="" width="320" height="269" /></a></p>
<p>Then, we can enable/disable User Account Control. System asks to restart. After restart, we can see the firewall policy is applied or disabled.</p>
<p><a href="http://henrydu.com/blog/wp-content/uploads/2010/02/howto-turn-off-vista-firewall-2.png"><img class="aligncenter size-medium wp-image-341" title="howto-turn-off-vista-firewall-2" src="http://henrydu.com/blog/wp-content/uploads/2010/02/howto-turn-off-vista-firewall-2-300x225.png" alt="" width="339" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://henrydu.com/blog/how-to/windows-vista-firewall-turn-onoff-339.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows TCP 139 and 445 Vulnerability</title>
		<link>http://henrydu.com/blog/networks/windows-tcp-139-and-445-vulnerability-335.html</link>
		<comments>http://henrydu.com/blog/networks/windows-tcp-139-and-445-vulnerability-335.html#comments</comments>
		<pubDate>Thu, 11 Feb 2010 00:01:26 +0000</pubDate>
		<dc:creator>hengdu</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://henrydu.com/blog/?p=335</guid>
		<description><![CDATA[Although those two ports are well known for security reason for a long time, we still hope to know something in details. As we know, NFS (Netwrok File Systems) is developed by Sun. It&#8217;s mainly for sharing directories and files between UNIX machines. Microsoft invented a protocol called SMB (Sever Message Blocks), by which, people [...]]]></description>
			<content:encoded><![CDATA[<p>Although those two ports are well known for security reason for a long time, we still hope to know something in details. As we know, NFS (Netwrok File Systems) is developed by Sun. It&#8217;s mainly for sharing directories and files between UNIX machines. Microsoft invented a protocol called SMB (Sever Message Blocks), by which, people can share directories and files with other Windows machines. Microsoft is trying to rename SMB-based networking to &#8220;Windows Networking&#8221; and the protocol to &#8220;CIFS&#8221;. When we try to mount SAMBA server directory to our Linux machine, we most likely do the following command.</p>
<blockquote><p>sudo mount -t cifs -o username=henrydu //172.17.93.105/Swap-1Day /mnt/Swap-1Day</p></blockquote>
<p>Microsoft open a security hole to many people who haven&#8217;t set up Administrator&#8217;s password. In the early time, people can easily share others <strong><em>C:\WINDOWS</em></strong> directory:</p>
<blockquote><p>\\172.17.93.105\ADMIN$</p></blockquote>
<p>Even with password, malicious people still can figure out by port 139 and 445. This article is not for how to hack others by port 139 and 445. We will see how SMB and NETBIOS work.</p>
<p>SMB is the most popular protocols for Windows PCs lets us share files, disks, directories, printers, and (in some cases) even COM ports across a network. SMB-based networks use a variety of underlying protocols, but the most popular are &#8220;NetBIOS over TCP/IP&#8221;.</p>
<p>Here is a solid example. SMB-client (Hacker) send TCP 445 SYN to SMB-server (Victim). Without waiting for SYN/ACK package, it sends TCP 139 SYN to SMB-server immediately. TCP 445 is to set up SMB session and TCP 139 is to set up NETBIOS session. SMB need NETBIOS protocol. We can see from screen shot that, after TCP 139 and TCP 445 session is up, SMB protocol start to run. From package hierarchy we can see, SMB is over NETBIOS protocol.<br />
<a href="http://henrydu.com/blog/wp-content/uploads/2010/02/wireshark-graph.jpg"><img class="aligncenter size-full wp-image-337" title="wireshark-graph" src="http://henrydu.com/blog/wp-content/uploads/2010/02/wireshark-graph.jpg" alt="" width="599" height="479" /></a></p>
<p>After Microsoft noticed this security issue, TCP 139 and 445 is blocked by default. Thus, SMB-server never reply SYN package if the firewall is on. We can use NMAP to do a test.</p>
<p>Firewall is off.</p>
<blockquote><p>nmap -PN -p139,445 -n -v 172.17.93.105<br />
&#8230;..<br />
PORT    STATE SERVICE<br />
139/tcp open  netbios-ssn<br />
445/tcp open  microsoft-ds</p></blockquote>
<p>Firewall is on</p>
<blockquote><p>PORT    STATE    SERVICE<br />
139/tcp filtered netbios-ssn<br />
445/tcp filtered microsoft-ds</p></blockquote>
<p>Therefore, please make sure these two ports are protected by firewall.</p>
]]></content:encoded>
			<wfw:commentRss>http://henrydu.com/blog/networks/windows-tcp-139-and-445-vulnerability-335.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Network Vulnerability Assessment &#8211; OVAL Test</title>
		<link>http://henrydu.com/blog/networks/network-vulnerability-assessment-oval-test-333.html</link>
		<comments>http://henrydu.com/blog/networks/network-vulnerability-assessment-oval-test-333.html#comments</comments>
		<pubDate>Thu, 04 Feb 2010 23:47:45 +0000</pubDate>
		<dc:creator>hengdu</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://henrydu.com/blog/?p=333</guid>
		<description><![CDATA[Last time I briefly introduced OVAL Definition, I&#8217;ll continue for OVAL Test. Please note that both definition and test are defined in the same XML file. The OVAL test is subroutine of criteria defined in definition section. Here is an example of criteria for JScript 5.7 on Microsoft Windows XP SP3.
&#60;criteria operator=&#8221;AND&#8221; comment=&#8221;JScript 5.7 on [...]]]></description>
			<content:encoded><![CDATA[<p>Last time I briefly introduced <a href="http://henrydu.com/blog/networks/network-security-assessment-oval-definition-331.html" target="_blank">OVAL Definition</a>, I&#8217;ll continue for OVAL Test. Please note that both definition and test are defined in the same XML file. The OVAL test is subroutine of criteria defined in definition section. Here is an example of criteria for JScript 5.7 on Microsoft Windows XP SP3.</p>
<blockquote><p>&lt;criteria operator=&#8221;AND&#8221; comment=&#8221;JScript 5.7 on Microsoft Windows XP SP3&#8243;&gt;<br />
&lt;criterion comment=&#8221;jscript.dll version is less than 5.7.6002.22145&#8243; test_ref=&#8221;oval:com.vendor.oval:tst:102792&#8243;/&gt;<br />
&lt;/criteria&gt;</p></blockquote>
<p>We can see there is a test reference defined by oval:com.vendor.oval:tst:102792. Then, what&#8217;s the definition of test? The following is test definition. We can see that there are two parts, one is object, the other is state. The basic idea in here is, to verify if the object has the state. If yes, then the OVAL test is passed. Otherwise, OVAL test is failed.</p>
<blockquote><p>&lt;test id=&#8221;oval:com.vendor.oval:tst:102792&#8243;/&gt;<br />
&lt;object object_ref=&#8221;oval:org.mitre.oval:obj:564&#8243;/&gt;<br />
&lt;state state_ref=&#8221;oval:com.vendor.oval:ste:102792&#8243;/&gt;<br />
&lt;/test&gt;</p></blockquote>
<p>The object and state are defined as:</p>
<blockquote><p>&lt;file_object id=&#8221;oval:org.mitre.oval:obj:564&#8243;/&gt;<br />
&lt;path var_ref=&#8221;oval:org.mitre.oval:var:200&#8243; var_check=&#8221;all&#8221;/&gt;<br />
&lt;filename&gt;jscript.dll&lt;/filename&gt;<br />
&lt;/file_object&gt;<br />
&#8230;<br />
&#8230;<br />
&lt;file_state id=&#8221;oval:com.vendor.oval:ste:102792&#8243;/&gt;<br />
&lt;version datatype=&#8221;version&#8221; operation=&#8221;less than&#8221;&gt;5.7.6002.22145&lt;/version&gt;<br />
&lt;/file_state&gt;</p></blockquote>
<p>It basically said that, in specified path, if jscript.dll version less than 5.7.6002.22145, then this is a vulnerability.</p>
<p>Right now, we can see that OVAL is a language to define vulnerabilities and how to do the test by using XML format. Obviously, the repository need people to maintain and put more released/observed vulnerabilities. Thanks,</p>
]]></content:encoded>
			<wfw:commentRss>http://henrydu.com/blog/networks/network-vulnerability-assessment-oval-test-333.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Network Security Assessment &#8211; OVAL Definition</title>
		<link>http://henrydu.com/blog/networks/network-security-assessment-oval-definition-331.html</link>
		<comments>http://henrydu.com/blog/networks/network-security-assessment-oval-definition-331.html#comments</comments>
		<pubDate>Wed, 03 Feb 2010 20:00:05 +0000</pubDate>
		<dc:creator>hengdu</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://henrydu.com/blog/?p=331</guid>
		<description><![CDATA[I have briefly mentioned network security assessment part 1 and part 2, here I&#8217;d like to introduce how to do the vulnerability test. In terms of penetration test, this test is white box test because the tester has put the sensor or agent in the asset. This operation is allowed by the firm.
OVAL is Open [...]]]></description>
			<content:encoded><![CDATA[<p>I have briefly mentioned network security assessment <a href="http://henrydu.com/blog/networks/network-security-assessment-reading-notes-%E2%80%93-vulnerability-assessment-319.html" target="_blank">part 1</a> and <a href="http://henrydu.com/blog/networks/network-security-assessment-reading-notes-1-316.html" target="_self">part 2</a>, here I&#8217;d like to introduce how to do the vulnerability test. In terms of penetration test, this test is white box test because the tester has put the sensor or agent in the asset. This operation is allowed by the firm.</p>
<p>OVAL is Open Vulnerability Assessment Language which is well adapted by the industry. The language is written by XML format. Many communities and groups contribute for the OVAL definition and test. The major one is <a href="http://oval.mitre.org/repository/index.html">OVAL     Repository</a> which is hosted by <a href="http://www.mitre.org/" target="_blank">The MITRE Corporation</a>. Before we go detailed about OVAL, let&#8217;s think about how to do the vulnerability assessment test intuitively.</p>
<ul>
<li>Firs, we need define what was vulnerability.</li>
<li>Then, we need to give several criteria, which refer to the real test result.</li>
<li>Then, in the test phase, we need to define the object, such as Windows registry definition.</li>
<li>Last, we need to retrieve values to compared with the object. Then, the one test is done.</li>
</ul>
<p>Here is a solid example for OVAL. Microsoft announced one vulnerability &#8220;Excel Cache Memory Corruption Vulnerability (KB973471)&#8221;. Then, we give one definition for that vulnerability.</p>
<blockquote><p>&lt;definition id=&#8221;oval:com.vendor.oval:def:10383&#8243; version=&#8221;1&#8243;&gt;<br />
&lt;/definition&gt;</p></blockquote>
<p>In the definition there are some nested categories: metadata and criteria.</p>
<p>The metadata provides some description including definition title, affected family, reference CVE and status etc. For example, the following is reference for this definition.</p>
<blockquote><p>&lt;reference source=&#8221;CVE&#8221; ref_id=&#8221;CVE-2009-3127&#8243; ref_url=&#8221;http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-3127&#8243; /&gt;</p></blockquote>
<p>The criteria provides test definition and some comments.</p>
<blockquote><p>&lt;criterion comment=&#8221;Microsoft Excel 2002 SP3 or later is installed&#8221; test_ref=&#8221;oval:org.mitre.oval:tst:8677&#8243;/&gt;</p></blockquote>
<p>At this point, the definition is completed. Next, we will go to see how to define and perform test.</p>
]]></content:encoded>
			<wfw:commentRss>http://henrydu.com/blog/networks/network-security-assessment-oval-definition-331.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPod Touch Vulnerability after Jailbreak</title>
		<link>http://henrydu.com/blog/cool-stuff/ipod-touch-vulnerability-after-jailbreak-329.html</link>
		<comments>http://henrydu.com/blog/cool-stuff/ipod-touch-vulnerability-after-jailbreak-329.html#comments</comments>
		<pubDate>Sun, 31 Jan 2010 19:10:19 +0000</pubDate>
		<dc:creator>hengdu</dc:creator>
				<category><![CDATA[Cool Stuff]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://henrydu.com/blog/?p=329</guid>
		<description><![CDATA[As you may know or may not know, there is a vulnerability for iPod Touch after jailbreak. The root password is hard-coded as &#8220;alpine&#8221;. If your iPod Touch connect to the hotspot network, people who is in the same subnet can do the following:

Nmap the whole subnet.
sudo nmap -A -O -T4 112.55.82.0/24
The scan result will [...]]]></description>
			<content:encoded><![CDATA[<p>As you may know or may not know, there is a vulnerability for iPod Touch after jailbreak. The root password is hard-coded as &#8220;alpine&#8221;. If your iPod Touch connect to the hotspot network, people who is in the same subnet can do the following:</p>
<ol>
<li>Nmap the whole subnet.</li>
<blockquote><p>sudo nmap -A -O -T4 112.55.82.0/24</p></blockquote>
<li>The scan result will be shown as follows.</li>
<blockquote><p>Interesting ports on ******* (112.55.82.202):<br />
PORT      STATE SERVICE    VERSION<br />
22/tcp    open  ssh        OpenSSH 5.2 (protocol 2.0)<br />
62078/tcp open  tcpwrapped<br />
&#8230;.<br />
Running (JUST GUESSING) : Apple embedded (93%), Apple iPhone OS 1.X (89%)</p></blockquote>
<li>Then, the most likely what the people want to do is:</li>
<blockquote><p>ssh root@112.55.82.202<br />
Password: alpine</p></blockquote>
<li>Then, as you can guess, they want to do whatever they want.</li>
<blockquote><p>John-Smiths-iPod:/ root# ls<br />
Applications@  Library/  User@  boot/   dev/  lib/  private/  tmp@  var@<br />
Developer/     System/   bin/   cores/  etc@  mnt/  sbin/     usr/</p></blockquote>
</ol>
<p><strong>The solution is very simple:</strong> just to change root password after jailbreak. We can go to terminal application in the iPod.</p>
<ul>
<li>Type su &#8211; to enter super user mode</li>
<li>Type passwd to enter the new password</li>
<li>Type again the new password</li>
<li>Type exit. We are done.</li>
</ul>
<p>Good luck and Thanks,</p>
]]></content:encoded>
			<wfw:commentRss>http://henrydu.com/blog/cool-stuff/ipod-touch-vulnerability-after-jailbreak-329.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vancouver City Featuring</title>
		<link>http://henrydu.com/blog/travel-log/vancouver-city-featuring-323.html</link>
		<comments>http://henrydu.com/blog/travel-log/vancouver-city-featuring-323.html#comments</comments>
		<pubDate>Sat, 30 Jan 2010 19:52:42 +0000</pubDate>
		<dc:creator>hengdu</dc:creator>
				<category><![CDATA[So we travel]]></category>

		<guid isPermaLink="false">http://henrydu.com/blog/?p=323</guid>
		<description><![CDATA[This is the city where I am living.

]]></description>
			<content:encoded><![CDATA[<p>This is the city where I am living.</p>
<p><object width="540" height="340"><param name="movie" value="http://www.youtube.com/v/_xMz2SnSWS4&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/_xMz2SnSWS4&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="540" height="340"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://henrydu.com/blog/travel-log/vancouver-city-featuring-323.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASA Simulation on Ubunut QEMU</title>
		<link>http://henrydu.com/blog/how-to/linux/asa-simulation-on-ubunut-qemu-321.html</link>
		<comments>http://henrydu.com/blog/how-to/linux/asa-simulation-on-ubunut-qemu-321.html#comments</comments>
		<pubDate>Sat, 30 Jan 2010 01:11:32 +0000</pubDate>
		<dc:creator>hengdu</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://henrydu.com/blog/?p=321</guid>
		<description><![CDATA[When I tried to find the Cisco ASA simulator by Linux keyword, there are few related results came out. Two popular ways are setting up on Windows QEMU and VMWare. People who are using Windows can refer to that.

Windows QEMU
Windows VMWare

However, I found one site that is really useful to install ASA image to QEMU [...]]]></description>
			<content:encoded><![CDATA[<p>When I tried to find the Cisco ASA simulator by Linux keyword, there are few related results came out. Two popular ways are setting up on Windows QEMU and VMWare. People who are using Windows can refer to that.</p>
<ul>
<li><a href="http://7200emu.hacki.at/viewtopic.php?t=7680&amp;sid=681503989b2fd66a21950b813de09d2a" target="_blank">Windows QEMU</a></li>
<li><a href="http://asa_project.gromnet.net" target="_blank">Windows VMWare</a></li>
</ul>
<p>However, I found <a href="http://blog.gns3.net/2009/12/how-to-emulate-cisco-asa/" target="_blank">one site</a> that is really useful to install ASA image to QEMU on Linux. I followed the steps and make my own ASA environment. Please note that this solution is not user friendly like dynamips or dynagen. Select the two ways above maybe a good choice. So, let&#8217;s see how it works in my site.</p>
<p>We need QEMU first</p>
<blockquote><p>sudo apt-get install qemu</p></blockquote>
<p>We need asa802-k8.bin</p>
<blockquote><p>??? <img src='http://henrydu.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p></blockquote>
<p>We assume that we are working on $ASA_WORKSPACE. Under the directory, create an hexadecimal dump of image:</p>
<blockquote><p>hexdump -C asa802-k8.bin &gt; asa802-k8.hex</p></blockquote>
<p>Search for the ZIP header. We can see that the ZIP file starts at offset 1228b0.</p>
<blockquote><p>grep &#8220;1f 8b 08 00 1d&#8221; asa802-k8.hex<br />
001228b0  1f 8b 08 00 1d 3d 73 46  00 03 ec 3a 6d 54 14 57  |&#8230;..=sF&#8230;:mT.W|</p></blockquote>
<p>Find the image size.</p>
<blockquote><p>ls -la asa802-k8.bin<br />
-rw-r&#8211;r&#8211; 1 hengdu hengdu 14524416 2010-01-28 21:27 asa802-k8.bin</p></blockquote>
<p>Now we need to find out where in the file we can start extracting the ZIP part.</p>
<blockquote><p>echo &#8220;14524416 ; ibase=16 ; last &#8211; 1228B0&#8243; | bc | tail -n 1<br />
13334352</p></blockquote>
<p>Extract the zipped part of the ASA image:</p>
<blockquote><p>tail -c 13334352 asa802-k8.bin &gt; asa802-k8.gz</p></blockquote>
<p>Decompress it with gzip:</p>
<blockquote><p>gzip -d asa802-k8<br />
gzip: asa802-k8.gz: decompression OK, trailing garbage ignored</p></blockquote>
<p>Make a tmp directory and extract the archive with cpio.</p>
<blockquote><p>mkdir tmp<br />
cd tmp<br />
sudo cpio -i &#8211;no-absolute-filenames &#8211;make-directories &lt; ../asa802-k8<br />
cpio: Removing leading `/&#8217; from member names<br />
61039 blocks</p></blockquote>
<p>Copy the Linux kernel to the upper directory:</p>
<blockquote><p>cp vmlinuz ../asa802-k8.kernel</p></blockquote>
<p>Make startup script file to ./asa/scripts/first_start.sh. I basically copy all script from the site. However, some part has to be modified in my environment.</p>
<blockquote><p>#!/bin/sh</p>
<p>FIRST_START=no<br />
if test ! -e /mnt/disk0/lina_monitor<br />
then<br />
fdisk /dev/hda &lt;&lt; EOF<br />
n<br />
p<br />
1<br />
5<br />
979<br />
t<br />
4<br />
w<br />
EOF<br />
mkdosfs -F 16 /dev/hda1<br />
mount -o umask=0000,noatime,check=s,shortname=mixed /dev/hda1 /mnt/disk0<br />
cp /asa/bin/lina /mnt/disk0/lina<br />
cp /asa/bin/lina_monitor /mnt/disk0/lina_monitor<br />
FIRST_START=yes<br />
fi<br />
modprobe e100<br />
modprobe e1000<br />
ifconfig eth0 up<br />
ifconfig eth1 up<br />
ifconfig eth2 up<br />
ifconfig eth3 up<br />
ifconfig eth4 up<br />
ifconfig eth5 up<br />
if test $FIRST_START = yes<br />
then<br />
echo &#8220;&#8221;<br />
echo &#8220;&#8221;<br />
echo &#8220;This is your first boot, please wait about 1 min and then type the following commands:&#8221;<br />
echo &#8220;cd /mnt/disk0&#8243;<br />
echo &#8220;/mnt/disk0/lina_monitor&#8221;<br />
echo &#8220;&#8221;<br />
echo &#8220;Please note to use the following command under ASA to save your configs:&#8221;<br />
echo &#8220;copy run disk0:/.private/startup-config&#8221;<br />
echo &#8220;&#8221;<br />
exit<br />
fi<br />
cd /mnt/disk0<br />
/mnt/disk0/lina_monitor</p></blockquote>
<p>Chmod for the script</p>
<blockquote><p>sudo chmod +x ./asa/scripts/first_start.sh</p></blockquote>
<p>Now you can compress all the file and have the initrd ready to use in Qemu:</p>
<blockquote><p>sudo find . | cpio -o -H newc | gzip -9 &gt; ../asa802-k8.initrd.gz</p></blockquote>
<p><strong>At this point, the Linux kernel files are ready for QEMU to use.</strong></p>
<p>Create a virtual hard disk</p>
<blockquote><p>qemu-img create FLASH 256M<br />
Formatting &#8216;FLASH&#8217;, fmt=raw size=268435456</p></blockquote>
<p>Then start QEMU</p>
<blockquote><p>qemu -hda FLASH -kernel asa802-k8.kernel -hdachs 980,16,32 \<br />
-initrd asa802-k8.initrd.gz -m 512 -nographic -append \<br />
&#8220;console=ttyS0,9600n8 hda=980,16,32 bigphysarea=16384 auto nousb ide1=noprobe&#8221;</p></blockquote>
<p>After many lines output, you will see # prompt. Then, we start ASA.</p>
<blockquote><p>/bin/lina</p></blockquote>
<p>Finally, I saw the familiar prompt.</p>
<blockquote><p>ciscoasa#</p></blockquote>
<p>So far, I still have some issues to figure it out, such as interface setup and working with my dynamips router. Hopefully I will figure out later time. Please feel free to join my discussion.</p>
<p>Thanks,</p>
]]></content:encoded>
			<wfw:commentRss>http://henrydu.com/blog/how-to/linux/asa-simulation-on-ubunut-qemu-321.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Network Security Assessment Reading Notes – Vulnerability Assessment</title>
		<link>http://henrydu.com/blog/networks/network-security-assessment-reading-notes-%e2%80%93-vulnerability-assessment-319.html</link>
		<comments>http://henrydu.com/blog/networks/network-security-assessment-reading-notes-%e2%80%93-vulnerability-assessment-319.html#comments</comments>
		<pubDate>Wed, 27 Jan 2010 22:57:32 +0000</pubDate>
		<dc:creator>hengdu</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://henrydu.com/blog/?p=319</guid>
		<description><![CDATA[This chapter is called vulnerability assessment 101. I guess this is because the topic is too huge to fit in the one chapter, even in the one book. According to the book, the assessment basically divided to three steps.
The first step is to collect information. The commonly used tool is nmap, which is open source [...]]]></description>
			<content:encoded><![CDATA[<p>This chapter is called vulnerability assessment 101. I guess this is because the topic is too huge to fit in the one chapter, even in the one book. According to the book, the assessment basically divided to three steps.</p>
<p>The first step is to collect information. The commonly used tool is <strong>nmap</strong>, which is open source application and can be download for both Windows OS and Linux. The other commonly used tool is <strong>whois</strong>, which still can collect many information. Of course, there are many sophisticate tools, such as <a href="http://www.qualys.com/" target="_blank">Qualys</a>. Those techs are core property of those vendors. In terms of collecting information, there are two approaches in practise. One is non-sensor-based and the other is sensor-based. Apparently, sensor-based approaches can provide more information, such as users, configurations, processes running on the assets, devices registered on the assets, etc. Sensor-based approach can overcome NAT topology, while non-sensor-based scanner could not find the assets behind NAT.</p>
<p>The second step is enumerate information. The scanner should have knowledge from collected information about: 1) what OS is running on the asset? 2) How many TCP ports are open on the asset? 3) How many UDP ports are open on the asset? etc.</p>
<p>The last step is detection. This is core part of vulnerability assessment. This part is also described in details in the following chapters. When we try to identify what is a vulnerability, we need a definition, or precisely, a benchmark. Here is the one example of benchmark &#8211; <a href="http://nvd.nist.gov/fdcc/FDCC-Major-Version-1.2.x.0-12172009-1831.zip">FDCC Major Version</a>. We can use Benchmark Editor to open it. Basically, one benchmark is a collection of many rules. For example, the one rule could be Password Policy -&gt; Maximum Password Age -&gt; 7776000. If scanner detects that the maximum password age is larger than that, then this is a vulnerability because the hacker may brute-force password during the time.</p>
]]></content:encoded>
			<wfw:commentRss>http://henrydu.com/blog/networks/network-security-assessment-reading-notes-%e2%80%93-vulnerability-assessment-319.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Network Security Assessment &#8211; Reading Notes 1</title>
		<link>http://henrydu.com/blog/networks/network-security-assessment-reading-notes-1-316.html</link>
		<comments>http://henrydu.com/blog/networks/network-security-assessment-reading-notes-1-316.html#comments</comments>
		<pubDate>Tue, 26 Jan 2010 23:44:13 +0000</pubDate>
		<dc:creator>hengdu</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://henrydu.com/blog/?p=316</guid>
		<description><![CDATA[Recently I found the blog is good place to put my reading notes. So, let me start the first one. Since I am involving in network vulnerability scan job, This book is really fundamental and provides a lot of easy understanding definition and terminologies rather than jargons. The book name is Network Security Assessment: From [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I found the blog is good place to put my reading notes. So, let me start the first one. Since I am involving in network vulnerability scan job, This book is really fundamental and provides a lot of easy understanding definition and terminologies rather than jargons. The book name is <strong><em>Network Security Assessment: From vulnerability to patch</em></strong>.</p>
<p><img class="aligncenter size-full wp-image-317" title="network_security_assessment" src="http://henrydu.com/blog/wp-content/uploads/2010/01/network_security_assessment.jpg" alt="network_security_assessment" width="240" height="240" />The first chapter gave us a clear vision about what is vulnerability. How to define it and how to score it.</p>
<p>Over the years, the definition of vulnerability has evolved into a software or hardware bug or misconfiguration that a malicious individual can exploit. A vulnerability can be publicly diclosed before a vendor patch, or can even be used quietly by attackers. An organization experiences multiple levels of risk to a vulnerability, depending on how the discoverer of the vulnerability deals with the information and how long it takes the vnedor affected to issue a patch or workaround.</p>
<p>Here is a solid example for my Windows 2008 Server, which is a network security asset. After scan, the one of vulnerability results shows CVE ID is <a href="http://nvd.nist.gov/nvd.cfm?cvename=CVE-2008-4844" target="_blank">CVE-2008-4844</a>. The description is: &#8220;Use-after-free vulnerability in mshtml.dll in Microsoft Internet Explorer 5.01, 6, and 7 on Windows XP SP2 and SP3, Server 2003 SP1 and SP2, Vista Gold and SP1, and Server 2008 allows remote attackers to execute arbitrary code via a crafted XML document containing nested SPAN elements, as exploited in the wild in December 2008.&#8221;</p>
<p>CVE stands for Common Vulnerabilities and Exposures, and a list of CVE numbers was created several years ago to help standardize vulnerability naming. The CVE created a list of all vulnerabilities and assigned each one a CVE ID in the format CVE-year-number. Vendors have been encouraged to use CVE numbers when referencing vulnerabilities.</p>
<p>Right now, we knew we have one vulnerability which has been defined by CVE ID, but how could we know the severity of that vulnerability? Theoretically, the risk is the products of four attributes: Vulnerability, Attacks, Threat and Exposure. However, different vendor has different scoring system. Therefore, CVSS is attempt to solve the problem by providing sophisticate scoring system. For example, for CVE ID: <a id="_idJsp1:_idJsp38:0:_idJsp48:0:_idJsp50" name="_idJsp1:_idJsp38:0:_idJsp48:0:_idJsp50" href="http://172.17.93.174/CommandCenter/faces/jsp/externalLink.jsp?type=cve&amp;cveId=CVE-2008-1446" target="_blank">CVE-2008-1446</a>, the CVSS base score is 9 and the CVSS vector is: <a id="_idJsp1:_idJsp38:0:_idJsp60" name="_idJsp1:_idJsp38:0:_idJsp60" href="http://172.17.93.174/CommandCenter/faces/jsp/externalLink.jsp?type=vector&amp;cveId=CVE-2008-1446&amp;vector=%28AV%3AN/AC%3AL/Au%3AS/C%3AC/I%3AC/A%3AC%29" target="_blank">(AV:N/AC:L/Au:S/C:C/I:C/A:C)</a>. The detailed CVSS guide is in<a href="http://www.first.org/cvss/cvss-guide.html" target="_blank"> here</a>. <a id="_idJsp1:_idJsp38:0:_idJsp48:0:_idJsp50" name="_idJsp1:_idJsp38:0:_idJsp48:0:_idJsp50" href="http://172.17.93.174/CommandCenter/faces/jsp/externalLink.jsp?type=cve&amp;cveId=CVE-2008-1446" target="_blank"></a></p>
<p>After we have realized that we have one vulnerability in our server, we need to patch a remedy to it, which will be mentioned in the following chapters. But in here, I would like to mention the windows of vulnerbility. It mainly talked about the gap between the vulnerability has been discovered and the patch has bee delivered. Because during that time frame, the attacker can easily launch the action to try to attack. How to solve that problem, the book put a lot of efforts on that. However, there is no panacea for solve all the problem. Again, no network security means no network.</p>
<p>Thanks,</p>
]]></content:encoded>
			<wfw:commentRss>http://henrydu.com/blog/networks/network-security-assessment-reading-notes-1-316.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
