<?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>MagicalTux in Japan &#187; Hacking</title>
	<atom:link href="http://blog.magicaltux.net/category/geek-attitude/hacking/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.magicaltux.net</link>
	<description>Geekness brought me to Japan!</description>
	<lastBuildDate>Mon, 26 Jul 2010 21:31:16 +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>SeedFuck&#8230; oui..? non !</title>
		<link>http://blog.magicaltux.net/2010/04/29/seedfuck-oui-non/</link>
		<comments>http://blog.magicaltux.net/2010/04/29/seedfuck-oui-non/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 05:44:42 +0000</pubDate>
		<dc:creator>MagicalTux</dc:creator>
				<category><![CDATA[Geek Attitude]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[French]]></category>
		<category><![CDATA[Hadopi]]></category>
		<category><![CDATA[Seedfuck]]></category>

		<guid isPermaLink="false">http://blog.magicaltux.net/?p=471</guid>
		<description><![CDATA[Ça fait longtemps que je n&#8217;ai pas écrit d&#8217;article en français, mais ces derniers jours je vois que beaucoup de français se disent &#8220;ça y est, avec SeedFuck, Hadopi est fini&#8221;. Je tiens a préciser que non! Ça m&#8217;énerve de voir tout un tas de sources s&#8217;extasier devant du vent en croyant savoir comment le [...]]]></description>
			<content:encoded><![CDATA[<p>Ça fait longtemps que je n&#8217;ai pas écrit d&#8217;article en français, mais ces derniers jours je vois que beaucoup de français se disent &#8220;ça y est, avec SeedFuck, Hadopi est fini&#8221;. Je tiens a préciser que non! Ça m&#8217;énerve de voir <a href="http://www.itespresso.fr/outil-seedfuck-defie-pro-hadopi-34718.html" target="_blank">tout</a> <a href="http://www.korben.info/seedfuck-hadopi.html" target="_blank">un</a> <a href="http://www.degroupnews.com/actualite/n4705-seedfuck-p2p-telechargement-internet-hadopi.html?xtor=RSS-1" target="_blank">tas</a> <a href="http://www.lepost.fr/article/2010/04/23/2044827_seedfuck-le-logiciel-qui-permet-d-effacer-votre-identite-virtuelle.html" target="_blank">de</a> <a href="http://www.clubic.com/telecharger/logiciel-telechargement-p2p/bittorrent/actualite-337744-frederic-mitterrand-appele-pencher-seedfuck.html" target="_blank">sources</a> <a href="http://questions.assemblee-nationale.fr/q13/13-77590QE.htm" target="_blank">s&#8217;extasier</a> devant du vent en croyant savoir comment le P2P en torrent marche (pour la petite histoire, je suis l&#8217;auteur d&#8217;un client torrent que personne n&#8217;utilise, mais ça fait quand même de moi quelqu&#8217;un qui sait comment ça marche).</p>
<p>Je ne suis pas particulièrement un défenseur d&#8217;Hadopi, mais je ne compte pas rester les bras croisés pendant que de telles inepties circulent sur Internet. Nos amis nantais (Trident Media Guard) n&#8217;auront pas de difficulté a passer au travers de SeedFuck et déterminer aisément les vraies ips.</p>
<p>Si j&#8217;était moi même une société nantaise mandatée par l&#8217;état pour tracker les ips qui téléchargent et partagent un fichier torrent donné mon mode opératoire serait légèrement différent. Le processus serait simple:</p>
<ul>
<li>Connexion au tracker comme étant un client avec 0% du fichier, le tracker envoie une série de peers auquel je peux me connecter. Le tracker va également publier ma propre IP pour permettre aux peers de se connecter à moi.</li>
<li>J&#8217;établis des connexions aux peers et j&#8217;attend d&#8217;en reçevoir</li>
<li>Pour chaque peer qui se connecte à moi, ou que je contacte:
<ul>
<li>Je lui demande une partie du fichier qu&#8217;elle a et que mes autres peers n&#8217;ont pas ou peu (prévu comme ça dans le standard bittorrent)</li>
<li>Une fois la partie reçue je compare son checksum à ce qui est indiqué dans le fichier torrent</li>
<li>Si ça match, je stock la partie reçue avec l&#8217;ip d&#8217;origine, et la date/heure. En effet j&#8217;ai sous les yeux un flagrant délit de distribution de données sous copyright par une ip &#8220;en personne&#8221;</li>
</ul>
</li>
</ul>
<p>Ce mode opératoire rend la détection du client d&#8217;analyse Hadopi difficile (se comporte comme un client torrent, et l&#8217;usage d&#8217;un client id + une ip dynamique changés chaque jour n&#8217;aidera pas a la détection) tout en donnant une preuve irréfutable qu&#8217;une IP donnée a participé à un acte de piratage.</p>
<p>Seedfuck se contente d&#8217;ajouter dans les IPs connues du tracker de nouvelles IPs aléatoires. Cela signifie pas que ces ips vont réellement distribuer le fichier en question. Tout ce que ça fera est de réduire le ratio de peers valides dans la base du tracker, et diminuer la qualité du téléchargement P2P.</p>
<p>Donc je dis bravo à celui qui a imaginé Seedfuck, y&#8217;avais pas mieux pour aider l&#8217;état !</p>
<h2>FAQ</h2>
<p><strong>Y&#8217;a écrit dans le brevet de TMG qu&#8217;ils n&#8217;allaient pas faire comme ça.</strong></p>
<blockquote><p>On peut espérer pour eux qu&#8217;ils n&#8217;ont pas prévu de rester sur une méthode unique du début à la fin. Si je peux me permettre de le rappeler, le combat entre le bien et le mal est un combat sans fin où chaque côté a l&#8217;avantage un moment, et ne l&#8217;a plus le moment d&#8217;après (à vous de décider quel côté est le bien et lequel est le mal).</p>
<p>De toutes façons le fait d&#8217;avoir breveté une méthode (moisie) ne les empêche pas d&#8217;utiliser une autre méthode.</p></blockquote>
<p><strong>Vérifier un checksum pour un morceau de fichier ne permet pas d&#8217;être sur a 100% qu&#8217;il s&#8217;agit bien du même fichier</strong></p>
<blockquote><p>Oui non hé ho! On parle là d&#8217;une IP qui répond au protocole bittorrent, confirme être sur le torrent en question, et qui a fourni des données binaires pour lesquelles le SHA1 correspond exactement. Les chances d&#8217;avoir une collision en SHA1 sont extrêmement faibles, pour le moment aucune collision n&#8217;a été trouvée, et les chances de collision sont calculées à 1 sur 2^63, ça laisse du temps).</p>
<p>Même si on ne peut effectivement pas être sur a 100% de rien du tout, c&#8217;est du 99.99999% avec de toutes façons une IP qui répond au protocole BT (la méthode TMG est plutôt du genre 70%).</p></blockquote>
<p>PS: Si vous m&#8217;en voulez de donner un mode opératoire qui permet de contourner seedfuck ou n&#8217;importe quelle autre méthode en générant un cas de flagrant délit (l&#8217;ip en question a fourni un bout de fichier qui correspond au checksum du torrent, et donc est valide), essayez plutôt de vous demander pourquoi vous n&#8217;y avez pas pensé vous même.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.magicaltux.net/2010/04/29/seedfuck-oui-non/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Invision Power Board and IPv6, a dirty hack</title>
		<link>http://blog.magicaltux.net/2010/02/18/invision-power-board-and-ipv6-a-dirty-hack/</link>
		<comments>http://blog.magicaltux.net/2010/02/18/invision-power-board-and-ipv6-a-dirty-hack/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 10:13:43 +0000</pubDate>
		<dc:creator>MagicalTux</dc:creator>
				<category><![CDATA[Geek Attitude]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[Invision Power Board]]></category>
		<category><![CDATA[IPB]]></category>
		<category><![CDATA[IPS]]></category>
		<category><![CDATA[IPv6]]></category>

		<guid isPermaLink="false">http://blog.magicaltux.net/?p=439</guid>
		<description><![CDATA[Since IPS seems to lack the willingness to fix the IPv6 issue with their software, and given the amount of users willing to totally disable IP protection on their board to allow IPv6 users, I decided to provide with those people an alternative solution allowing to differenciate users. This will create fake IPv4 for IPv6 [...]]]></description>
			<content:encoded><![CDATA[<p>Since IPS seems to <a href="http://community.invisionpower.com/index.php?app=tracker&amp;showissue=3967" target="_blank">lack the willingness to fix the IPv6 issue with their software</a>, and given the amount of users willing to totally disable IP protection on their board to allow IPv6 users, I decided to provide with those people an alternative solution allowing to differenciate users.</p>
<p>This will create fake IPv4 for IPv6 users based on the 64 first bits of their IP. As most currently exising IPv6 providers are assigning /64 classes to their customers, banning the generated IPv4 effectively bans the whole IPv6.</p>
<p>Also I do generate a 32bits IPv4 from 64bits of IPv6 using XOR. While this means people using IPv6 might share the same generated IPv4 (quite unlikely), it is usually impossible for someone to obtain a different generated IPv4 without access to more than a /64 (I believe only system administrators have this kind of thing).</p>
<p>You might want to store in database generated IPv4 and their IPv6 counterparts to be able to recover a given IPv6 from a blocked IPv4.</p>
<p>This method also allows to block IPs in the same subnet from IPv4 subnets (I don&#8217;t know if IPB supports this feature) and recognize people from the same subnet as the start of their generated ip will be the same (however whois information for the given IP will not match the real user&#8217;s ip).</p>
<p>To have the generated IPv4, insert this in conf_global.php :</p>
<pre>$encoded_ip = inet_pton($_SERVER['REMOTE_ADDR']);
if (strlen($encoded_ip) == 16) {
    $ipv4 = '';
    for($i = 0; $i &lt; 8; $i += 2) $ipv4 .= chr(ord($encoded_ip[$i]) ^ ord($encoded_ip[$i+1]));
    $_SERVER['REMOTE_ADDR'] = inet_ntop($ipv4);
}</pre>
<p>And remember to ask your IPB support to have real IPv6 ASAP.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.magicaltux.net/2010/02/18/invision-power-board-and-ipv6-a-dirty-hack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Invision Power Board and FaceBook connect on Chrome</title>
		<link>http://blog.magicaltux.net/2010/02/03/invision-power-board-and-facebook-connect-on-chrome/</link>
		<comments>http://blog.magicaltux.net/2010/02/03/invision-power-board-and-facebook-connect-on-chrome/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 18:45:46 +0000</pubDate>
		<dc:creator>MagicalTux</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[BBS]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Chromium]]></category>
		<category><![CDATA[FaceBook]]></category>
		<category><![CDATA[GG.ST]]></category>
		<category><![CDATA[Invision Power Board]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.magicaltux.net/?p=425</guid>
		<description><![CDATA[Some people who manage Invision Boards have seen the new &#8220;FaceBook connect&#8221; feature as something interesting&#8230; However at first, I couldn&#8217;t see the &#8220;Connect with FaceBook&#8221; button. Searching around a bit finally got this error from Chrome: Unsafe JavaScript attempt to access frame with URL http://bbs.gg.st/index.php?app=core&#38;module=global&#38;section=login from frame with URL http://www.facebook.com/extern/login_status.php?api_key=10e950be918b8f0561e2073c53f2ab8e&#38;extern=0&#38;channel=http%3A%2F%2Fbbs.gg.st%2Finterface%2Ffacebook%2Fxd_receiver.php&#38;locale=en_US. Domains, protocols and ports [...]]]></description>
			<content:encoded><![CDATA[<p>Some people who manage Invision Boards have seen the new &#8220;FaceBook connect&#8221; feature as something interesting&#8230; However at first, I couldn&#8217;t see the &#8220;Connect with FaceBook&#8221; button.</p>
<p>Searching around a bit finally got this error from Chrome:</p>
<p><span style="color: #ff0000;">Unsafe JavaScript attempt to access frame with URL </span><a title="http://bbs.gg.st/index.php?app=core&amp;module=global&amp;section=login" href="http://bbs.gg.st/index.php?app=core&amp;module=global&amp;section=login" target="_blank"><span style="color: #ff0000;">http://bbs.gg.st/index.php?app=core&amp;module=global&amp;section=login</span></a><span style="color: #ff0000;"> from frame with URL </span><a title="http://www.facebook.com/extern/login_status.php?api_key=10e950be918b8f0561e2073c53f2ab8e&amp;extern=0&amp;channel=http%3A%2F%2Fbbs.gg.st%2Finterface%2Ffacebook%2Fxd_receiver.php&amp;locale=en_US" href="http://www.facebook.com/extern/login_status.php?api_key=10e950be918b8f0561e2073c53f2ab8e&amp;extern=0&amp;channel=http%3A%2F%2Fbbs.gg.st%2Finterface%2Ffacebook%2Fxd_receiver.php&amp;locale=en_US" target="_blank"><span style="color: #ff0000;">http://www.facebook.com/extern/login_status.php?api_key=10e950be918b8f0561e2073c53f2ab8e&amp;extern=0&amp;channel=http%3A%2F%2Fbbs.gg.st%2Finterface%2Ffacebook%2Fxd_receiver.php&amp;locale=en_US</span></a><span style="color: #ff0000;">. Domains, protocols and ports must match.</span></p>
<p>On Firefox (and probably other browsers), this works without problem. Just sharing that so other people do not get stuck with the same problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.magicaltux.net/2010/02/03/invision-power-board-and-facebook-connect-on-chrome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doing the impossible with apache modules</title>
		<link>http://blog.magicaltux.net/2010/01/15/doing-the-impossible-with-apache-modules/</link>
		<comments>http://blog.magicaltux.net/2010/01/15/doing-the-impossible-with-apache-modules/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 07:42:35 +0000</pubDate>
		<dc:creator>MagicalTux</dc:creator>
				<category><![CDATA[Geek Attitude]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Apache module]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Dev]]></category>

		<guid isPermaLink="false">http://blog.magicaltux.net/?p=416</guid>
		<description><![CDATA[I&#8217;ve been fighting with apache during the past few days to try to accomplish something that has never been done until now. Apache has some nice included modules, for example mod_vhost_alias. This module allows someone to configure vhosts by just creating directories however it has some limitations: It will cause problems with some other modules [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been fighting with apache during the past few days to try to accomplish something that has never been done until now.</p>
<p>Apache has some nice included modules, for example mod_vhost_alias. This module allows someone to configure vhosts by just creating directories however it has some limitations:</p>
<ul>
<li>It will cause problems with some other modules like mod_rewrite</li>
<li>You can&#8217;t configure stuff (php options, etc) by host (only with .htaccess files, but you can&#8217;t alter all settings)</li>
<li>It can&#8217;t handle variable kinds of domains</li>
</ul>
<p>I decided to do something better, even with the people on #apache-modules (freenode) saying it&#8217;s not possible. It was even no possible to do this cleanly, however looking in apache&#8217;s code allowed me to reach my goal without too many problems, but with some really dirty parts.</p>
<h2>#define CORE_PRIVATE</h2>
<p>To reach my goal I needed to use some functions from Apache2&#8242;s core. I just wanted to say that I am really sorry, and won&#8217;t do it again (maybe). The functions I used are not meant to be used the way I used them, however I had no choice has there is no publicly available function to change the document root, or to inject configuration directives in the current request.</p>
<p>Anyway don&#8217;t do this at home, kids!</p>
<h2>ap_get_module_config(&#8230;, &amp;core_module)</h2>
<p>One of the keys to play with core config dynamically is to fetch it. This is the way to modify ap_document_root. I just return DECLINED after completing my dirty work to let apache think it still has to do its work. Yes this is dirty. But it works.</p>
<h2>ap_walk_config()</h2>
<p>Ever wanted to do bad things in a per-config context? Now you can. I won&#8217;t comment this too much, but I&#8217;ll just say that it saved me big time (this one is not part of CORE_PRIVATE, so you can use it freely I guess).</p>
<p>The final step was to make logging easier. I decided to throw all the logging info through a udg socket which is then collected by a daemon, stored locally, and transferred to the logging server at the same time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.magicaltux.net/2010/01/15/doing-the-impossible-with-apache-modules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft.com: no whois server was harmed!</title>
		<link>http://blog.magicaltux.net/2009/08/14/microsoft-com-no-whois-server-was-harmed/</link>
		<comments>http://blog.magicaltux.net/2009/08/14/microsoft-com-no-whois-server-was-harmed/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 23:01:26 +0000</pubDate>
		<dc:creator>MagicalTux</dc:creator>
				<category><![CDATA[Geek Attitude]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[pollution]]></category>
		<category><![CDATA[whois]]></category>

		<guid isPermaLink="false">http://blog.magicaltux.net/?p=301</guid>
		<description><![CDATA[Some French people are reporting without understanding what it is all about something almost as old as ICANN is: when you do a whois lookup on microsoft.com (for example) you get tons of unexpected replies&#8230; Reporting without knowledge (and without digging at least a bit about this) is like asking for a geek to slap [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogmotion.fr/internet/securite/googlemicrosoft-apple-yahoo-victimes-dun-dns-spamming-3807" target="_blank">Some</a> <a href="http://n0w.fr/microsoft-com-victime-dun-dns-spamming/" target="_blank">French</a> <a href="http://www.lezard-spock.com/dns-spamming-microsoft-google-etc.html" target="_blank">people</a> are reporting <strong>without understanding</strong> what it is all about something almost as old as ICANN is: when you do a whois lookup on microsoft.com (for example) you get tons of <em>unexpected replies</em>&#8230; Reporting without knowledge (and without digging at least a bit about this) is like asking for a geek to slap his blog in your face.<br />
This article will be a bit blunt, but that&#8217;s for your own good (next time try to at least search a bit on google/etc before saying whois servers were hacked).</p>
<p>Typical whois reply will look like:</p>
<pre>   Server Name: MICROSOFT.COM.ZZZZZZ.MORE.DETAILS.AT.WWW.BEYONDWHOIS.COM
   Server Name: MICROSOFT.COM.ZZZZZ.GET.LAID.AT.WWW.SWINGINGCOMMUNITY.COM
   Server Name: MICROSOFT.COM.ZZZZZ.<strong>DOWNLOAD.MOVIE.ONLINE</strong>.ZML2.COM
   Server Name: MICROSOFT.COM.ZZZOMBIED.AND.<strong>HACKED.BY.WWW.WEB-HACK.COM</strong>
   Server Name: MICROSOFT.COM.ZZZ.IS.0WNED.AND.HAX0RED.BY.SUB7.NET
   Server Name: MICROSOFT.COM.<strong>WILL.LIVE.FOREVER.BECOUSE.UNIXSUCKS</strong>.COM
   Server Name: MICROSOFT.COM.WILL.BE.SLAPPED.IN.THE.FACE.BY.MY.BLUE.VEINED.SPANNER.NET</pre>
<p>Of course it might looks like the whois server was hacked, that&#8217;s what people with bad knowledge of internet would think (hint: almost everything is explained in RFCs).<span id="more-301"></span></p>
<p>When you perform a whois lookup, the whois server will usually search domains and return you informations about the domain you requested. However on internet you also have <a href="http://en.wikipedia.org/wiki/Domain_name_system#Circular_dependencies_and_glue_records" target="_blank">Glue Records</a> which are searchable via whois.</p>
<p>When you perform a whois on, let&#8217;s say &#8220;microsoft.com&#8221;, the whois server will search all records that starts with <em>microsoft.com</em>. Now let&#8217;s say the owner of <em>spanner.net</em> created a glue record on <em>microsoft.com.will.be.slapped.in.the.face.by.my.blue.veined.spanner.net</em>, it will match.</p>
<p>Now lots of people did that, so whois records are full of glue records starting with <em>microsoft.com</em>. The only way to limit that is to code a limit in ICANN whois server. So it was decided that only 25 expanded or 50 name-only records would be shown. What happens to the real domain name? It&#8217;s also listed as one of the records, usually at the end.</p>
<p>So, nothing was hacked, <strong>no whois server was harmed</strong>, you just got a bunch of people who are exploiting a specific behaviour of the whois system to make their glue records get listed before the real domains. If you want to appear in microsoft.com you can create a glue record which would look like: <em>microsoft.com.zzzzzzzzzz.uh.did.you.wake.me.up.from.my.sleepdeprivation.com</em>.</p>
<p>Have fun posting stuff on your blog, but stop saying whois servers were hacked when they were not. Anyone who owns a domain name can create glue records, <strong>no hacking skills</strong> are required to achieve this. You are giving too much credit to guys who just pressed a few options in their registrar&#8217;s admin panel (and remember that you can be easily tracked back too). That&#8217;s far from what I would call &#8220;hacking&#8221;, and even not at the &#8220;script kiddie&#8221; level.</p>
<p>Oh and guyz, it&#8217;s been like this <strong>for a long time</strong> (first time I saw that there was only one record, it was in something like 1998. In the following years more and more records were added to finally reach today&#8217;s state). Remember to always verify your sources, even when you got <span style="text-decoration: line-through;">breaking</span> news like &#8220;microsoft.com was hacked&#8221;.</p>
<p>Finally, I find it amusing to see someone with a MacOS X machine called &#8220;bofh&#8221; and a green terminal (yay! old school) &#8220;discovering&#8221; a hack and feeling the urge to report it (and show his green terminal to the world, too). Mac OS X is not a hacker OS, and Apple&#8217;s whois client <strong>sucks</strong> &#8211; recent whois client add options to either only receive domain responses, or get expanded responses. Please use a real OS (FreeBSD, Linux Gentoo) or make your own.</p>
<p>Some of my favourite records from a LONG time ago:</p>
<pre>MICROSOFT.COM.SHOULD.GIVE.UP.BECAUSE.LINUXISGOD.COM
MICROSOFT.COM.SE.FAIT.HAX0RIZER.PAR.TOUT.LE.ZOY.ORG
MICROSOFT.COM.N-AIME.BILL.QUE.QUAND.IL.N-EST.PAS.NU
MICROSOFT.COM.MUST.STOP.TAKEDRUGS.ORG
MICROSOFT.COM.IS.NOTHING.BUT.A.MONSTER.ORG
MICROSOFT.COM.IS.AT.THE.MERCY.OF.DETRIMENT.ORG
MICROSOFT.COM.FAIT.VRAIMENT.DES.LOGICIELS.A.TROIS.FRANCS.DOUZE.ORG
MICROSOFT.COM.WILL.CRASH.IN.6MN.ORG
MICROSOFT.COM.IS.A.STEAMING.HEAP.OF.FUCKING-BULLSHIT.NET</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.magicaltux.net/2009/08/14/microsoft-com-no-whois-server-was-harmed/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>五OS Success on Panasonic CF-R6</title>
		<link>http://blog.magicaltux.net/2009/04/26/%e4%ba%94os-success-on-panasonic-cf-r6/</link>
		<comments>http://blog.magicaltux.net/2009/04/26/%e4%ba%94os-success-on-panasonic-cf-r6/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 20:21:15 +0000</pubDate>
		<dc:creator>MagicalTux</dc:creator>
				<category><![CDATA[Geek Attitude]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[OSDev]]></category>
		<category><![CDATA[Panasonic CF-R6]]></category>
		<category><![CDATA[五OS]]></category>

		<guid isPermaLink="false">http://blog.magicaltux.net/?p=264</guid>
		<description><![CDATA[After a few weeks of porting 五OS to 64bits and finally managed to get it running on QEmu, I tried running the resulting OS image on a real piece of hardware: my Panasonic CF-R6 from GeekStuff4U. Of course as I don&#8217;t want to bother yet with USB drivers (that&#8217;s next in line in the TODO [...]]]></description>
			<content:encoded><![CDATA[<p>After a few weeks of porting <a href="http://5os.net/" target="_blank">五OS</a> to 64bits and finally managed to get it running on <a href="http://www.qemu.org/" target="_blank">QEmu</a>, I tried running the resulting OS image on a real piece of hardware: my <a href="http://5os.net/wiki/CF-R6" target="_blank">Panasonic CF-R6</a> from <a href="http://www.geekstuff4u.com/" target="_blank">GeekStuff4U</a>.</p>
<p>Of course as I don&#8217;t want to bother yet with USB drivers (that&#8217;s next in line in the TODO list, but for now we can somewhat survive without), I decided to use our blkdev/bios driver (legacy 16bits driver via BIOS interrupts, using core/x86emu 16bits emulator).<br />
Same with graphics mode, don&#8217;t have a Intel driver yet, so we&#8217;ll use display/vesa_legacy 16bits driver (which also makes use of core/x86emu 16bits emulator to get graphics adapter&#8217;s bios working).</p>
<p>At first, I found out that the new compact bootloader wasn&#8217;t working properly. This was fixed by enabling Unreal Mode (a way of tricking the CPU into thinking ds and es segments are really mapped in 32bits mode while still being in 16bits mode).<br />
The next problem I encountered was when the &#8220;hard disk&#8221; (the usb drive, in fact) was detected, we couldn&#8217;t display the size. I tracked this to some weird bug in our current printf() implementation that makes a real system freeze when displaying a float (it works seamlessly on virtual system). Removing the display of detected disk size fixed this problem too, but it&#8217;s not a permanent fix.</p>
<p>Once those two points were fixed, everything else worked. I could access our marvelous &#8220;shell&#8221;, type commands (I issued &#8220;lsmod&#8221;, &#8220;cat sample.txt&#8221; and &#8220;modp misc/helloworld&#8221;) and see that it was good.</p>
<p>My RTL-8139 network controller was detected and module nic/rtl8139 loaded, IPv4 enabled, and most things were working. I believe the next step will be to test the scheduler, optimize it, and start working on the TCP stack. At the same time, a cache system at VFS level and another at block device level should be implemented using a kernel generic cache allocator (that will automatically free physical pages when memory is needed), process switching should make use of CR0.TS to know when we need to switch MMX/SSE2 context, and the keyboard input should be improved.<br />
At the same time, a generic HCI stack is needed for USB, and OHCI/EHCI/UHCI should be implemented (something has been started, but it&#8217;s far from complete).</p>
<p>Thanks for everyone who has been providing support to the project, I hope to be able to provide more impressive news soon ! <img src='http://blog.magicaltux.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://blog.magicaltux.net/wp-content/uploads/2009/04/dscn0816.jpg"><img class="alignnone size-thumbnail wp-image-265" title="五OS revision 651 on CF-R6" src="http://blog.magicaltux.net/wp-content/uploads/2009/04/dscn0816-150x150.jpg" alt="五OS revision 651 on CF-R6" width="150" height="150" /></a><a href="http://blog.magicaltux.net/wp-content/uploads/2009/04/dscn0814.jpg"><img class="alignnone size-thumbnail wp-image-266" title="Previous tests for Revision651 on CF-R6" src="http://blog.magicaltux.net/wp-content/uploads/2009/04/dscn0814-150x150.jpg" alt="Previous tests for Revision651 on CF-R6" width="150" height="150" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.magicaltux.net/2009/04/26/%e4%ba%94os-success-on-panasonic-cf-r6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Port knocking, how would I do?</title>
		<link>http://blog.magicaltux.net/2009/03/02/port-knocking-how-would-i-do/</link>
		<comments>http://blog.magicaltux.net/2009/03/02/port-knocking-how-would-i-do/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 20:28:08 +0000</pubDate>
		<dc:creator>MagicalTux</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Port knocking]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.magicaltux.net/?p=254</guid>
		<description><![CDATA[As I saw some articles which seems rather unexact relating port knocking, I would like to add some parts of my own idea about this. First, port knocking is not meant to be used alone&#8230; Even if you use your daemon&#8217;s default port (let&#8217;s say port 22 for sshd), port knocking can protect you more [...]]]></description>
			<content:encoded><![CDATA[<p>As I saw <a href="http://www.linux.com/articles/37888" target="_blank">some articles which seems rather unexact relating port knocking</a>, I would like to add some parts of my own idea about this.</p>
<p>First, port knocking is <em>not</em> meant to be used alone&#8230;</p>
<p>Even if you use your daemon&#8217;s default port (let&#8217;s say port 22 for sshd), port knocking can protect you more than you can even imagine. Let&#8217;s take the following setup:</p>
<ul>
<li>SSHd running on port 65122</li>
<li>Connections to port 65122 are replied with &#8220;connection refused&#8221; (via an icmp target rule)</li>
<li>In order to &#8220;open&#8221; port 65122, connection attempts must be made to ports 22448, 44228 and 22884 in this order. Any other order will blacklist the IP attempting to connect for 1 hour</li>
<li>More than 5 attempts to connect to port 65122 within 20 minutes will result in 1 hour blacklist</li>
</ul>
<p>Now, if you&#8217;re that smart, just try to find your way in without the &#8220;passphrase&#8221; (which is 22448-44228-22884-65122). If you do too many attempts, you&#8217;ll end blacklisted. Let&#8217;s say you found out that port 65122 gets you banned when you connect, and have determined that you can make up to 5 attempts in 20 minutes. Let&#8217;s also say you know you have to knock exactly 3 ports to be able to connect.<br />
You then have to test 65536^3 = 281474976710656 combinations, and can only test 5 in 20 minutes, that would require 70368744177660 minutes (133882694 years or so).</p>
<p>I can assume no decent system will be up for 133882694 years without any shift into security settings. You can parallelize that with different source IPs, but it will still last too long against people shifting every 3~6 months.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.magicaltux.net/2009/03/02/port-knocking-how-would-i-do/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP DNS Daemon: performances</title>
		<link>http://blog.magicaltux.net/2009/02/18/php-dns-daemon-performances/</link>
		<comments>http://blog.magicaltux.net/2009/02/18/php-dns-daemon-performances/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 06:23:46 +0000</pubDate>
		<dc:creator>MagicalTux</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Benchmark]]></category>
		<category><![CDATA[DNSd]]></category>
		<category><![CDATA[PInetd]]></category>

		<guid isPermaLink="false">http://blog.magicaltux.net/?p=239</guid>
		<description><![CDATA[Many people seems to have taken interest into my weird idea to write a PHP DNS daemon in PHP, so I decided to run some experiments. The first one was to setup ~200 domains to this dns server (including my blog&#8217;s one), the second one is to run queryperf against it, and against bind9 running [...]]]></description>
			<content:encoded><![CDATA[<p>Many people seems to have taken interest into my weird idea to write a PHP DNS daemon in PHP, so I decided to run some experiments. The first one was to setup ~200 domains to this dns server (including my blog&#8217;s one), the second one is to run queryperf against it, and against bind9 running on the same host, with the same configuration (ie. same domain list, no recursion, etc).</p>
<h3>First, the host:</h3>
<ul>
<li>CPU: 2x Intel Xeon E5405 (2GHz) ; a total of 8 cores</li>
<li>RAM: 8GB RAM (4x 2GB DDR2 @667Mhz)</li>
<li>Hard Disk: 2x1TB HDD (RAID 1, 3ware Inc 7xxx/8xxx-series PATA/SATA-RAID) ; total of 1TB usable</li>
<li>OS: Linux Gentoo 64bits 2008.0 (multilib) with Linux Kernel 2.6.27-gentoo-r2</li>
</ul>
<p>The test itself will be a 1 million random queries generated by <em>gen-data-queryperf.py</em> with 40% of random domains.</p>
<h3>Some words on results</h3>
<p>First, I&#8217;d like to say that pinetd2 is still under development, some parts are still not implemented (the DNS server is able to act as a DNS server, that&#8217;s the important part for me), and also some optimizations weren&#8217;t done yet (for example a query will always cause the same SQL statements to be run, I could prepare those).<br />
The fact I&#8217;m running SQLite means the SQL server isn&#8217;t able to cache results (the db file might be modified by anyone, anytime, however I don&#8217;t know the exact internals of SQLite), and I don&#8217;t cache anything either.</p>
<p>When I started writing DNSd, I didn&#8217;t especially try to go on performances, features were importants, and realtime was too. Many improvements to speed can still be done (I&#8217;m thinking &#8220;prepared statments&#8221; right now, but also caching domains list, etc) and would help to get those numbers closer to ISC BIND.</p>
<p>The fact DNSd is 1/4 the speed of BIND (2531.89 queries/sec instead of 10071.2 queries/seq, my dns server is runnnin at 25.14% the speed of bind) is <em>impressive</em>. I guess we&#8217;ll need more tests, with different backends (MySQL is also supported, in theory) and different hosts, but I was supposing the database overhead would be bigger than that (well, SQLite is fast, but I wasn&#8217;t expecting that fast).</p>
<p>To tell you the truth, I am <em>surprised</em> by those results, however these are results on a real host, really running domains (like my blog&#8217;s domain), which makes me believe those results are the closest I could get from DNSd performances on a real host.</p>
<p>Now, the raw test results with both bind and PHP DNSd, running from the same host (to avoid network latency, and since I got 8 cores with almost no CPU usage as it&#8217;s morning in France, it shouldn&#8217;t make a big difference).</p>
<p>Other test results with other hardwares are welcome. I&#8217;ll try running the same kind of tests on less powerful hardware too, just to see what I get.</p>
<h3><span id="more-239"></span>ISC BIND 9.6.0-P1</h3>
<pre>DNS Query Performance Testing Tool
Version: $Id: queryperf.c,v 1.12 2007/09/05 07:36:04 marka Exp $</pre>
<pre>[Status] Processing input data
[Status] Sending queries (beginning with 91.121.45.45)
[Status] Testing complete</pre>
<pre>Statistics:</pre>
<pre>  Parse input file:     once
  Ended due to:         reaching end of file</pre>
<pre>  Queries sent:         1000000 queries
  Queries completed:    1000000 queries
  Queries lost:         0 queries
  Queries delayed(?):   0 queries</pre>
<pre>  RTT max:         	0.605333 sec
  RTT min:              0.000035 sec
  RTT average:          0.001974 sec
  RTT std deviation:    0.002666 sec
  RTT out of range:     0 queries</pre>
<pre>  Percentage completed: 100.00%
  Percentage lost:        0.00%</pre>
<pre>  Started at:           Wed Feb 18 06:36:21 2009
  Finished at:          Wed Feb 18 06:38:00 2009
  Ran for:              99.293069 seconds</pre>
<pre>  Queries per second:   10071.196409 qps</pre>
<h3>PHP DNSd (revision 301) with PHP 5.3.0beta1 and SQLite3 (bundled libsqlite)</h3>
<pre>DNS Query Performance Testing Tool
Version: $Id: queryperf.c,v 1.12 2007/09/05 07:36:04 marka Exp $</pre>
<pre>[Status] Processing input data
[Status] Sending queries (beginning with 87.98.170.177)
[Status] Testing complete</pre>
<pre>Statistics:</pre>
<pre>  Parse input file:     once
  Ended due to:         reaching end of file</pre>
<pre>  Queries sent:         1000000 queries
  Queries completed:    1000000 queries
  Queries lost:         0 queries
  Queries delayed(?):   0 queries</pre>
<pre>  RTT max:         	0.645355 sec
  RTT min:              0.000036 sec
  RTT average:          0.007884 sec
  RTT std deviation:    0.004824 sec
  RTT out of range:     0 queries</pre>
<pre>  Percentage completed: 100.00%
  Percentage lost:        0.00%</pre>
<pre>  Started at:           Wed Feb 18 06:38:41 2009
  Finished at:          Wed Feb 18 06:45:16 2009
  Ran for:              394.961920 seconds</pre>
<pre>  Queries per second:   2531.889657 qps</pre>
<h3>One (or more) last word(s)</h3>
<p>The test method is inspired from a link given by <a href="http://om4.com.au/" target="_blank">James Collins</a>: &#8220;<a href="http://www.generic-nic.net/sheets/practical/nameserver-en" target="_blank">the choices for a nameserver</a>&#8220;. While comparison can&#8217;t be done between the results there and mine (bind&#8217;s result are similar, but as said, there were problems with PowerDNS and anyway we are not running in the same conditions) it still looks like I got some chances into getting closer to be a &#8220;real&#8221; dns server, with PHP code!</p>
<p>Anyway, remember that &#8220;t<span class="quote">here are two sort of lies, lies and benchmarks.</span>&#8221; (source: the previous document).</p>
<p>Now, I guess I have no other choice than writing documentation about &#8220;how to install DNSd&#8221; and &#8220;how to setup a DNSd slave&#8221;, that&#8217;s going to be fun (if anyone can help, I&#8217;d be happy, got a public wiki where the doc can be publied).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.magicaltux.net/2009/02/18/php-dns-daemon-performances/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Mantis BugTracker: exploited for defacement</title>
		<link>http://blog.magicaltux.net/2008/12/20/mantis-bugtracker-exploited-for-defacement/</link>
		<comments>http://blog.magicaltux.net/2008/12/20/mantis-bugtracker-exploited-for-defacement/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 23:46:57 +0000</pubDate>
		<dc:creator>MagicalTux</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[mantis]]></category>

		<guid isPermaLink="false">http://blog.magicaltux.net/?p=196</guid>
		<description><![CDATA[OpenOptimus&#8217; website has been defaced because of an exploit in Mantis BugTracker, but mostly because I totally forgot to update this thing for ages. The site has been taken down, since our little script-kiddie think he&#8217;s so smart he could host stuff there without root noticing anything (chmod 0000 owned him).]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-197" title="Cat ready to attack mantis" src="http://blog.magicaltux.net/wp-content/uploads/2008/12/mantis.jpg" alt="Cat ready to attack mantis" width="500" height="331" /></p>
<p>OpenOptimus&#8217; website has been defaced because of an exploit in Mantis BugTracker, but mostly because I totally forgot to update this thing for ages.</p>
<p>The site has been taken down, since our little script-kiddie think he&#8217;s so smart he could host stuff there without root noticing anything (chmod 0000 owned him).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.magicaltux.net/2008/12/20/mantis-bugtracker-exploited-for-defacement/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SSL server: how to autodetect SSL/non-SSL?</title>
		<link>http://blog.magicaltux.net/2008/12/07/ssl-server-how-to-autodetect-sslnon-ssl/</link>
		<comments>http://blog.magicaltux.net/2008/12/07/ssl-server-how-to-autodetect-sslnon-ssl/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 22:11:57 +0000</pubDate>
		<dc:creator>MagicalTux</dc:creator>
				<category><![CDATA[Geek Attitude]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Async]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://blog.magicaltux.net/?p=188</guid>
		<description><![CDATA[For those of you who already played with Webmin, you probably noticed that connecting without SSL to the webmin interface (typically on port 10000) displays a message telling you how to access the SSL secured interface&#8230; on the same port. Ever wondered how to accept both SSL and non-SSL connections on the same port? Basically, [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you who already played with <a href="http://www.webmin.com/" target="_blank">Webmin</a>, you probably noticed that connecting without SSL to the webmin interface (typically on port 10000) displays a message telling you how to access the SSL secured interface&#8230; on the same port.</p>
<p>Ever wondered how to accept both SSL and non-SSL connections on the same port?</p>
<p>Basically, to display such a message, we need to know if the client talking to us is speaking using SSL, or not. This is easily done by reading a few bytes from the stream, but if you do this, starting the crypto using for example <a href="http://php.net/stream_socket_enable_crypto" target="_blank">stream_socket_enable_crypto()</a> will fail, since OpenSSL won&#8217;t find the full client SSL handshake anymore.</p>
<p>PHP offers us a nice solution to fix this, using <a href="http://php.net/stream_socket_recvfrom" target="_blank">stream_socket_recvfrom()</a>. By passing option <em>STREAM_PEEK</em> to this function, we can take a peek at the data pending in the socket, and try to determine if that&#8217;s SSL or not.</p>
<p>There, we can either try to parse a SSL packet, or instead try to find data we know there should be if the stream is not encrypted.</p>
<p>Doing this for the HTTP protocol is easy. The protocol is text based, and the first word we will get from the client will be something like &#8220;GET&#8221;, &#8220;POST&#8221; or &#8220;HEAD&#8221;. We just check if we got any of those. If we did, we got plain text connection. If we don&#8217;t, it means we are probably facing a real openssl client, and we can try to start negociating the link.</p>
<p>I wrote a little example you can download via SVN at <a href="http://ookoo.org/svn/snip/https_multi_serv/" target="_blank">http://ookoo.org/svn/snip/https_multi_serv/</a>. Just run &#8220;gen_key.sh&#8221; in the ssl directory to get a SSL private key, then run the server with PHP. By default it will listen on port 8000, so direct your browser to localhost:8000 with or without SSL (both will work, this is the point of this server).</p>
<p>Feel free to use the code there, I commented it a bit so it should be somewhat helpful, and I officially release it under public domain (or BSD if &#8220;public domain&#8221; does not legally exists in your country).</p>
<p>By the way it&#8217;s also a nice example of async server using <a href="http://php.net/stream_select" target="_blank">stream_select()</a>.</p>
<p>Of course it&#8217;s not possible to <em>auto-magically</em> determine if the client is talking SSL when he&#8217;s not talking first. You could wait for one or two seconds to see if something comes (ie. an SSL handshake) but it&#8217;s not really something that could be called <em>good practice</em>&#8230; So let&#8217;s just keep this for cases where the client talks first.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.magicaltux.net/2008/12/07/ssl-server-how-to-autodetect-sslnon-ssl/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
