Jump to content

Smart Card on PE3.0


geogauci

Recommended Posts

Hi!

I'm building a WinPE 3.0 image and need smart card compatibility. The service "Smart Card" is not running though, so I thought of copying all the necessary files from my winServer 2008 machine and start it manually. This brings me to my questions: Which files do I need, what is the correct starting sequence?

From my research it turns out that I need to somehow load scardsvr.dll (using svchost.exe?). Does anyone know how to do that? I also need to add a few reg keys I guess.

Any help in getting me to start Smart Card service would be greatly appreciated!

Link to comment
Share on other sites



Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM_00\ControlSet001\Control\Class\{50DD5230-BA8A-11D1-BF5D-0000F805F530}]
"Class"="SmartCardReader"
"ClassDesc"="@StorProp.dll,-17002"
@="Smart card readers"
"IconPath"=hex(7):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,00,\
74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,\
00,65,00,74,00,75,00,70,00,61,00,70,00,69,00,2e,00,64,00,6c,00,6c,00,2c,00,\
2d,00,32,00,35,00,00,00,00,00
"Installer32"="winscard.dll,ClassInstall32"
"NoInstallClass"="1"
"UpperFilters"=hex(7):73,00,63,00,66,00,69,00,6c,00,74,00,65,00,72,00,00,00,00,\
00

[HKEY_LOCAL_MACHINE\SYSTEM_00\ControlSet001\Control\Class\{50DD5230-BA8A-11D1-BF5D-0000F805F530}\Properties]

[HKEY_LOCAL_MACHINE\SYSTEM_00\ControlSet001\Control\Class\{990A2BD7-E738-46C7-B26F-1CF8FB9F1391}]
"Class"="SmartCard"
"ClassDesc"="@sccls.dll,-300"
@="Smart cards"
"IconPath"=hex(7):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,00,\
74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,\
00,63,00,63,00,6c,00,73,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,31,00,30,00,\
30,00,00,00,00,00
"Installer32"="sccls.dll,ScClassInstaller"

[HKEY_LOCAL_MACHINE\SYSTEM_00\ControlSet001\Control\Class\{990A2BD7-E738-46C7-B26F-1CF8FB9F1391}\Properties]

[HKEY_LOCAL_MACHINE\SYSTEM_00\ControlSet001\Control\Class\{A0A588A4-C46F-4B37-B7EA-C82FE89870C6}]
"Class"="SDHost"
"ClassDesc"="@%SystemRoot%\\System32\\SysClass.Dll,-3012"
@="SD host adapters"
"IconPath"=hex(7):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\
74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,\
00,65,00,74,00,75,00,70,00,61,00,70,00,69,00,2e,00,64,00,6c,00,6c,00,2c,00,\
2d,00,33,00,39,00,00,00,00,00

[HKEY_LOCAL_MACHINE\SYSTEM_00\ControlSet001\Control\Class\{A0A588A4-C46F-4B37-B7EA-C82FE89870C6}\Properties]

[HKEY_LOCAL_MACHINE\SYSTEM_00\ControlSet001\Control\Class\{DB4F6DDD-9C0E-45E4-9597-78DBBAD0F412}]
"Class"="SmartCardFilter"
"ClassDesc"="@sccls.dll,-301"
@="Smart Card Filter"
"IconPath"=hex(7):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,00,\
74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,\
00,65,00,74,00,75,00,70,00,61,00,70,00,69,00,2e,00,64,00,6c,00,6c,00,2c,00,\
2d,00,32,00,35,00,00,00,00,00
"SilentInstall"="1"
"NoInstallClass"="1"
"NoDisplayClass"="1"

[HKEY_LOCAL_MACHINE\SYSTEM_00\ControlSet001\Control\Class\{DB4F6DDD-9C0E-45E4-9597-78DBBAD0F412}\Properties]

Also add files in this reg. Can be a starting point for you.

Edited by Kullenen_Ask
Link to comment
Share on other sites

Thx for the replies!

I inserted the specified reg entry and copied any dependency dlls from a Win7 machine.

Could you pls elaborate a bit further? What do I need to do to install/start the smart card service?

Link to comment
Share on other sites

*All of Windows 7 [HKEY_LOCAL_MACHINE\SOFTWARE_00\Microsoft\Windows NT\CurrentVersion\Svchost] key

*


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM_00\ControlSet001\services\PlugPlay]
"DisplayName"="@%SystemRoot%\\system32\\umpnpmgr.dll,-100"
"Group"="PlugPlay"
"ImagePath"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\
74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,\
00,76,00,63,00,68,00,6f,00,73,00,74,00,2e,00,65,00,78,00,65,00,20,00,2d,00,\
6b,00,20,00,44,00,63,00,6f,00,6d,00,4c,00,61,00,75,00,6e,00,63,00,68,00,00,\
00
"Description"="@%SystemRoot%\\system32\\umpnpmgr.dll,-101"
"ObjectName"="LocalSystem"
"ErrorControl"=dword:00000001
"Start"=dword:00000002
"Type"=dword:00000020
"ServiceSidType"=dword:00000001
"RequiredPrivileges"=hex(7):53,00,65,00,54,00,63,00,62,00,50,00,72,00,69,00,76,\
00,69,00,6c,00,65,00,67,00,65,00,00,00,53,00,65,00,53,00,65,00,63,00,75,00,\
72,00,69,00,74,00,79,00,50,00,72,00,69,00,76,00,69,00,6c,00,65,00,67,00,65,\
00,00,00,53,00,65,00,41,00,73,00,73,00,69,00,67,00,6e,00,50,00,72,00,69,00,\
6d,00,61,00,72,00,79,00,54,00,6f,00,6b,00,65,00,6e,00,50,00,72,00,69,00,76,\
00,69,00,6c,00,65,00,67,00,65,00,00,00,53,00,65,00,54,00,61,00,6b,00,65,00,\
4f,00,77,00,6e,00,65,00,72,00,73,00,68,00,69,00,70,00,50,00,72,00,69,00,76,\
00,69,00,6c,00,65,00,67,00,65,00,00,00,53,00,65,00,4c,00,6f,00,61,00,64,00,\
44,00,72,00,69,00,76,00,65,00,72,00,50,00,72,00,69,00,76,00,69,00,6c,00,65,\
00,67,00,65,00,00,00,53,00,65,00,42,00,61,00,63,00,6b,00,75,00,70,00,50,00,\
72,00,69,00,76,00,69,00,6c,00,65,00,67,00,65,00,00,00,53,00,65,00,52,00,65,\
00,73,00,74,00,6f,00,72,00,65,00,50,00,72,00,69,00,76,00,69,00,6c,00,65,00,\
67,00,65,00,00,00,53,00,65,00,49,00,6d,00,70,00,65,00,72,00,73,00,6f,00,6e,\
00,61,00,74,00,65,00,50,00,72,00,69,00,76,00,69,00,6c,00,65,00,67,00,65,00,\
00,00,53,00,65,00,41,00,75,00,64,00,69,00,74,00,50,00,72,00,69,00,76,00,69,\
00,6c,00,65,00,67,00,65,00,00,00,53,00,65,00,43,00,68,00,61,00,6e,00,67,00,\
65,00,4e,00,6f,00,74,00,69,00,66,00,79,00,50,00,72,00,69,00,76,00,69,00,6c,\
00,65,00,67,00,65,00,00,00,53,00,65,00,55,00,6e,00,64,00,6f,00,63,00,6b,00,\
50,00,72,00,69,00,76,00,69,00,6c,00,65,00,67,00,65,00,00,00,53,00,65,00,44,\
00,65,00,62,00,75,00,67,00,50,00,72,00,69,00,76,00,69,00,6c,00,65,00,67,00,\
65,00,00,00,53,00,65,00,53,00,68,00,75,00,74,00,64,00,6f,00,77,00,6e,00,50,\
00,72,00,69,00,76,00,69,00,6c,00,65,00,67,00,65,00,00,00,00,00
"FailureActions"=hex:00,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,14,00,00,\
00,02,00,00,00,60,ea,00,00,02,00,00,00,60,ea,00,00,02,00,00,00,60,ea,00,00

[HKEY_LOCAL_MACHINE\SYSTEM_00\ControlSet001\services\PlugPlay\Parameters]
"ServiceDll"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,\
00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,\
75,00,6d,00,70,00,6e,00,70,00,6d,00,67,00,72,00,2e,00,64,00,6c,00,6c,00,00,\
00

[HKEY_LOCAL_MACHINE\SYSTEM_00\ControlSet001\services\SCardSvr]
"DisplayName"="@%SystemRoot%\\System32\\SCardSvr.dll,-1"
"Group"="SmartCardGroup"
"ImagePath"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\
74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,\
00,76,00,63,00,68,00,6f,00,73,00,74,00,2e,00,65,00,78,00,65,00,20,00,2d,00,\
6b,00,20,00,4c,00,6f,00,63,00,61,00,6c,00,53,00,65,00,72,00,76,00,69,00,63,\
00,65,00,41,00,6e,00,64,00,4e,00,6f,00,49,00,6d,00,70,00,65,00,72,00,73,00,\
6f,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00
"Description"="@%SystemRoot%\\System32\\SCardSvr.dll,-5"
"ObjectName"="NT AUTHORITY\\LocalService"
"ErrorControl"=dword:00000001
"Start"=dword:00000003
"Type"=dword:00000020
"DependOnService"=hex(7):50,00,6c,00,75,00,67,00,50,00,6c,00,61,00,79,00,00,00,\
00,00
"ServiceSidType"=dword:00000001
"RequiredPrivileges"=hex(7):53,00,65,00,43,00,72,00,65,00,61,00,74,00,65,00,47,\
00,6c,00,6f,00,62,00,61,00,6c,00,50,00,72,00,69,00,76,00,69,00,6c,00,65,00,\
67,00,65,00,00,00,53,00,65,00,43,00,68,00,61,00,6e,00,67,00,65,00,4e,00,6f,\
00,74,00,69,00,66,00,79,00,50,00,72,00,69,00,76,00,69,00,6c,00,65,00,67,00,\
65,00,00,00,00,00
"FailureActions"=hex:84,03,00,00,00,00,00,00,00,00,00,00,03,00,00,00,14,00,00,\
00,01,00,00,00,c0,d4,01,00,01,00,00,00,e0,93,04,00,00,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\SYSTEM_00\ControlSet001\services\SCardSvr\Parameters]
"ServiceDll"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,\
00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,\
53,00,43,00,61,00,72,00,64,00,53,00,76,00,72,00,2e,00,64,00,6c,00,6c,00,00,\
00
"ServiceMain"="CalaisMain"
"ServiceDllUnloadOnStop"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM_00\ControlSet001\services\SCardSvr\Security]
"Security"=hex:01,00,14,80,90,00,00,00,a0,00,00,00,14,00,00,00,34,00,00,00,02,\
00,20,00,01,00,00,00,02,c0,18,00,00,00,0c,00,01,02,00,00,00,00,00,05,20,00,\
00,00,20,02,00,00,02,00,5c,00,04,00,00,00,00,02,14,00,ff,01,0f,00,01,01,00,\
00,00,00,00,05,12,00,00,00,00,00,18,00,ff,01,02,00,01,02,00,00,00,00,00,05,\
20,00,00,00,20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,04,\
00,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,06,00,00,00,01,02,\
00,00,00,00,00,05,20,00,00,00,20,02,00,00,01,02,00,00,00,00,00,05,20,00,00,\
00,20,02,00,00

*This files.

umpnpmgr.dll

SCardSvr.dll

authz.dll

cfgmgr32.dll

smartcrd.inf

certprop.dll

SCardDlg.dll

sccls.dll

scfilter.sys

msclmd.dll

if there is else mentioned files in smartcrd.inf put them too.

This procedure same for ALL services. Smartcard service depends on Plug and Play. Plug and Play can depend to else stuff too. It goes on like that. Need to find start point and solve until fix or remove depend on registry key from service.

and important point.


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE_00\Microsoft\Cryptography\Calais]

[HKEY_LOCAL_MACHINE\SOFTWARE_00\Microsoft\Cryptography\Calais\Cache]
@=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE_00\Microsoft\Cryptography\Calais\Readers]

[HKEY_LOCAL_MACHINE\SOFTWARE_00\Microsoft\Cryptography\Calais\SmartCards]

[HKEY_LOCAL_MACHINE\SOFTWARE_00\Microsoft\Cryptography\Calais\SmartCards\Identity Device (Microsoft Generic Profile)]
"Crypto Provider"="Microsoft Base Smart Card Crypto Provider"
"Smart Card Key Storage Provider"="Microsoft Smart Card Key Storage Provider"
"80000001"="msclmd.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE_00\Microsoft\Cryptography\Calais\SmartCards\Identity Device (NIST SP 800-73 [PIV])]
"Crypto Provider"="Microsoft Base Smart Card Crypto Provider"
"Smart Card Key Storage Provider"="Microsoft Smart Card Key Storage Provider"
"80000001"="msclmd.dll"

Edited by Kullenen_Ask
Link to comment
Share on other sites

  • 2 weeks later...

Thank you, this actually worked :)

Just a note, in order to work, all references to Upperfilters and LowerFilters which are related to the smartcard had to be removed. Otherwise, the card reader driver would fail to load.

Edited by geogauci
Link to comment
Share on other sites

Did you test this in real environment. I don't know what a smartcard is and used for. All i know is some kind of password and login check key at user login??? Also there is a smardcard remmove service isn't it need? How will it be usefull for you? Interesting to learn. Or is it the small cards used at photograf machines and mobile phones to store data?

Edited by Kullenen_Ask
Link to comment
Share on other sites

A Smart Card can be used for various things since it is programmable. To sum it up, think of it as a hardware key similar to how some high-level engineering applications use. Microsoft sums it up well with this:

Smart cards are a key component of the public key infrastructure (PKI) that Microsoft is integrating into the Windows platform because smart cards enhance software-only solutions, such as client authentication, logon, and secure email.

From:

http://technet.microsoft.com/en-us/library/dd277362.aspx

Link to comment
Share on other sites

I did test in a real environment, and it works fine. A smartcard is used to securely store cryptographic information, such as users' certificates, passwords and private keys for example. And yes, it can be used for windows login, mount encrypted drives, email/file signing and encryption etc.. The mobile SIM cards are also smartcards.

I guess you could find more examples and applications on Aloaha.com and Truecrypt.com.

Thank you for pointing out the smartcard remove service. Might be useful later on.

Link to comment
Share on other sites

Do you have credentials, vault, certificate stuff for to use with your smardcard in your winpe? Can you encrypt drives or use your smartcard to login web based exchange server mailbox? Want to learn a real example or software name or something like that under winpe.

Edited by Kullenen_Ask
Link to comment
Share on other sites

I'm currently creating, mounting and unmounting encrypted drives using AloahaCrypt which I'm running using portableapps.

If you're really interested in the subject you should contact Aloaha (info@aloaha.com); I've been provided with lots of useful info.

(edit) As for my personal certificate stuff it is stored on a physical card...

Edited by geogauci
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...