Block user input (keyboard & mouse)

c++ / delphi package - dll injection and api hooking

Block user input (keyboard & mouse)

Postby dudul » Mon Nov 09, 2015 12:03 pm

Hi,
Is it possible to block the user input, like keyboard and mouse?

(sorry for the double post)

Thank you in advance
dudul
 
Posts: 27
Joined: Wed Sep 09, 2015 3:00 pm

Re: Block user input (keyboard & mouse)

Postby iconic » Mon Nov 09, 2015 7:16 pm

You're probably looking for an API such as BlockInput()

Blocks keyboard and mouse input events from reaching applications.

https://msdn.microsoft.com/en-us/librar ... 85%29.aspx

--Iconic
iconic
Site Admin
 
Posts: 967
Joined: Wed Jun 08, 2005 5:08 am

Re: Block user input (keyboard & mouse)

Postby dudul » Thu Nov 12, 2015 9:53 am

I meant for a global hook, not just for my application.

My purpose is to block the CTRL+ALT+DELETE (for example) in some situations.
dudul
 
Posts: 27
Joined: Wed Sep 09, 2015 3:00 pm

Re: Block user input (keyboard & mouse)

Postby madshi » Thu Nov 12, 2015 9:57 am

I doubt that a user mode API hook can block Ctrl+Alt+Delete. I wouldn't know which API to hook for that to work. I'm not sure that there is a simple API for that, either, but I don't know for sure. You may have to write a driver to block Ctrl+Alt+Delete, but I don't really know.

I hope this is for a legit purpose? Blocking Ctrl+Alt+Delete sounds rather agressive/suspicious.
madshi
Site Admin
 
Posts: 10268
Joined: Sun Mar 21, 2004 5:25 pm

Re: Block user input (keyboard & mouse)

Postby iconic » Thu Nov 12, 2015 1:47 pm

CTRL+ALT+DEL is a security combination and it's not easily intercepted. If just anyone could intercept it there would be a massive security hole in the OS. You've a few choices...

[1] Subclass Winlogon's SAS window and intercept the key press combination there (on newer OSs such as Windows 8.1 Winlogon is now a protected process)
[2] Hook the existing GINA or replace it with your own GINA DLL that can capture it
[3] Write a keyboard filter driver

P.S: SetWindowsHookEx(WH_KEYBOARD_LL) will not work either

--Iconic
iconic
Site Admin
 
Posts: 967
Joined: Wed Jun 08, 2005 5:08 am


Return to madCodeHook

Who is online

Users browsing this forum: No registered users and 25 guests

cron