Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 11th, 2005, 6:17 AM   #1
killcity44
Newbie
 
Join Date: Feb 2005
Posts: 18
Rep Power: 0 killcity44 is on a distinguished road
security keys

i want to set something similiar up to the dialog that asks you to press CTRL, ALT and Delete before asking for passwords in WIndows 2000. how can i do this?
killcity44 is offline   Reply With Quote
Old Apr 11th, 2005, 8:38 AM   #2
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
when do you want it to execute, on demand or in the start up sequence?
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Apr 11th, 2005, 2:28 PM   #3
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Unless you're willing to write a HAL mode keyboard driver, there is absolutely no way you can detect ctrl + alt + delete using events, directX, low level keyboard hooks or even kernel mode calls. The LSASS components built into the kernel "swallow" this keystroke and pass it directly to MsGina (winlogon.exe).
Unless you're willing to go to extreme lengths, or take the Trojan route I don't think you can get functionality for that specific keystroke, especially not in VB.

You could quite easily set up a normal password dialog box: just make the dialog. A brief note though: if you want a truly secure password dialog, do not use the default VB text box with a character mask. It is possible to extract the password using memory hackers, window messages and what not. You should not store the actual password in the textbox, instead put it in a variable or something. Alternatively get a user control that embeds this functionality, or even better use the microsoft Masked Edit control which runs an updated text box.

As for processing the password, though Microsoft will tell you to use hashes and SecureRTLZeroMemory and so on, a normal If statement will do, unless you're writing something for NASA!

Hope this helps!
Rory is offline   Reply With Quote
Old Apr 14th, 2005, 6:45 PM   #4
drruggy
Newbie
 
Join Date: Apr 2005
Posts: 19
Rep Power: 0 drruggy is on a distinguished road
Private Declare Function Getasynckeystate Lib "user32" Alias "GetAsyncKeyState" (ByVal VKEY As Long) As Integer
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer

[PHP]Private Sub Timer1_Timer()
Dim keystate As Long

keystate = Getasynckeystate(vbKeyDelete)
If (keystate And &H1) = &H1 Then
Text1 = Text1 + "Delete has been pressed"
End If
keystate = Getasynckeystate(vbKeyControl)
If (keystate And &H1) = &H1 Then
Text1 = Text1 + "{ctrl}"
End If

keystate = Getasynckeystate(vbKeyMenu)
If (keystate And &H1) = &H1 Then
Text1 = Text1 + "{alt}"
End If
End Sub[/PHP]

Hope that helps.
drruggy is offline   Reply With Quote
Old Apr 15th, 2005, 2:29 PM   #5
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
As I said before, it won't hook Ctrl Alt and Delete on Windows NT (it may hook the Ctrl and Alt and even the Delete key separately appearing as individual keys, but this is not the keystroke, but simply "human error" in pressing the keys) - you'll find that if you specifically raise an event on that keystroke.
Many people have tried this, some with bad intentions, to "spoof" the user into giving logon details. Consequently the kernel intercepts this "magical" keystroke at the Hardware Abstraction Layer (this actually registers as an interrupt, like the power button) to provide this added layer of security, and in some cases reboot the computer.

Last edited by Rory; Apr 15th, 2005 at 2:32 PM.
Rory is offline   Reply With Quote
Old Apr 28th, 2005, 6:44 PM   #6
kbirger
Newbie
 
Join Date: Apr 2005
Posts: 1
Rep Power: 0 kbirger is on a distinguished road
well Key Trap seems to do it... http://www.gold-software.com/KeyTrap-review566.htm try it yourselves, it handles ctrl+alt+del the same as other keystrokes, at least transparently enough for it to not be a driver-level thing. isn't there a way to catch the interrupt message? i believe it's 0x0019..
kbirger is offline   Reply With Quote
Old Apr 29th, 2005, 4:47 PM   #7
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Quote:
Originally Posted by kbirger
well Key Trap seems to do it... http://www.gold-software.com/KeyTrap-review566.htm try it yourselves, it handles ctrl+alt+del the same as other keystrokes, at least transparently enough for it to not be a driver-level thing. isn't there a way to catch the interrupt message? i believe it's 0x0019..
Again it's a modified keyboard driver. And the second would involve installing a root kit to modify the operating system, specifically the kernel, not the sort of thing a legitimate program does! If you're writing a trojan, they're better ways to go about it... (disable/hook the oemlayer for a start!)
Rory is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:03 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC