[AccessD] Database Needs Password Protection

Mark A Matte markamatte at hotmail.com
Thu Apr 29 14:13:44 CDT 2010


I'm not upset...it was just a question Max...and I do see irony   the subject is about protecting a database...the code is how to bypass that protection.
 
Don't remember where I got it...but...
 
Here is the code that tells you the password of an MDB.  Should be able to use for your purpose.
 
Thanks,
 
Mark
 
Call:  StPasswordOfStDatabase (Me!Database)
 
Function:
Public Function StPasswordOfStDatabase(stDatabase As String) As String
    Dim hFile As Integer
    Dim ich As Integer
    Dim stBuffer As String
    Dim rgbytRaw() As Byte
    Dim rgbytPassword() As Byte
    Dim rgbytNoPassword() As Byte
    
    ' Create the byte array with the 20 bytes that are present when there
    ' is no database password
    rgbytNoPassword = ChrB(134) & ChrB(251) & ChrB(236) & ChrB(55) & ChrB(93) & _
                                ChrB(68) & ChrB(156) & ChrB(250) & ChrB(198) & ChrB(94) & _
                                ChrB(40) & ChrB(230) & ChrB(19) & ChrB(182) & ChrB(138) & _
                                ChrB(96) & ChrB(84) & ChrB(148) & ChrB(123) & ChrB(54)
                                
    ' Grab the 20 bytes from the real file whose password
    ' we are supposed to retrieve
    hFile = FreeFile
    Open stDatabase For Binary As #hFile
    Seek #hFile, 66 + 1
    rgbytRaw = InputB(20, #hFile)
    Close #hFile
    
    ' Enough prep, lets get the password now.
    ReDim rgbytPassword(0 To 19)
    For ich = 0 To 19
        rgbytPassword(ich) = rgbytRaw(ich) Xor rgbytNoPassword(ich)
    Next ich
 
    ' Add a trailing Null so one will always be found, even if the password is 20
    ' characters. Then grab up to the first null we find and return the password
    stBuffer = StrConv(rgbytPassword, vbUnicode) & vbNullChar
    StPasswordOfStDatabase = Left$(stBuffer, InStr(1, stBuffer, vbNullChar, vbBinaryCompare) - 1)
    Forms!form1!Password = StPasswordOfStDatabase
End Function
'**************************END**********************

 
> From: max.wanadoo at gmail.com
> To: accessd at databaseadvisors.com
> Date: Thu, 29 Apr 2010 18:54:56 +0100
> Subject: Re: [AccessD] Database Needs Password Protection
> 
> 
> What irony?
> 
> You are posting to an Access list and say you have code to determine if a
> be is password protected.
> 
> I was replying to JBs posting re running own web site on own PC which is
> subject to attacks. The attacks are logged and the access program parses the
> log file to extract the information. 
> 
> Sorry, but it that upsets you, forget posting your code.
> 
> Max
> 
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
> Sent: Thursday, April 29, 2010 6:38 PM
> To: accessd at databaseadvisors.com
> Subject: Re: [AccessD] Database Needs Password Protection
> 
> 
> There is some irony here...
> 
> 
> 
> Subject = 'Database Needs Password Protection'.
> 
> Email= Code to display/crack password.
> 
> 
> 
> Would it be appropriate to post publically?
> 
> 
> 
> Mark
> 
 		 	   		  
_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4


More information about the AccessD mailing list