<?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>onHacks &#187; Analysis</title>
	<atom:link href="http://onhacks.org/lang/en/tag/analysis/feed/" rel="self" type="application/rss+xml" />
	<link>http://onhacks.org</link>
	<description>On Hacking Across Boundaries</description>
	<lastBuildDate>Wed, 02 Jun 2010 05:48:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to examine a bad word filter?</title>
		<link>http://onhacks.org/lang/en/2009/05/31/how-to-examine-a-bad-word-filter</link>
		<comments>http://onhacks.org/lang/en/2009/05/31/how-to-examine-a-bad-word-filter#comments</comments>
		<pubDate>Sun, 31 May 2009 00:02:16 +0000</pubDate>
		<dc:creator>.hac</dc:creator>
				<category><![CDATA[Email]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Analysis]]></category>
		<category><![CDATA[Black box]]></category>
		<category><![CDATA[Filtering]]></category>

		<guid isPermaLink="false">http://onhacks.org/?p=352</guid>
		<description><![CDATA[Testing something is always a good practice before learning how to hack something, the methodologies we use in testing sometimes are applicable in hacking. So, I am planning to write some entries related to testing in the coming few months. See if we can have discover a systematic way to hack. Here is the first [...]]]></description>
			<content:encoded><![CDATA[<p>Testing something is always a good practice before learning how to hack something, the methodologies we use in testing sometimes are applicable in hacking. So, I am planning to write some entries related to testing in the coming few months. See if we can have discover a systematic way to hack. Here is the first challenge, it is very simple.</p>
<p><strong>Problem</strong><br />
Network managers always want to or are forced to control the information flowing around a network. Most of the time, filtering is a good way to do the control. Inside this big category, we always like to use block list to prevent information comes in or goes out, to and from the network.</p>
<p><strong>Scenarios</strong><br />
Flora doesn&#8217;t want her daughter wallow in Japan pop star. Flora knows that her daughter always navigate to some sites with domain name ending as &#8216;.jp&#8217;, she is looking for a tool that can control what kinds of websites their PC can reach.</p>
<p>IT administrator in PC middle school discovered that their mail system started receiving porn advertisement and students are trying to share these links through the mail system, they are planning to have a filter that can block all such mail flows.</p>
<p>Justin loves blogging so much, he is writing them weekly. He loves to collect and read feedbacks from the audiences. However, he hates those spammer pasting unrelated advertisement on his posts. He want to figure out a way to stop them appearing from other audiences.</p>
<p><strong>Solution</strong><br />
The trivial filtering solution to help these people out is bad word filtering. The basic idea is the same as general block list, users can specify the tokens they want to look for when deciding to block the information. In general, there are at least two different definitions to distinguish whether we found the bad word or not. Given an input message M,</p>
<ol>
<li>Split the message M into a sequence of words Ws, we found a bad word bW is in the message only if Ws contains bW.</li>
<li>Take the message M as an input stream, we found a bad word bW when there is a list of consecutive characters equals bW.</li>
</ol>
<p>Both definition has there own advantages and disadvantages, but we will keep this discussion later since the current topic is how to test the filter. Let&#8217;s say we pick the first definition for our filter, then what should we test? (Take some time to think about scenarios before continue reading)</p>
<p><strong>Functional Test</strong><br />
According the input of this filter (input message M), we can design few functional test cases. Basic scenarios are,</p>
<ul>
<li>empty message [Expected: Accept];</li>
<li>only a word (either good or bad word) [Expected: good - Accept, bad - Reject];</li>
<li>two words (good and bad) with different delimiter [Expected: Depends on how the feature define delimiter];</li>
<li>a list of word and contains (0, 1, 2, all) bad words [Expected: all reject];</li>
<li>a bad word is embedded in a word (eg. assume evil is bad word, message conatins residentevil.com) [Expect: By design, this message will be accepted]</li>
</ul>
<p>Beside these functional test cases, we should to have a lengthy message to check boundary cases of the feature. Assume the longest message we accept is N characters, we need to have message with length N, N+1 and N+2. On the other hand, globalization and localization test may be required, depends on who is your target user.</p>
<p><strong>Security Concern</strong><br />
Then we would ask: is there other way to bypass the filter (eg. message using different encoding)? Is it possible to have code injection or script injection attack? Who can use the feature? Where is the bad word list? Who have rights to touch the list? These are security concerns when testing the feature. Drawing a data flow diagram always help to identify what kind of security issues we may have. However, this post only focus on functional testing a feature. May be next time we can discuss how to design security test cases of a feature.</p>
<p><strong>Conclusion</strong><br />
We have only discussed some elementary skills to design the test plan of a feature. You can consider what kind of input the feature can have, both valid and invalid input. Output is another way to discover new scenarios, output is anything that the feature shown. Since we assumed that this filter only say accept or reject of a message and throw some exceptions (eg. input size exceed), the test cases we found here are almost dominated by what we found with the input. Now, you are able to test your program more systematically!</p>
<p>Have a good weekend!</p>
<p><strong>Practice (Just for fun)</strong><br />
Should you want to have some practice, we can discuss how to test an IP block list filter. Here is a simple definition:</p>
<p><strong>INPUT</strong>: Only allow IPv4 address, one at a time<br />
<strong>IMPLEMENTATION</strong>: An IP block list is stored as a text file in the same folder of the filter, user need to directly modify the text file if he want to Add/Remove/Edit an IP address in the block list. The filter will perform a binary search to see if the input address is on the list. If it is, then it will announce reject, otherwise output accept.<br />
<strong>OUTPUT</strong>: Accept/ Reject the address</p>
]]></content:encoded>
			<wfw:commentRss>http://onhacks.org/lang/en/2009/05/31/how-to-examine-a-bad-word-filter/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Are AntiVirus That Bad?</title>
		<link>http://onhacks.org/lang/en/2008/12/21/are-antivirus-that-bad</link>
		<comments>http://onhacks.org/lang/en/2008/12/21/are-antivirus-that-bad#comments</comments>
		<pubDate>Sun, 21 Dec 2008 17:39:39 +0000</pubDate>
		<dc:creator>log0</dc:creator>
				<category><![CDATA[Malware]]></category>
		<category><![CDATA[Analysis]]></category>

		<guid isPermaLink="false">http://onhacks.org/?p=61</guid>
		<description><![CDATA[Do AntiVirus products detect bots? Stuart Staniford said less than 60%. I guess that is a &#8220;NO&#8221; for most of us. Surprise? Not really. If you are into the malware field, this is old news. Well, I am just a hobbyist. Stuart used the VirusTotal and FireEye&#8217;s findings as a source of malware. How accurate [...]]]></description>
			<content:encoded><![CDATA[<p><span lang="en"><a href="http://blog.fireeye.com/research/2008/11/does-antivirus-stop-bots.html" target="_self">Do AntiVirus products detect bots</a>? Stuart Staniford said less than 60%. I guess that is a &#8220;NO&#8221; for most of us. <a href="http://research.pandasecurity.com/archive/Antivirus-industry-10-years-ago.aspx" target="_self">Surprise</a>? Not really. If you are into the malware field, this is old news. Well, I am just a hobbyist.</span></p>


<p><span lang="en">Stuart used the VirusTotal and FireEye&#8217;s findings as a source of malware. How accurate is that? Stuart admitted the data being imprecise, and I am not in the field with data to tell a very precise one about VirusTotal either. Let me try to deduce, if anyone can submit a sample to VirusTotal, it is possible there are significant number of samples that never got out far enough to reach more than a small population, or some people wrote their own and submitted up there, with no victims. For his company&#8217;s source of malware, I will assume it is very real as the collecting appliances are deployed on real production boxes. I have no idea what boxes are they though. This is my thoughts to justify the accuracy of his findings. So, I assume only a portion of it concerns the majority of us. So it might not be less than 60%.</span></p>


<p><span lang="en">After reading Stuart&#8217;s post, I got to know some numbers of what&#8217;s going on. I do not believe in the ability of the signature matching ( and this is not byte-to-byte matching! ) alone, but I think AVs are still OK to detect a good number of those popular roaming malware your father or mother is being infected with. For some new detection, especially &#8220;nasty root of all evil&#8221; the rootkits, <a href="http://www.tolerantsystems.org/SRSProgram/Dec11/VICI.pdf" target="_self">there is behavioral analysis that Tim Fraser developed that looks interesting</a>. Though, if you <a href="http://www.research.ibm.com/antivirus/SciPapers/VB2000DC.htm" target="_self">ask for perfect detection, no way</a>.</span></p>


]]></content:encoded>
			<wfw:commentRss>http://onhacks.org/lang/en/2008/12/21/are-antivirus-that-bad/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
