<?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; Filtering</title>
	<atom:link href="http://onhacks.org/lang/en/tag/filtering/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>China Mandates Spying Software &#8211; Green Dam</title>
		<link>http://onhacks.org/lang/en/2009/06/16/china-mandates-spying-software-green-dam</link>
		<comments>http://onhacks.org/lang/en/2009/06/16/china-mandates-spying-software-green-dam#comments</comments>
		<pubDate>Tue, 16 Jun 2009 11:56:07 +0000</pubDate>
		<dc:creator>log0</dc:creator>
				<category><![CDATA[Malware]]></category>
		<category><![CDATA[China]]></category>
		<category><![CDATA[Filtering]]></category>

		<guid isPermaLink="false">http://onhacks.org/?p=366</guid>
		<description><![CDATA[China now mandates all PCs sold on July 1st 2009 to have a content-control software called Green Dam (緣壩) installed. Not sure how wildly reported outside of China, but here I should bring to your attention. The protests, of course, are present. Chinese people are not stupid, but&#8230; On 10 June, amidst massive criticism circling [...]]]></description>
			<content:encoded><![CDATA[<p><strong>China now mandates all PCs sold on July 1st 2009 to have a <a href="http://en.wikipedia.org/wiki/Content-control_software" target="_blank">content-control software</a> called <a href="http://en.wikipedia.org/wiki/Green_Dam" target="_blank">Green Dam</a> (緣壩) installed.</strong></p>
<p>Not sure how wildly reported outside of China, but here I should bring to your attention.</p>
<p>The protests, of course, are present. Chinese people are not stupid, but&#8230;</p>
<blockquote><p>On 10 June, amidst massive criticism circling within the internet about the software and the MIIT&#8217;s directive, the <a title="Publicity Department of the Communist Party of China Central Committee" href="http://en.wikipedia.org/wiki/Publicity_Department_of_the_Communist_Party_of_China_Central_Committee">Publicity Department of the Communist Party of China Central Committee</a>, the agency responsible for censorship, issued an instruction attributed to &#8220;central leaders&#8221; requiring the Chinese media to stop publishing questioning or critical opinions. Reports in defense of the official stand appeared subsequently, with a commentary by the state-run <a class="mw-redirect" title="Xinhua" href="http://en.wikipedia.org/wiki/Xinhua">Xinhua</a> news agency saying &#8220;support largely stems from end users, opposing opinions primarily come from a minority of media outlets and businesses&#8221;.<sup id="cite_ref-19" class="reference"><a href="http://en.wikipedia.org/wiki/Green_Dam#cite_note-19"><span>[</span>20<span>]</span></a></sup><sup id="cite_ref-20" class="reference"><a href="http://en.wikipedia.org/wiki/Green_Dam#cite_note-20"><span>[</span>21<span>]</span></a></sup> The instruction also required online forums to block and remove &#8220;offensive speech evolved from the topic&#8221; promptly.<sup id="cite_ref-21" class="reference"><a href="http://en.wikipedia.org/wiki/Green_Dam#cite_note-21"><span>[</span>22<span>]</span></a></sup> Zhang attacked the Wolchok <em>et al</em> report as irresponsible action and breach of his company&#8217;s copyright, and said that Jinhui had been ordered to patch the weaknesses.<sup id="cite_ref-22" class="reference"><a href="http://en.wikipedia.org/wiki/Green_Dam#cite_note-22"><span>[</span>23<span>]</span></a></sup></p></blockquote>
<p>So, there goes the end of newspaper. What is left? I heard a term called propaganda. =)</p>
<p>I will not discuss the political implications since it is <strong>so painfully obvious</strong>. If you do not, go do a search and study, then you will see how ridiculous is to believe in the benevolence.</p>
<p>On the other hand, this software is buggy. Despite the development company JinHui claims &#8220;all software has a bug&#8221;, it seems he means it is OK to have bugs that can root the whole China. I guess that is good news to the cybercriminals. I could hear them giggling ready to pwn n00bies!</p>
<p>Anyway, here is <a href="http://www.cse.umich.edu/~jhalderm/pub/gd/" target="_blank">an interesting security analysis from The University of Michigan</a>.</p>
<div style="border: 1pt solid #888888; margin: 2em 4em; padding: 0pt 1em;">
<p><big><strong>Summary</strong></big> We have discovered remotely-exploitable vulnerabilities in Green Dam, the censorship software reportedly mandated by the Chinese government. Any web site a Green Dam user visits can take control of the PC.</p>
<p>According to press reports, China will soon require all PCs sold in the country to include Green Dam.  This software monitors web sites visited and other activity on the computer and blocks adult content as well as politically sensitive material.</p>
<p>We examined the Green Dam software and found that it contains serious security vulnerabilities due to programming errors.  Once Green Dam is installed, any web site the user visits can exploit these problems to take control of the computer.  This could allow malicious sites to steal private data, send spam, or enlist the computer in a botnet.  In addition, we found vulnerabilities in the way Green Dam processes blacklist updates that could allow the software makers or others to install malicious code during the update process.</p>
<p>We found these problems with less than 12 hours of testing, and we believe they may be only the tip of the iceberg.  Green Dam makes frequent use of unsafe and outdated programming practices that likely introduce numerous other vulnerabilities.  Correcting these problems will require extensive changes to the software and careful retesting. In the meantime, we recommend that users protect themselves by uninstalling Green Dam immediately.</p></div>
<p>You see, the problems will just continue to arise. Workarounds will be distributed. Well. What&#8217;s next? Hardware rootkits? Let&#8217;s look forward to <a href="http://en.wikipedia.org/wiki/Nineteen_Eighty-Four" target="_blank">1984</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://onhacks.org/lang/en/2009/06/16/china-mandates-spying-software-green-dam/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>
	</channel>
</rss>
