The principle of retrieving the forgotten password

Source: Internet
Author: User
Tags key printf access database root directory
In an Access database, for security reasons, you can set a password for the database you are building. But what about the password? Don't worry, here is a way to retrieve the password.


a database built in Access, the 13 bytes that start at address 00000042 of the library file are the password bits of the Access library. In the case of an unencrypted library, the 13 bytes of raw data are: 5D 9C FA C6 E6 13. In fact, when you set the password, Access will change your password (note that the password you entered in this text) is acsii with the above 13 byte data, so the 13 bytes starting at the address 00000042 of the library file become the key. For example, if you set the password to ABC, after the XOR or operation, the 13-byte data starting at 00000042 becomes the E7 8F 5D 9C FA C6 E6 13. Once a data has been changed or manipulated, it can be restored once again through the same XOR or operation. As a result, the access library that has a password set can get the password once it has 13 key data and the original 13 data.


The following is a C-language cracking program:


/* Assumes that the encrypted access library is myacc.mdb and stored in the root directory of the C-disk * *


#include″stdio.h″


Main ()


{FILE * fp


Char mm0[13]={0x86,0xfb,0xec,0x37,0x5d,0x44,0x9c,0xfa,0xc6,0x5e,0x28,0xe6,0x13};


/* This is 13 raw data * * *


Char mml[13],mm2[13];

The
/*mm1 is used to store the encrypted 13 keys; mm2 to store the password/


int i,k;


Fp=fopen (″c:\\myacc.mdb″,″rb″);


if (fp=null) {


printf (″\n cannot open the library!″);


exit (0);}


Rewind (FP); fseek (fp,0x42l,0);


fread (MM1,13,1,FP);/* Read key/*


for (i=0;i<13;i++) {


mm2[i]=mm0[i]^mm[i];*/original data with key XOR or/*


Else


break;}


K=1;fclose (FP);


if (k=0)


printf (″ not set password!″);


else{printf (″\n password: \n″);


for (i=0;ibr> printf (″%c,mm2[i]″);}}


by the way, when the Access library sets a password, it allows you to enter up to 14 password characters, but only the first 13 are valid.





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.