<?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; Windows</title>
	<atom:link href="http://www.paralint.com/blog/category/windows/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>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>Stop internal drive from showing up in &quot;Safely remove hardware&quot;</title>
		<link>http://www.paralint.com/blog/2008/11/13/stop-internal-drive-showing-up-in-safely-remove-hardware/</link>
		<comments>http://www.paralint.com/blog/2008/11/13/stop-internal-drive-showing-up-in-safely-remove-hardware/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 04:27:19 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Other technical]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/?p=82</guid>
		<description><![CDATA[Like many of you, I had a drive that showed up in the &#8220;Safely remove hardware&#8221; tray icon, and was unable to remove it. The trick is to subtract 4 from the Capabilities in the registry. Not easy, but it can be done. The only thing is that it keeps coming back after every boot [...]]]></description>
			<content:encoded><![CDATA[<p>Like many of you, I had a drive that showed up in the &#8220;Safely remove hardware&#8221; tray icon, and was unable to remove it.</p>
<p>The trick is to subtract 4 from the Capabilities in the registry. Not easy, but it can be done. The only thing is that it keeps coming back after every boot ! And it looks like the value cannot be edited under Vista. Here is how to fix it for good.</p>
<p><span id="more-82"></span></p>
<h3>What has to be done (but doesn&#8217;t work)</h3>
<p>Find the drive that shows up in the safely remove hardware icon in your registry. It will be somewhere under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE\. My DVD drive was here :</p>
<pre class="generic:nogutter:nocontrols">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE\CdRomHL-DT-ST_DVDRAM_GMA4082Nj_______________PM01____</pre>
<p>There is a numerical an alphanumerical key under that with a DWORD Capabilities value.</p>
<p><img src="http://www.paralint.com/blog/wp-content/uploads/2008/11/image.png" alt="image" width="788" height="318" /></p>
<p>It is a bit field. The bit 0010 (4 in decimal) is the REMOVABLE bit. Clear it by subtracting 4 from the value you have. The value I had was 6, so now I am down to 2.</p>
<p>If you try to do that, you will get an access denied. That&#8217;s ok, we will get around that. For now, right click on the key name and copy it (the key named 5&amp;3392c8c4&amp;0&amp;0.0.0 in my example).</p>
<h3>Same idea, that works manually under Vista</h3>
<p>You need to have the TCB privileged enabled to modify that registry key. Running regedit as an administrator (or elevated, if you have UAC) will not work. You can fix the value with this command line :</p>
<pre class="generic:nogutter:nocontrols">psexec -s reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE\CdRomHL-DT-ST_DVDRAM_GMA4082Nj_______________PM01____\5&amp;3392c8c4&amp;0&amp;0.0.0" /v Capabilities /t REG_DWORD /d 2 /f</pre>
<p>You will have to replace the key name with what you found in <span style="text-decoration: underline;">your</span> registry. Running psexec -r regedit might work, but who wants to do that every time the computer boots ?</p>
<h3>Permanent fix</h3>
<p>I hardly ever run as an administrator, so putting the above command in a script was out of the question. The solution was to create a Task using Windows Task Scheduler. I set it to run at startup, under the SYSTEM account. Don&#8217;t forget the /f (force) flag, or else the job will appear to hang, waiting a confirmation from you.</p>
<p>Create a new task. In the &#8220;General&#8221; tab, click Change User or Group and enter &#8220;SYSTEM&#8221; . Trigger on startup and enter the same command as above, but without psexec -s. Your task is running reg.exe, with everything right of that (in the command line, earlier) as optional arguments.</p>
<p><img src="http://www.paralint.com/blog/wp-content/uploads/2008/11/image1.png" alt="image" width="419" height="480" /></p>
<p>Good luck and HTH !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2008/11/13/stop-internal-drive-showing-up-in-safely-remove-hardware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Step by step guide to create your own MSCASH hashes</title>
		<link>http://www.paralint.com/blog/2008/07/06/step-by-step-guide-to-create-your-own-mscash-hashes/</link>
		<comments>http://www.paralint.com/blog/2008/07/06/step-by-step-guide-to-create-your-own-mscash-hashes/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 04:49:37 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/2008/07/06/step-by-step-guide-to-create-your-own-mscash-hashes/</guid>
		<description><![CDATA[I wanted to test the relative strength of a password policy. I wanted to run a password cracking tool over different passwords, from a dictionary based password (like Banana42) to a random one (generated with Password Safe). Creating users setting passwords and running different password extraction tools was a lot of trouble. I found a [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to test the relative strength of a password policy. I wanted to run a password cracking tool over different passwords, from a dictionary based password (like Banana42) to a random one (generated with <a href="http://passwordsafe.sourceforge.net/" target="_blank">Password Safe</a>). Creating users setting passwords and running different password extraction tools was a lot of trouble.</p>
<p>I found a detailed <a href="http://www.securiteam.com/tools/5JP0I2KFPA.html" target="_blank">explanation of the MSCASH format</a>. Here is how you make your own MSCASH hashes to do close to reality benchmarks of your favourite password cracking tool.</p>
<p><span id="more-54"></span></p>
<p>The format is MD4(MD4(password) + username). password and username are in Unicode. In the explanation linked above, we have the classical &quot;user&quot; and &quot;password&quot; combination. Using notepad, type your password. Save the file using Unicode format. The first two bytes of the file will be FF and EF, a flag called the byte order mark (BOM). Delete them using <a href="http://www.mh-nexus.de/hxd/" target="_blank">an hexadecimal editor</a>. It should look like this :</p>
<pre class="generic:nogutter:nocontrols" name="code">Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000  70 00 61 00 73 00 73 00 77 00 6F 00 72 00 64 00  p.a.s.s.w.o.r.d.</pre>
<p>Now calculate the first hash with openssl, with a binary output :</p>
</p>
<pre class="generic:nogutter:nocontrols" name="code">openssl dgst -md4 -binary password.unicode.txt &gt; md4.password</pre>
</p>
<p>Type and save your user name in Unicode format, remove the BOM, and concatenate the Unicode user name to the first hash.</p>
</p>
<pre class="generic:nogutter:nocontrols" name="code">copy /b md4.password + user.unicode.txt md4.password.user</pre>
</p>
<p>The file should look like this (the first 16 bytes is the md4 hash of the password) :</p>
<pre class="generic:nogutter:nocontrols" name="code">Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000  88 46 F7 EA EE 8F B1 17 AD 06 BD D8 30 B7 58 6C  &#710;F&#247;&#234;&#238;.&#177;...&#189;&#216;0&#183;Xl
00000010  75 00 73 00 65 00 72 00                          u.s.e.r.</pre>
<p>Now just hash that last file, again with openssl :</p>
</p>
<pre class="generic:nogutter:nocontrols" name="code">openssl dgst -md4 md4.password.user
MD4(md4.password.user)= 2d9f0b052932ad18b87f315641921cda</pre>
</p>
<p>You can now use that MSCASH hash for your benchmarks. I hope you find it usefull. I might write a program in C to automate this, If I see good traffic on this post. Spread the word !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2008/07/06/step-by-step-guide-to-create-your-own-mscash-hashes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notifu updated, now with Vista support</title>
		<link>http://www.paralint.com/blog/2008/02/04/notifu-updated-now-with-vista-support/</link>
		<comments>http://www.paralint.com/blog/2008/02/04/notifu-updated-now-with-vista-support/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 21:23:32 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Updates]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/2008/02/04/notifu-updated-now-with-vista-support/</guid>
		<description><![CDATA[Here is just a little update to my Notifu utility. It is a drop-in replacement (no new command-line switches) that features Vista Home Premium and Vista Business support (same binary works on XP and Vista) Better error handling on platforms that don&#8217;t support IUserNotification Option to specify pop-up delay in seconds (/d 5 or /d [...]]]></description>
			<content:encoded><![CDATA[<p>Here is just a little update to my Notifu utility. It is a drop-in replacement (no new command-line switches) that features</p>
<ul>
<li>Vista Home Premium and Vista Business support (same binary works on XP and Vista)</li>
<li>Better error handling on platforms that don&#8217;t support IUserNotification</li>
<li>Option to specify pop-up delay in seconds (/d 5 or /d 5000 will give you 5 seconds)</li>
</ul>
<p>I updated the <a href="/projects/notifu/" title="Yellow pop-up ballon utility">main project page</a>. There are a couple of typos and the email link is gone. I will fix that sometimes this week. Click on the bitmap here or on the project page to download.</p>
<p><img src="/projects/notifu/screen_shot_02.png" alt="IUserNotification (Notifu) screen shot on Vista" align="middle" /></p>
<p>Enjoy !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2008/02/04/notifu-updated-now-with-vista-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

