Have you ever seen a movie where a government guy unlocks his computer with a USB stick, then removes it and the computer goes blank? Loosely based on another forum script out there, this one does just that!
It checks a list of drives to find a file(see config section,) reads the file, and MD5 hashes the read variable. DriveGet caused my Cd drive to make annoying noises so I use this instead
*Note* this script reads from your USB key regularly, so be sure you're using "Safely remove hardware" to avoid filesystem errors.
Now. Let's see how many different ways we can crack it!
Assume Autoplay and Autorun.inf are disabled, and you do not have the computer's password (so
no restarts or logoffs, etc.)
No throwing rocks. (Assume the computer is expensive or something) If you can crack it, you get a feeling of self satisfaction, and my script updated to get around your crack!
The code: (pay attention to the config section, and don't change the MD5 if you want to try cracking)
The weird config section is due to having edited this in Notepad using tabs
Code:
/*
---------------------------------------------------
Drop it in your startup folder if you want
---------------------------------------------------
#######################################################
#######################################################
__ . . ___ . . __
\ / /\ / \ |\ | | |\ | /
\ /\ / /--\ |__/ | \ | | | \ | | _
\/ \/ / \ | \ | \| _|_ | \| \__/
THIS SCRIPT DISABLES TASK MANAGER WHEN
THE COMPUTER IS LOCKED.
THE AUTHOR OF THIS SCRIPT DOES NOT CLAIM
IT TO BE A SECURE METHOD OF BLOCKING ACCESS
THAT SAID, IT IS EXTREMELY DIFFICULT TO REGAIN
CONTROL OVER YOUR COMPUTER WITHOUT THE KEY IF
YOU DO NOT WISH TO RESTART.
HOLD SHIFT DURING BOOT TO DISABLE STARTUP ITEMS
#######################################################
#####################################################
*/
;=====================CONFIG========================
; =
MD5Hash = 533568CD7C7BEA9B2FFB18A31D57A6E9
; The MD5 hash of the passkey =
; =
Drives = E
; =
KeyFileName = lock.txt
; The name of the file where the key is stored =
; =
CheckWait = 5000
; How long (in ms) to wait between each lock check =
; =
Trans = 230
; A number from 0 (invisible) to 255 (opaque) =
; Which is the transparency of the lock screen =
;===================================================
#NoEnv
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
SetTimer, CheckKey, %CheckWait%
;Create 26 alphabetical HotKeys:
Loop, 26{
KeyName := Chr(A_Index+96)
Hotkey, *%KeyName%, Tab, Off
}
GoSub unlock
return
CheckKey:
Locked := true
Loop, PARSE, drives
IF FileExist(A_LoopField ":\" KeyFileName)
{
FileRead, key, %A_LoopField%:\%Keyfilename%
If ( MD5(Key, StrLen(key)) = MD5Hash )
Locked := False
}
If ( !Locked ) and ( LockState )
GoSub Unlock
Else If ( Locked ) and ( !LockState )
GoSub Lock
return
Lock:
SetTimer, CloseTaskMgr, On
; Hide taskBar:
WinHide, ahk_class Shell_TrayWnd
;Blocks all hotkeys which could be used to unlock the screen
Loop 26{
KeyName := Chr(A_Index+96)
HotKey, *%KeyName%, On
}
Hotkey, Left, On
Hotkey, Right, On
Hotkey, up, On
Hotkey, down, On
Hotkey, Tab, On
Hotkey, !Tab, On
Hotkey, !F4, On
Hotkey, LWin, On
Hotkey, RWin, On
Hotkey, AppsKey, On
HotKey, ^Escape, On
Hotkey, NumpadUp, On
Hotkey, NumpadDown, On
Hotkey, NumpadLeft, On
Hotkey, NumpadRight, On
;Cover screen:
SplashTextOn, A_ScreenWidth+2, A_ScreenHeight+2, Lock SCREEN, `n`n LOCKDOWN.`n`nTask Manager disabled.`n`n Mouseclicks disabled.`n`nArrow keys disabled.
WinSet, Transparent, %trans%, Lock SCREEN
LockState := true
BlockInput, On
return
Unlock:
WinShow, ahk_class Shell_TrayWnd
SetTimer, CloseTaskMgr, Off
Splashtextoff
;Enables All Blocked Keys
Loop 26{
KeyName := Chr(A_Index+96)
HotKey, *%KeyName%, Off
}
Hotkey, Left, Off
Hotkey, Right, Off
Hotkey, up, Off
Hotkey, down, Off
Hotkey, Tab, Off
Hotkey, !Tab, Off
Hotkey, !F4, Off
Hotkey, LWin, Off
Hotkey, RWin, Off
Hotkey, AppsKey, Off
Hotkey, ^Escape, Off
Hotkey, NumpadUp, Off
Hotkey, NumpadDown, Off
Hotkey, NumpadLeft, Off
Hotkey, NumpadRight, Off
LockState := false
BlockInput, Off
return
CloseTaskmgr:
Process, Wait, taskmgr.exe, 4
Process, Close, taskmgr.exe
return
Left::
right::
up::
down::
Tab::
!Tab::
!F4::
Appskey::
^Escape::
LWin::
RWin::
NumpadUp::
NumpadDown::
NumpadLeft::
NumpadRight::
Return
MD5( Byref V, L=0 )
{
VarSetCapacity( MD5_CTX,104,0), DllCall ( "advapi32\MD5Init", Str, MD5_CTX )
DllCall( "advapi32\MD5Update", Str, MD5_CTX, Str, V, UInt, L ? L : StrLen(L) )
DllCall( "advapi32\MD5Final", Str, MD5_CTX )
Loop % StrLen( Hex := "123456789ABCDEF0" )
N := NumGet( MD5_CTX, 87+A_Index, "Char"), MD5 .= SubStr(Hex,N>>4,1) . SubStr(Hex,N&15,1)
Return MD5
}