Jump to content
Sign in to follow this  
Skrip

Desktop Lockout

Recommended Posts

Skrip

This was created just to lock people out. I've tested it alot, and it seems quite secure.

It overlays on the primary monitor and mouse traps - so it doesn't matter if you have multiple monitors.

Designed to launch on startup. Attached is an exe program so you can easily generate a new password for the $Password variable.

Please test if you can, find any exploits to get around it. The default password is 1

AutoItSetOption("MustDeclareVars", 1) 
If @AutoItX64 Then
    DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)
EndIf
#NoTrayIcon
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#include <Misc.au3>
Global Const $Password = "B9DD8A10D0DEFD99741BB2AC8634B894C5D44DB667A105F7D6FCB21D91AA2638"
Global $PassForm, $Input1, $Button1, $nMsg, $Attempts = 5
Local $Back
HotKeySet("^z", "exitt");;;;;;;;;;;;;;;;;
;;Create back
$Back = GUICreate("Blackout", @DesktopWidth, @DesktopHeight, 0, 0, BitOR($WS_SYSMENU, $WS_POPUP, $WS_CLIPSIBLINGS))
WinSetOnTop($Back, "", 1)
GUISetBkColor(0x0)
GUISetState(@SW_SHOW)
;;Create Input
$PassForm = GUICreate("Password", 355, 62, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_POPUP, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS))
Global $Mtrap = WinGetPos($PassForm)
$Input1 = GUICtrlCreateInput("", 8, 8, 337, 21, $ES_PASSWORD)
$Button1 = GUICtrlCreateButton("Enter (" & $Attempts & ")", 8, 32, 337, 25, 0)
WinSetOnTop($PassForm, "", 1)
GUISetState(@SW_SHOW)
;;
While 1
    _MouseTrap($Mtrap[0], $Mtrap[1], $Mtrap[0] + $Mtrap[2], $Mtrap[1] + $Mtrap[3])
    If Not WinActive($PassForm) Then
        If Not WinActive($Back) Then
            WinSetState(WinGetTitle("[active]"), "", @SW_MINIMIZE)
        EndIf
        WinActivate($PassForm)
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $Button1
            _Analyze(GUICtrlRead($Input1))
    EndSwitch
WEnd

Func exitt()
    Exit
EndFunc ;==>exitt

Func _Analyze($Epassword)
    $Epassword = _StringEncrypt(1, $Epassword, _StringEncrypt(0, "DBB23B64F488", "RC4", 1), _StringEncrypt(0, "A6B7", "RC4", 1))
    If $Epassword == $Password Then
        Exit
    Else
        GUICtrlSetData($Input1, "")
        $Attempts -= 1
        If $Attempts == 0 Then
            _Lockout()
        Else
            GUICtrlSetData($Button1, "Enter (" & $Attempts & ")")
        EndIf
    EndIf
EndFunc ;==>_Analyze

Func _Lockout()
    ControlDisable($PassForm, "", $Button1)
    ControlDisable($PassForm, "", $Input1)
    GUICtrlSetData($Button1, "Lockout")
    Local $timer = TimerInit(), $time, $locktime = 25
    Do
        _MouseTrap($Mtrap[0], $Mtrap[1], $Mtrap[0] + $Mtrap[2], $Mtrap[1] + $Mtrap[3])
        Sleep(500)
        If WinActive("Windows Task Manager") Then WinClose("Windows Task Manager")
        If Not WinActive($PassForm) Then WinActivate($PassForm)
        ControlDisable($PassForm, "", $Button1)
        $time = TimerDiff($timer)
        GUICtrlSetData($Button1, "Lockout - " & Int($locktime - $time / 1000))
    Until $time > $locktime * 1000
    $Attempts = 5
    ControlEnable($PassForm, "", $Button1)
    ControlEnable($PassForm, "", $Input1)
    GUICtrlSetData($Button1, "Enter (" & $Attempts & ")")
EndFunc ;==>_Lockout

Pass_Gen.exe

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
stinson6016

Hey looks great, to help make it more secure check this out he has a dll that you can use to block ctrl-alt-del and also alt-tab, used it on my kiosk program

Edited by stinson6016

Gnatwork Networks

Share this post


Link to post
Share on other sites
Skrip

Hey looks great, to help make it more secure check this out he has a dll that you can use to block ctrl-alt-del and also alt-tab, used it on my kiosk program

Yeah, I thought about using a dll like that, but honestly, I think it is unnecessary.

Because of the nature of the program, it is designed so you cannot click away from that window, and if you do - it'll minimize the window you selected, and return to the password window. Even if you ctrl+alt+del in vista - when the security features thing comes up, it still doesn't matter, all you'd really be able to do it logoff. And that won't help you gain access. lol. You couldn't select the task manager anyway.

Also, a byproduct of the program is that it breaks alt+tab until restart - if you try to use it while passworded. So that won't work either.

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
Authenticity

taskmgr.exe is just a graphical interface for the user... You can still go to the command shell, type tasklist and then taskkill but I guess that it's not the idea here. You don't want to overtake the entire system because it's Microsoft Windoze's responsibility to do so.

Edited by Authenticity

Share this post


Link to post
Share on other sites
Skrip

taskmgr.exe is just a graphical interface for the user... You can still go to the command shell, type tasklist and then taskkill but I guess that it's not the idea here. You don't want to overtake the entire system because it's Microsoft Windoze's responsibility to do so.

And how exactly would you go into anything? That's kinda the purpose of the program...

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
Creator

Well i tried all tricks i know of, but i didn't manage to get my desktop back.

Even though i use a dutch vista and the kill taskmanager trick went dead because of a different window title.

Nicely done!

Share this post


Link to post
Share on other sites
Skrip

Well i tried all tricks i know of, but i didn't manage to get my desktop back.

Even though i use a dutch vista and the kill taskmanager trick went dead because of a different window title.

Nicely done!

Heh, yeah I knew that would be a part people could get around, but were you able to kill the task, using your dutch manager?


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
Mat

Heh, yeah I knew that would be a part people could get around, but were you able to kill the task, using your dutch manager?

use process's instead, I think they are fairly constant. or... open up taskmanager and set it to hidden. that way it won't open up, even if they do press ctrl alt delete.

Share this post


Link to post
Share on other sites
Skrip

use process's instead, I think they are fairly constant. or... open up taskmanager and set it to hidden. that way it won't open up, even if they do press ctrl alt delete.

Good idea. Will edit in a bit.

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
Creator

Heh, yeah I knew that would be a part people could get around, but were you able to kill the task, using your dutch manager?

Nope. Your gui stayed on top of the task manager and even alt-tab didnt bring it to front. So i wasnt able to kill tasks ^_^

Share this post


Link to post
Share on other sites
Skrip

Nope. Your gui stayed on top of the task manager and even alt-tab didnt bring it to front. So i wasnt able to kill tasks ^_^

Perfect! Exactly what I was going for. ;)


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
CodyBarrett

i ahve a screenlocker in my sig... if you want the tsgmgr NOT to show up...

If ProcessExists ('taskmgr.exe') Then ProcessClose ('taskmgr.exe')

Share this post


Link to post
Share on other sites
CodyBarrett

it olny brings up my CPU by 3% more...

Share this post


Link to post
Share on other sites
Skrip

To prevent increased CPU usage, you can add a sleep in before in. Sleep(200)

But I'm not going to make that edit. It is honestly not needed. I don't even need to have the task manager close. In fact, I'm going to remove that line, as it'll make it slightly faster, and it doesn't matter anyway. Not like you can even access the manager anyway.


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
Mat

what happens if you manually shut down? how about you add the program to startup on prog start, and delete it only when they enter the pass. That way the only way they can get around is by rebooting into safe mode.

Share this post


Link to post
Share on other sites
Skrip

what happens if you manually shut down? how about you add the program to startup on prog start, and delete it only when they enter the pass. That way the only way they can get around is by rebooting into safe mode.

Uhh, can you please rephrase that?


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
Mat

I can press The big button that turns the computer off or pull the plug. This manually shuts down mr. computer. When I restart, I can resume computer use as before. My answer to the problem is to add the prgram to the startup directory everytime you run the program. This way, it cannot be bypassed by shutting down and restarting. (Unless booted to safe mode).

MDiesel

Share this post


Link to post
Share on other sites
Skrip

Ohhh, yeah I gotcha. Yes, this program is designed to go into the startup folder, or into the registry. That is the best way to make this program effective.


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
Prashant

That's nice but..I had to restart my PC more then 10 times to analyse it..

By the way..its helpful..I got a little favour to ask for you..Can u please?reply me in my mail..

minuterunner@hotmail.com

Can i make another Autoit Script using your Mouse POinter Bounding Script pleaseeeeeee?..

The only i like of your Creation is the mouse cursor bound.

hehe..anyways thanks

>_<


Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.