Jump to content

[vbs] Authentification With Your Personal Flash Disk


Hackoo

Recommended Posts

After decades, centuries of existence and evolution, with which do you open your front door?

A key, obviously ;) .Then why not to make it also for your computer?

It falls well, there is an IT homonym which is also a small object, transportable in a pocket always with one,

provided d a unique(only) identifier and with great difficulty falsifiable, who it more allows to store data: it is your USB key.Then, I have to program this Script which feigns all that I have just said above. Voila as the title indicates it " authentification by your personal USB key: it is as to Find the key in its lock! "

The principle is simple: the script verifies the number of identification which is N ° of series of your USB key (SerialNumber) and at the time of becoming identified, if it finds it trendy on your system, he reads these data that he will have placed there as confirmation, then he authorizes you has to reach the system. Should the opposite occur,the computer is going to shutdown.

- the Program is installable via the base of registers by adding the value of the N ° of series of the USB key

And I have to think has to add another value which is the password during the installation which is going to serve

us in case Immediately to free the system. Indeed because it is the only means to free the system in case of breakdown material ("Not Recognition of your key, defective Ports USB Etc. ") either your key is lost either stolen!!

- I have to add also a LogFile to record the attempts of interventions by registering them in this last one The

Date, the hour, N° of series and the password not Authenticated.

NB: this script Modifies well a value of key in the base of register that I consider it as a "VITAL" key for the

smooth running of the system: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\userinit

( This process dashes after an opening of session Windows. it establishes your connection to the network and to

Internet, loads various processes system as the taskbar and to start up the shell of Windows. As well as the

parameters appropriate for your session.)

It is the only means which I have to find to assure a maximal security for the system, even the Safe Mode without

failure Will never escape to my script tested and approved on a machine Windows XP SP3.

Description : Userinit.exe

Processus User Initialization : userinit.exe

Specifies the programs that Winlogon runs when a user logs on. By default, Winlogon runs Userinit.exe, which runs

logon scripts, reestablishes network connections, and then starts Explorer.exe, the Windows user interface.

You can change the value of this entry to add or remove programs. For example, to have a program run before the Windows Explorer user interface starts, substitute the name of that program for Userinit.exe in the value of this

entry, then include instructions in that program to start Userinit.exe. You might also want to substitute

Explorer.exe for Userinit.exe if you are working offline and are not using logon scripts.

So in this code i substitute the value of userinit.exe by this valuewscript.exe /E:vbs """& AppData &"\"& NomScript &".db

For example i use this function in my script :

'-----------------------LockSystem-------------------
 sub LockSystem
 Dim Ws,DisableLogon
 Dim n, p, itemtype,Sys32
 Set Ws = CreateObject("Wscript.Shell")
 Set FSO = CreateObject("Scripting.FileSystemObject")
 AppData= ws.ExpandEnvironmentStrings("%AppData%")
 NomScript=wscript.scriptname
 'MsgBox AppData &"\"& NomScript
 p = "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\"
 p = p & "Userinit"
 itemtype = "REG_SZ"
 n = "wscript.exe /E:vbs """& AppData &"\"& NomScript &".db"""
 WS.RegWrite p, n, itemtype
 end sub

And of course you can roll back this Value by using this script named UNINSTALL_AUTH_USB.vbs that you can find it with the RAR file in the download section.

So in the RAR File there is Two Scripts: the first one named INSTALL_AUTH_USB.vbs let you install and setup this

script and the scond one named UNINSTALL_AUTH_USB.vbs to UNINSTALL it ;)

This the code Source of UNINSTALL_AUTH_USB

'--------------------------------------------------------------------------------
'This Code serves to UNINSTALL the script INSTALL_AUTH_USB.vbs and not to remain blocked with this last one!
'© Hackoo © 2010
'-------------------------------------------------------------------------------
Call UNINSTALL
sub UNINSTALL
Dim Ws
Dim n, p, itemtype,System32
Set Ws = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
AppData= ws.ExpandEnvironmentStrings("%AppData%")
p = "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\"
p = p & "Userinit"
itemtype = "REG_SZ"
System32=FSO.GetSpecialFolder(1)
n = System32 & "\userinit.exe"
Title = "DEINSTALLATION Clé Usb © Hackoo © "
If MsgBox ("VOULEZ-VOUS DEINSTALLER VOTRE CLE USB PERSONNELLE DU SYSTEME !",1 + 256 + 48 + 4096 ,Title ) = 2 Then
Msgbox "Vous avez choisi d'annuler la déinstallation de votre clé usb personnelle ! !",64,Title
Msgbox " you chose to cancel the uninstall of your key usb personal!! ", 64, Title
wscript.Quit()
else
IF fso.fileexists(AppData & "\INSTALL_AUTH_USB.vbs.db") then
FSO.DeleteFile AppData & "\INSTALL_AUTH_USB.vbs.db",True 
end if
IF fso.fileexists(AppData & "\LogUsb.htm") then
FSO.DeleteFile AppData & "\LogUsb.htm",True 
end if
IF RegExists("HKLM\Software\AUTH_USB\") Then 
'Ws.RegDelete("HKLM\Software\AUTH_USB\SerialNumber\")
'Ws.RegDelete("HKLM\Software\AUTH_USB\MDP\")
Ws.RegDelete("HKLM\Software\AUTH_USB\")
EnableTaskMgr
WS.RegWrite p, n, itemtype
Msgbox "VOTRE CLE USB PERSONNELLE A ETE DEINSTALLER DU SYSTEME AVEC SUCSSES !",64,Title
Msgbox "YOUR PERSONAL KEY USB WAS UNINSTALLED OF the SYSTEM WITH SUCSSES !",64,Title
ELSE
EnableTaskMgr
WS.RegWrite p, n, itemtype
Msgbox "VOTRE CLE USB PERSONNELLE EST DEJA DEINSTALLEE DU SYSTEME !",16,Title
Msgbox " YOUR PERSONAL KEY USB IS ALREADY UNINSTALLED OF the SYSTEM! ", 16, Title
end if
end if
end sub
'-------------------------------------------
Function RegExists(value)
 On Error Resume Next
 Set WS = CreateObject("WScript.Shell")
 val = WS.RegRead(value)
 If (Err.number = -2147024893) or (Err.number = -2147024894) Then
 RegExists = False
 Else
 RegExists = True
 End If
 End Function
'--------------------------------------------
'--------------------EnableTaskMgr()--------------
 sub EnableTaskMgr
 Dim WshShell,System
 System="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\"
 Set WshShell=WScript.CreateObject("WScript.Shell")
 Wshshell.RegWrite System, "REG_SZ"
 WshShell.RegWrite System &"\DisableTaskMgr", 0, "REG_DWORD"
 end sub
'-------------Fin du EnableTaskMgr()-----------

On the other hand on Windows Vista and Seven I have no idea if this program is going to work or not and it's for you to test it and to participate a little to make it work in these last operating systems.

I added the agent of Microsoft Merlin the Magician to animated and liven up a little this script

97250894.jpg

This is a Demo in Video

94504243.jpg

214699876.jpg

254719777.jpg

This is the download link of my scripts (INSTALL_AUTH_USB.vbs and UNINSTALL_AUTH_USB.vbs)

AUTHENTIFICATION-CLE-USB-MERLIN

AUTH_USB_MERLIN.rar

Link to comment
Share on other sites

  • 1 month later...

I might just give this a go, it seems a rather interesting, yet functional prospect. The extra security could be very useful aswell, because it is much easier to hide a USB Flash drive than to hide keystrokes, especially if someone is able to somehow give you a keylogger.

+1 to this topic/idea.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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