<?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>Parallel Interface &#187; Other technical</title>
	<atom:link href="http://www.paralint.com/blog/category/other-technical/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.paralint.com/blog</link>
	<description>Programming security in C++, Java and Python, one line at a time</description>
	<lastBuildDate>Fri, 09 Dec 2011 14:32:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Find new, modified and unversioned Subversion files on Windows</title>
		<link>http://www.paralint.com/blog/2011/12/09/find-new-modified-and-unversioned-subversion-files-on-windows/</link>
		<comments>http://www.paralint.com/blog/2011/12/09/find-new-modified-and-unversioned-subversion-files-on-windows/#comments</comments>
		<pubDate>Fri, 09 Dec 2011 04:52:01 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Other technical]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">https://www.paralint.com/blog/?p=171</guid>
		<description><![CDATA[Nobody likes to break the build. When I do it, it is often because I forgot to add a file to the repository. The build server will not get it and the build will break. This Windows batch file will parse Subversion&#8217;s svn up output and show you what files were modified, but also what [...]]]></description>
			<content:encoded><![CDATA[<p>Nobody likes to break the build. When I do it, it is often because I forgot to add a file to the repository. The build server will not get it and the build will break.</p>
<p>This Windows batch file will parse Subversion&#8217;s <code>svn up</code> output and show you what files were modified, but also what files should be added.</p>
<p>It looks for C++, C, H, PHP, Python, Java and then some. You can easily add your own to the list.</p>
<p>To use simply call localfiles.bat from any versionned directory. Anything you add to the command line will be passed along to <code>svn up</code>. Try these variations :</p>
<ul>
<li><code>localfiles.bat -u</code><code> to see potential update conflicts.</code></li>
<li><code>localfiles.bat c:\the\path\to\my\project\sources</code><code> works, you can run the command from anywhere</code></li>
<li><code>localfiles.bat --ignore-externals</code><code> or any other Subversion command you can think of</code></li>
</ul>
<p>In the sample output (below) you will see</p>
<ul>
<li>New Source Files are source that were added (localy) but never comitted.</li>
<li>Modified Source Files are source that are under source control and were modified locally.</li>
<li>Unversioned Source Files are source that probably should be under source control.</li>
<li>Each file is listed, with (no source file) if it looks ok.</li>
</ul>
<pre>$ localfiles.bat C:\Users\Guillaume\src\Projects\aucun.selfserve

Gathering data...

======================================
 New sourcefiles
======================================
(none found)

======================================
 Modified sourcefiles
======================================
M       C:\Users\Guillaume\src\Projects\aucun.selfserve\GINA\SecurityHelper.cpp
M       C:\Users\Guillaume\src\Projects\aucun.selfserve\GINA\loggedout_dlg.cpp
M       C:\Users\Guillaume\src\Projects\aucun.selfserve\common\Trace.c
M       C:\Users\Guillaume\src\Projects\aucun.selfserve\GINA\GinaHook.c

======================================
 Unversioned files
======================================
?       C:\Users\Guillaume\src\Projects\aucun.selfserve\GINA\StaticPrompt.cpp
?       C:\Users\Guillaume\src\Projects\aucun.selfserve\shellie\shellie_p.c
?       C:\Users\Guillaume\src\Projects\aucun.selfserve\shellie\dlldata.c
?       C:\Users\Guillaume\src\Projects\aucun.selfserve\shellie\shellie_i.c
?       C:\Users\Guillaume\src\Projects\aucun.selfserve\shellie\shellie.h</pre>
<p><a href="/blog/wp-content/uploads/2011/12/localfiles.txt">Here is the file</a>. I gave it a txt extension, in case you are behing a paranoïac corporate proxy.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2011/12/09/find-new-modified-and-unversioned-subversion-files-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bug dans le changement de mot de passe SMTP de Videotron</title>
		<link>http://www.paralint.com/blog/2011/09/26/bug-dans-le-changement-de-mot-de-passe-smtp-de-videotron/</link>
		<comments>http://www.paralint.com/blog/2011/09/26/bug-dans-le-changement-de-mot-de-passe-smtp-de-videotron/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 03:55:20 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[En français]]></category>
		<category><![CDATA[Other technical]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/2011/09/26/bug-dans-le-changement-de-mot-de-passe-smtp-de-videotron/</guid>
		<description><![CDATA[Le site de support à la clientèle de Vidétron offre la possibilité de changer le mot de passe STMP ou POP associé à votre compte. Ce mot de passe n’est pas le même que celui utilisé pour ouvrir une session dans l’espace client. Votre code d’utilisateur débute par VL (en minuscule, pour Videotron lté) vlxxxxxx [...]]]></description>
			<content:encoded><![CDATA[<p>Le site de support à la clientèle de Vidétron offre la possibilité de changer le mot de passe STMP ou POP associé à votre compte. Ce mot de passe n’est pas le même que celui utilisé pour ouvrir une session dans l’espace client. Votre code d’utilisateur débute par VL (en minuscule, pour Videotron lté) vlxxxxxx et vous avez un mot de passe associé pour la réception de courriel SMTP. </p>
<p>J’ai eu à changer ce mot de passe et j’ai bloqué longtemps sur le problème suivant. Et non, je n’ai pas essayé de contacter le support technique à ce sujet, des plans pour qu’ils me demandent de formatter mon PC.</p>
<p>En fait, c’est tout simple. Lorsque vous entrez votre mot de passe dans ce formulaire les majuscules sont converties en minuscules, tout simplement.:</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="ntd3eFUc" border="0" alt="ntd3eFUc" src="http://www.paralint.com/blog/wp-content/uploads/2011/09/ntd3eFUc.jpg" width="433" height="318" /></p>
<p>Je me suis douté de quelque chose quand les mots de passe générés par Password Safe ne fonctionnais pas, mais les blasphèmes et insultes marchait tout le temps… Pas de majuscules !</p>
<p>Alors allez vous choisir un nouveau mot de passe SMTP, tout en minuscules. Nous savons tous qu’il n’a pas changé depuis 5 ans au moins !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2011/09/26/bug-dans-le-changement-de-mot-de-passe-smtp-de-videotron/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Edit a remote registry through Windbg</title>
		<link>http://www.paralint.com/blog/2011/03/29/edit-a-remote-registry-through-windbg/</link>
		<comments>http://www.paralint.com/blog/2011/03/29/edit-a-remote-registry-through-windbg/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 03:02:02 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Other technical]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/2011/03/29/edit-a-remote-registry-through-windbg/</guid>
		<description><![CDATA[I found a way to edit the registry while under a remote Windbg session. !dreg allows you to read the registry, but I had added a corrupt authentication package to the Lsa list in the registry that I had to remove. I found out the hard way that LSASS will load all authentication packages listed, [...]]]></description>
			<content:encoded><![CDATA[<p>I found a way to edit the registry while under a remote Windbg session. !dreg allows you to read the registry, but I had added a corrupt authentication package to the Lsa list in the registry that I had to remove. I found out the hard way that LSASS will load all authentication packages listed, even if you boot in safe mode.</p>
<p>Fortunately, I had <a href="http://blogs.msdn.com/b/alejacma/archive/2007/11/13/how-to-debug-lsass-exe-process.aspx" target="_blank">set up LSASS to run under ntsd</a>, which was connected to a remote Windbg.</p>
<p>To edit the registry of a remote machine running under a debugger :</p>
<ol>
<li>Break into the debugger. This step will happen naturally in most snafu <img class="wlEmoticon wlEmoticon-winkingsmile" style="border-style: none;" src="http://www.paralint.com/blog/wp-content/uploads/2011/03/wlEmoticon-winkingsmile.png" alt="Winking smile" /></li>
<li>Start a shell with the .! command</li>
<li>Fix the registry with the command line <span style="font-family: 'Courier New'; font-size: small;">reg.exe</span> tool. For example, to restore authentication packages type
<pre>reg add HKLM\SYSTEM\CurrentControlSet\Control\Lsa /v "Authentication packages" /t REG_MULTI_SZ /d msv1_0</pre>
</li>
<li>Type <span style="font-family: 'Courier New';">exit</span> to quit the shell (hit Enter enough times to get back to Windbg’s prompt)</li>
</ol>
<p>Then use the <span style="font-family: 'Courier New'; font-size: small;">g</span> command to resume execution.</p>
<p>As a side note : The windows subsystem is fully loaded before LSASS.exe starts, or at least there is enough of it to launch CMD.exe and REG.exe.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2011/03/29/edit-a-remote-registry-through-windbg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to debug a Credential Provider locally</title>
		<link>http://www.paralint.com/blog/2011/03/26/how-to-debug-a-credential-provider-locally/</link>
		<comments>http://www.paralint.com/blog/2011/03/26/how-to-debug-a-credential-provider-locally/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 05:11:12 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Other technical]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/2011/03/26/how-to-debug-a-credential-provider-locally/</guid>
		<description><![CDATA[Here is a quick and easy way to debug a Credential Provider running on your development machine, without needing to set up a kernel debugging session with two computers. Before you go down this road, let me tell you a little bit about LogonUI.exe behavior (as seen on Windows 7 ultimate SP1 64 bits) set [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick and easy way to debug a Credential Provider running on your development machine, without needing to set up a kernel debugging session with two computers. Before you go down this road, let me tell you a little bit about LogonUI.exe behavior (as seen on Windows 7 ultimate SP1 64 bits) set to require CTRL-ALT-DEL to log on.</p>
<ul>
<li>Every time you type CTRL-ATL-DEL, a new LogonUI process is launched. </li>
<li>LogonUI will try to load any registered Credential Providers COM objects. </li>
<li>You can <a href="/blog/2011/03/15/can-your-gina-do-this/" target="_blank">run any process on the secure desktop</a> </li>
</ul>
<p>With that knowledge, it is easy to set up a debugging session for your Credential Provider, right on your development machine. Before I continue, be aware that it might affect the stability of your computer temporarily, as the following illustration shows. </p>
<p><img style="margin: 0px auto; display: block; float: none" title="6015610" alt="6015610" src="http://www.paralint.com/blog/wp-content/uploads/2011/03/6015610.jpg" width="400" height="400" /></p>
<p><span id="more-163"></span>
<p>To debug your credential provider, you will need this :</p>
<ul>
<li>A CredentialProvider that can be loaded by LogonUI </li>
<li>Microsoft’s <a href="http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx" target="_blank">Debugging Tools for Windows</a> </li>
<li>Microsoft’s <a href="http://technet.microsoft.com/en-us/sysinternals/bb897553" target="_blank">psexec</a> tool (of Sysinternals fame) </li>
</ul>
<p>I guess you could also use Visual Studio instead, ymmv. If it works, please drop us a line in the comments.</p>
<p>To start debugging, here is what you have to do:</p>
<ol>
<li>Start a <a href="/blog/2011/03/15/can-your-gina-do-this/" target="_blank">command shell on the Secure Desktop</a> with this command:       <br /> 
<pre>psexec -dsx cmd.exe</pre>
</li>
<li>Build a debug version of your Credential Provider and register it. </li>
<li>Type CTRL-ALT-DEL to switch to the secure desktop. That will also launch LogonUI.exe </li>
<li>Hit Alt-Tab to switch to the command prompt you started at step 1 </li>
<li>Change to the directory where your source code is </li>
<li>Debug LogonUI.exe and set the source path at once, with this command :<br />
    </p>
<pre>windbg –pn logonui.exe –srcpath %CD%</pre>
</li>
</ol>
<p>That’s it. You might not be very familiar with windbg, so here are a few tips to get you started:</p>
<ul>
<li>When you attached to LogonUI at step 6, the process is stopped. You can enter commands to set breakpoints before resuming it. </li>
<li>Verify that your Credential Provider is loaded with the <font size="3" face="Courier New">lm</font> command. Look for a string like this one:
<p></p>
<pre>000007fe`f5e80000 000007fe`f5e9b000&#160;&#160; SampleCredentialProvider&#160;&#160; (private pdb symbols)</pre>
</li>
<li>Just to be sure, verify that a specific symbol is loaded with this command (you should get an address):<br />
    </p>
<pre>x SampleCredentialProvider!CSampleProvider::SetUsageScenario</pre>
</li>
<li>Set a breakpoint to the same location with this command:<br />
    </p>
<pre>bu SampleCredentialProvider!CSampleProvider::SetUsageScenario</pre>
</li>
<li>Resume LogonUI with the <font size="3" face="Courier New">g</font> command. </li>
</ul>
<p>You can now lock your workstation and try to unlock it. When LogonUI appears to freeze, ATL-TAB to the debugger. It should be waiting for you with the source file loaded, waiting for your instructions. Type g to resume. Complete the unlock procedure to end LogonUI. </p>
<p>To reattach to logon UI, you can quit windbg and launch it again, but it is easier to list the process with the <font size="3" face="Courier New">.tlist</font> command (LogonUI.exe will be the last in the list). Attach to it again with <font size="3" face="Courier New">.attach 0n2331</font> (replace with your PID).</p>
<p>Happy debugging !</p>
<p>&#160;</p>
<p><font size="2">Image credits : </font><a href="http://www.123rf.com/photo_6015610_idiot-saws-branch.html"><font size="2">http://www.123rf.com/photo_6015610_idiot-saws-branch.html</font></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2011/03/26/how-to-debug-a-credential-provider-locally/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Unlocking another user&#8217;s session using Credential Providers</title>
		<link>http://www.paralint.com/blog/2011/03/24/unlocking-another-users-session-using-credential-providers/</link>
		<comments>http://www.paralint.com/blog/2011/03/24/unlocking-another-users-session-using-credential-providers/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 13:08:08 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Other technical]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/?p=153</guid>
		<description><![CDATA[I have been working a little bit lately on a Credential Provider port of my custom GINA. I did some tests, I poked around the API and I whipped together something I could load and play with. The route I first thought of taking is still the right one, but I ran into some unexpected [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working a little bit lately on a Credential Provider port of my custom GINA. I did some tests, I poked around the API and I whipped together something I could load and play with. The <a href="/blog/2009/02/24/porting-a-custom-gina-to-a-credential-provider/">route I first thought of taking is still the right one</a>, but I ran into some unexpected problems.</p>
<p>Microsoft new architecture is better, but the separation it enforces makes it hard to play tricks with the security policy. First, there are no shortcuts with Credential Providers. The <a href="http://archive.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=ShellRevealed&amp;DownloadId=7341">documentation</a> is formal :</p>
<blockquote><p>CredentialProviders are not enforcement mechanisms. They are used to gather and serialize credentials. The Local Authority and Authentication Packages enforce security.</p></blockquote>
<p>So we have to use an authentication package with the credential provider. Nothing that we didn&#8217;t see coming. I have played with authentication packages before, it just a matter of writing one.</p>
<p>Second, LogonUI will not kill another user&#8217;s session. I am able to get a credential provider tile on the unlock screen, logon with administrator credentials, but then I get this error message :</p>
<blockquote><p>This computer is locked. Only the logged on user can unlock the computer.</p></blockquote>
<p>Which makes some sense: why kill (or unlock) a user&#8217;s session if you can just start a new session next to it ? Unfortunatly, it does not help the most common use case my custom GINA users need to solve: many users need to access a single application running in a single session.</p>
<p>But I haven&#8217;t given up yet.</p>
<p>I tested on Windows 7 Ultimate 64bits, with or without fast user switching. If you ever able to unlock another user&#8217;s session, write a line in the comments. I would love to hear about it.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2011/03/24/unlocking-another-users-session-using-credential-providers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Can your GINA do this ? (running any process on the secure desktop)</title>
		<link>http://www.paralint.com/blog/2011/03/15/can-your-gina-do-this/</link>
		<comments>http://www.paralint.com/blog/2011/03/15/can-your-gina-do-this/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 03:06:17 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Other technical]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/2011/03/15/can-your-gina-do-this/</guid>
		<description><![CDATA[I get asked a lot of questions about my custom Gina. Most of them come from people who want to write a custom Gina themselves to do … whatever. A custom Gina runs in Winlogon’s process. It runs under the SYSTEM account, in the TCB… In short it can do pretty much anything. But some [...]]]></description>
			<content:encoded><![CDATA[<p>I get asked a lot of questions about my custom Gina. Most of them come from people who want to write a custom Gina themselves to do … whatever.</p>
<p>A custom Gina runs in Winlogon’s process. It runs under the SYSTEM account, in the TCB… In short it can do pretty much anything. But some things just can’t be done, no matter what rights you have.</p>
<p>Fortunately, there is an easy way to tell if a GINA can do what you need it to do, without having to write a single line of code. </p>
<p><span id="more-152"></span>
<p>The trick is to launch a cmd.exe shell (or whatever shell you prefer) on the Winlogon desktop. I used to work with <a href="http://www.ikriv.com/en/prog/tools/EnumWinstaGui/" target="_blank">EnumWinStaGui</a>, but <a href="http://technet.microsoft.com/en-us/sysinternals/bb897553" target="_blank">Microsoft’s own psexec (of Sysinternals fame)</a> is easier to use. </p>
<p>To run a cmd shell on Winlogon desktop, do the following :</p>
<ol>
<li>Logon with an account with administrator rights </li>
<li>Open a command prompt (elevated if you are on Vista or later) </li>
<li>Type this command :      <br /> 
<pre>psexec –dsx cmd.exe</pre>
</li>
</ol>
<p>That’s it ! You will not see your shell, because it is running on the current desktop. To verify that it works, hit CTRL-ALT-DEL and your command prompt will be there. On Vista and later, it will be hidden under the full screen logon application (logonui.exe). Just ALT-TAB to it. That shell will keep running even if you log out, because it is not tied to the interactive session you used to start it. From that command line on the secure desktop, launch whatever command you need to confirm that what you want to do can be done. </p>
<p>For example, say you need to launch a process that will notify a web application just before the password is validated, maybe to start a timekeeping application. Can it be done ? Yes. On the command line running on the secure desktop, type this command :</p>
<pre>start iexplore http://www.paralint.com/</pre>
<p>It might not work. Maybe your proxy is not set up in the SYSTEM account ? Whatever the problem may be, you need to fix it. Writing a custom Gina is a waste of time if you can’t get past this step. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2011/03/15/can-your-gina-do-this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion GUI output from the command line</title>
		<link>http://www.paralint.com/blog/2011/02/16/subversion-gui-output-from-the-command-line/</link>
		<comments>http://www.paralint.com/blog/2011/02/16/subversion-gui-output-from-the-command-line/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 04:22:09 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Other technical]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/2011/02/16/subversion-gui-output-from-the-command-line/</guid>
		<description><![CDATA[I use Subversion command line client. But I also have Tortoise SVN installed, because some operations like log and check-in benefit from the GUI. Tortoise SVN is a Explorer shell extension which calls a Windows executable, TortoiseProc.exe. To use it from the command line, simply save this batch file somewhere in your path : @echo [...]]]></description>
			<content:encoded><![CDATA[<p>I use Subversion command line client. But I also have <a href="http://tortoisesvn.tigris.org/">Tortoise SVN</a> installed, because some operations like log and check-in benefit from the GUI.</p>
<p>Tortoise SVN is a Explorer shell extension which calls a Windows executable, TortoiseProc.exe. </p>
<p>To use it from the command line, simply save this batch file somewhere in your path :</p>
<pre class="generic:nogutter:nocontrols" name="code">@echo off
start &quot;&quot; &quot;C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe&quot;&#160; /command:%1 /path:&quot;%2&quot;</pre>
<p>Then simply call like this :</p>
<pre class="generic:nogutter:nocontrols" name="code">tortoise log http://src.pararlint.com/aucun/trunk</pre>
<p>or like this</p>
<pre class="generic:nogutter:nocontrols" name="code">tortoise commit .</pre>
<p>Tested on Windows with 32 and 64 bits version.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2011/02/16/subversion-gui-output-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Porting a custom Gina to a Credential provider</title>
		<link>http://www.paralint.com/blog/2009/02/24/porting-a-custom-gina-to-a-credential-provider/</link>
		<comments>http://www.paralint.com/blog/2009/02/24/porting-a-custom-gina-to-a-credential-provider/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 02:27:36 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Other technical]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/?p=108</guid>
		<description><![CDATA[Making a replacement Gina behave like a Credential Provider (not the other way around) looks like the ticket to have a single source solution to a Gina and Credential Provider.]]></description>
			<content:encoded><![CDATA[<p>I am still amazed by the popularity of <a title="Any user can unlock now with this replacement Gina" href="/projects/aucun/">my replacement Gina</a> (it allows any user to unlock). Most users are quite happy using it with Windows XP and Server 2003, but I do get the occasionnal request for a Vista port. I am looking forward to doing it, but there are important desing changes that I must work with. I think I found a way to have a single source solution Gina and Credential Provider, with a clean architecture on any Windows version.</p>
<p><span id="more-108"></span>Credential Providers cannot make an authentication decision. They only collect credentials. The approach I took in &#8220;Aucun&#8221; is that the Gina actually makes the authentication decision. That will not work under the new Credential provider architecture.</p>
<p>When I started looking to port my Gina to a Credential Provider, I first though of saving the initial credentials (when the first user logs on), then check any other user&#8217;s credential in my own Credential Provider, and if all is good, replay the initial credentials.</p>
<p>That bothered on many grounds :</p>
<ul>
<li>There will be a unlock event logged to the initial user, although that user never unlocked the workstation</li>
<li>I don&#8217;t like saving passwords, even to encrypted memory</li>
<li>That architecture didn&#8217;t look like something that would last</li>
</ul>
<p>Looking deeper into the Credential Provider interface, I saw that there is one decision a Credential Provider <span style="text-decoration: underline;">can</span> make. It can select what Authentication Package will honor the logon request (or unlock request, in my case). That takes place in my (your) <a href="http://msdn.microsoft.com/en-us/library/bb776026(VS.85).aspx">ICredentialProviderCredential::GetSerialisation</a>, by setting the ulAuthenticationPackage field of the <a href="http://msdn.microsoft.com/en-us/library/bb773242(VS.85).aspx">CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION</a> structure.</p>
<p>So I believe the right way of doing this is to have two components :</p>
<ol>
<li>An authentication package that implements the unlock policy (any user can unlock, depending on group membership).</li>
<li>A credential provider that collects credentials (and while you&#8217;re at it, the session you want to unlock) and instruct winlogon to forward them the &#8220;unlock&#8221; authentication package.</li>
</ol>
<p>That architecture fixes all three points above. And as a bonus, I can greatly simplify my existing Gina by merely collecting the credentials and forward them to the same authentication package. No need to hook dialog procedures and sending magic, reversed engineered constants to winlogon. In short, instead of making the Credential Provider look like a Gina, I make the Gina behave like a Credential Provider.</p>
<p>Authentication packages are the same under Vista and XP, that&#8217;s a good thing. But to <a href="http://blogs.msdn.com/alejacma/archive/2007/11/13/how-to-debug-lsass-exe-process.aspx">debug them</a>, you need the scary kernel remote debugging tools. You also need to reboot every time you mess up. But I have a working authentication package from CVS NT code source, and another called <a href="http://www.cse.unsw.edu.au/~matthewc/">YPAuth</a> (YP means yellow pages, the <a href="http://en.wikipedia.org/wiki/Network_Information_Service">old name of NIS</a>). None of them support the unlock scenario, though&#8230;</p>
<p>Stay tuned !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2009/02/24/porting-a-custom-gina-to-a-credential-provider/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Segmentation example in a CAPTCHA</title>
		<link>http://www.paralint.com/blog/2009/02/09/segmentation-example-in-a-captcha/</link>
		<comments>http://www.paralint.com/blog/2009/02/09/segmentation-example-in-a-captcha/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 15:34:36 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Other technical]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/?p=99</guid>
		<description><![CDATA[From time to time, I come across an application whose designers need &#8211; or think they need &#8211; a CAPTCHA. I stay convinced that CAPTCHA are to be avoided. This post just goes to show the effect of segmentation on optical character recognition (OCR). If you read about artificial intelligence and character recognition, you will [...]]]></description>
			<content:encoded><![CDATA[<p>From time to time, I come across an application whose designers need &#8211; or think they need &#8211; a CAPTCHA. I stay convinced that CAPTCHA are to be avoided. This post just goes to show the effect of segmentation on optical character recognition (OCR).<br id="dqwm" /> <br id="dqwm0" /> If you read about artificial intelligence and character recognition, you will hear that there are references to segmentation. In short, segmentation is separating the letters from each other, before trying to guess what letters are there.<br id="sw8i" /> <br id="sw8i0" /> Segmentation is the &#8220;hard&#8221; part in solving a text based CAPTCHA, background noise and colors are the easy part. As a rule of thumb, if the letters of your CAPTCHA do not touch each other, your CAPTCHA is weak.<br id="h.ck" /></p>
<p>Here is an example. With a stock build of <a id="wsc:" title="GNU Ocrad homepage" href="http://www.gnu.org/software/ocrad/ocrad.html">ocrad</a>, I have tried to get the text from the same image, with one or two lines over the text.<br id="wlf85" /></p>
<div id="wlf86">
<table id="j3z3" class="zeroBorder" border="0" cellspacing="0" cellpadding="3" width="100%" bgcolor="#ffffff">
<tbody id="wlf87">
<tr id="wlf88">
<td id="wlf89" width="33%"><img class="aligncenter size-full wp-image-100" title="banane" src="http://www.paralint.com/blog/wp-content/uploads/2009/02/banane.gif" alt="banane" width="175" height="66" /></td>
<td id="wlf811" width="33%"><img class="aligncenter size-full wp-image-102" title="banane-11" src="http://www.paralint.com/blog/wp-content/uploads/2009/02/banane-11.gif" alt="banane-11" width="175" height="66" /><br id="wlf813" /></td>
<td id="wlf814" width="33%"><img class="aligncenter size-full wp-image-104" title="banane-21" src="http://www.paralint.com/blog/wp-content/uploads/2009/02/banane-21.gif" alt="banane-21" width="175" height="66" /><br id="wlf816" /></td>
</tr>
<tr id="wlf817">
<td id="wlf818" width="33%">$ ocrad -v banane.pbm<br id="zjxe" /> processing file &#8216;banane.pbm&#8217;<br id="wq54" /> file type is P4<br id="wlf819" /> file size is 175w x 66h<br id="wlf820" /> number of text blocks = 1<br id="wlf821" /> <strong>BANANE</strong><br id="wlf824" /></td>
<td id="wlf825" width="33%">$ ocrad -v banane-1.pbm<br id="zjxe0" /> processing file &#8216;banane-1.pbm&#8217;<br id="wq540" /> file type is P4<br id="wlf826" /> file size is 175w x 66h<br id="wlf827" /> number of text blocks = 1<br id="wlf828" /> <strong>_ANE</strong><br id="wlf831" /></td>
<td id="wlf832" width="33%">$ ocrad -v banane-2.pbm<br id="zjxe1" /> processing file `banane-2.pbm&#8217;<br id="wq541" /> file type is P4<br id="wlf833" /> file size is 175w x 66h<br id="wlf834" /> number of text blocks = 1<br id="wlf835" /> <br id="wlf838" /></td>
</tr>
</tbody>
</table>
</div>
<p>The text goes from 100% to 0% percent recognition just by adding two lines ! The word BANANE, then _ANE and after that &#8230; nothing !</p>
<p>This CAPTCHA is by no means robust, and I stay convinced that all forms of CAPTCHA are to be avoided. This example just goes to show the effect of segmentation on optical character recognition (OCR).<br id="cen70" /> <br id="colh" /> After all, artificial intelligence is a field of expertise you can spend your life learning. Just like cryptography, it should not be done by amateurs. But unlike cryptography, an AI challenge has no key. <a id="x3.7" title="Analysis of the breaking of Microsoft Live's CAPTCHA" href="http://www.websense.com/securitylabs/blog/blog.php?BlogID=171">Microsoft</a> and <a id="wfix" title="An analysis of the breaking of Google's CAPTCHA" href="http://www.websense.com/securitylabs/blog/blog.php?BlogID=174" target="_blank">Google</a>&#8216;s CAPTCHA have been broken. Your CAPTCHA will be broken too, it someones takes a shot at it. It is a matter of time, and there is a shorter way than brute force.<br id="accc" /> <br id="accc0" /> If you think you must put a CAPTCHA, start thinking about plan B right away&#8230; Using an image based CAPTCHA is not good either (post in French).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2009/02/09/segmentation-example-in-a-captcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ne jouez pas avec un CAPTCHA sans la surveillance d&#8217;un expert</title>
		<link>http://www.paralint.com/blog/2009/02/06/ne-jouez-pas-avec-un-captcha-sans-la-surveillance-dun-expert/</link>
		<comments>http://www.paralint.com/blog/2009/02/06/ne-jouez-pas-avec-un-captcha-sans-la-surveillance-dun-expert/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 20:22:52 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[En français]]></category>
		<category><![CDATA[Other technical]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/?p=91</guid>
		<description><![CDATA[Je suis tombé sur cette implémentation d&#8217;un CAPTCHA. Je déteste les CAPTCHA. C&#8217;est comme de la mauvaise crypto. Fondamentalement, le CAPTCHA ne fonctionne pas. La tâche d&#8217;analyse (le test de Turing) est complexe juste parce que personne ne s&#8217;est encore donné la peine d&#8217;écrire le code pour réussir. C&#8217;est aussi vrai pour la crypto classique, [...]]]></description>
			<content:encoded><![CDATA[<p>Je suis tombé sur cette implémentation d&#8217;un CAPTCHA.</p>
<div class="mceTemp mceIEcenter">
<dl id="attachment_92" class="wp-caption aligncenter" style="width: 403px;">
<dt class="wp-caption-dt"><img class="size-full wp-image-92" title="Lousy captcha" src="http://www.paralint.com/blog/wp-content/uploads/2009/02/captcha.jpg" alt="Must select 3 hamburgers in this lousy captcha " width="393" height="265" /></dt>
</dl>
</div>
<p>Je déteste les CAPTCHA. C&#8217;est comme de la mauvaise crypto.</p>
<p>Fondamentalement, le CAPTCHA ne fonctionne pas. La tâche d&#8217;analyse (le test de Turing) est complexe juste parce que personne ne s&#8217;est encore donné la peine d&#8217;écrire le code pour réussir. C&#8217;est aussi vrai pour la crypto classique, mais ces mathématiques sont soumises à des études formelles et continues. On sait à quoi s&#8217;en tenir : avec de la bonne crypto, on déplace le problème ailleurs (la gestion de clé, souvent). En intelligence artificielle, la segmentation est difficile, mais l&#8217;ordre de grandeur d&#8217;effort est à la portée des botnets actuels.</p>
<p><span id="more-91"></span>Trouver un éléphant ou un burger est faisable. Google ne trouve-t-il pas déjà les visages sur les photos ?  La faiblesse de ce CAPTCHA, en particulier, c&#8217;est l&#8217;apprentissage (en supposant que l&#8217;implémentation est bonne). La mémoire d&#8217;un ordinateur est infinie. Il est possible d&#8217;avoir la base de données complète des images en relativement peu de temps. D&#8217;identifier ce qui s&#8217;y trouve et automatiser le tout. Bien sûr, il ne faut pas que l&#8217;image soit déjà dans l&#8217;index Google&#8230; Autre faiblesse, on sait toujours d&#8217;avance combien il y a de (chat-chien-burger-bébé-éléphant). Ça aide à prendre une décision automatisée.</p>
<p>Les attaques sur les CAPTCHA de Microsoft et Google a montré que l&#8217;analyse de CAPTCHA n&#8217;a pas un taux de succès de 100 %. Un petit pourcentage, multiplié par un bon botnet, ça fait beaucoup de captcha résolus!</p>
<p>On n&#8217;a qu&#8217;à ajouter de nouvelles images, non? Oui, mais combien coûtera toute cette mécanique, en développement mais surtout en entretien? Quel est le coût réel d&#8217;une utilisation abusive du service? Combien coutera l&#8217;analyse préalable des images, le classement en mots clés, etc.? On m&#8217;a demandé de compter 3 bébés, mais une image en contenait deux, faut-il filtrer ces images-là aussi?</p>
<p>Mais surtout, l&#8217;aspect économique de la sécurité est complètement évacué. Ce CAPTCHA est sur une page qui demande un numéro de carte de crédit, mais pas sur la page qui permet d&#8217;utiliser le service une seule fois, gratuitement.  Et c&#8217;est sans compter qu&#8217;une <a href="http://decapcher.com">ferme de Turing</a> coute 8 $ pour 4000 CAPTCHA résolus. Combien coûte un client légitime dégoûté par toutes ces précautions?</p>
<p>Ce CAPTCHA est l&#8217;œuvre d&#8217;amateurs. Et j&#8217;ai même pas regardé l&#8217;implémentation des cookies, session, etc.  En bref, implémenter correctement ce CAPTCHA par image coûte beaucoup trop cher.</p>
<p>Si j&#8217;étais forcé d&#8217;utiliser un CAPTCHA, j&#8217;utiliserais un simple encodage javascript des champs du formulaire, variable dans le temps, peut-être avec un <a href="http://hashcash.org">hashcash</a> en javascript aussi, et vraiment accolé au pied du mur, j&#8217;essaierais <a href="http://recaptcha.net">recaptcha</a>. L&#8217;idée est de transformer tes utilisateurs en ta propre ferme de Turing. Pas fou!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2009/02/06/ne-jouez-pas-avec-un-captcha-sans-la-surveillance-dun-expert/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

