CN107566123B - PPTP VPN password verification method and computer readable storage medium - Google Patents

PPTP VPN password verification method and computer readable storage medium Download PDF

Info

Publication number
CN107566123B
CN107566123B CN201710665048.8A CN201710665048A CN107566123B CN 107566123 B CN107566123 B CN 107566123B CN 201710665048 A CN201710665048 A CN 201710665048A CN 107566123 B CN107566123 B CN 107566123B
Authority
CN
China
Prior art keywords
value
nthash
bytes
index
suspicious
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710665048.8A
Other languages
Chinese (zh)
Other versions
CN107566123A (en
Inventor
梁瑞彬
林俊阳
陈秀容
汤伟宾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Meiya Pico Information Co Ltd
Original Assignee
Xiamen Meiya Pico Information Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Meiya Pico Information Co Ltd filed Critical Xiamen Meiya Pico Information Co Ltd
Priority to CN201710665048.8A priority Critical patent/CN107566123B/en
Publication of CN107566123A publication Critical patent/CN107566123A/en
Application granted granted Critical
Publication of CN107566123B publication Critical patent/CN107566123B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention discloses a PPTP VPN password checking method and a computer readable storage medium, the method comprises: acquiring an authentication Hash value and an authentication response value of a PPTP VPN password; obtaining the authentication Hash value and the value of 2 bytes at the upper position of the NTHash value corresponding to the authentication response value; generating an index table according to the value of the upper 2 bytes of the NTHash value and the corresponding authentication Hash value and authentication response value; generating a password and calculating to obtain a suspicious NTHash value corresponding to the password; acquiring a corresponding authentication Hash value and an authentication response value according to the value of the upper 2 bytes of the suspicious NThash value; and checking the suspicious NTHash value according to the corresponding authentication Hash value and the authentication response value. The invention can reduce the traversal time and improve the verification efficiency.

Description

PPTP VPN password verification method and computer readable storage medium
Technical Field
The invention relates to the technical field of passwords, in particular to a PPTP VPN password verification method and a computer readable storage medium.
Background
A Virtual Private Network (VPN) based on a point-to-point tunneling protocol (PPTP) is a common tunneling protocol for establishing a private network on a public network and performing encrypted communication.
The PPTP protocol network message encryption adopts an encryption and decryption key obtained by carrying out a series of algorithm operations on a 16-byte NTHash value obtained by carrying out an MD4 encryption algorithm on a user password. Therefore, as long as the NTHash value can be obtained, the message of the user can be completely restored. The method includes the steps that a 24-byte authentication response value (challenge response) and a 20-byte authentication Hash value (challenge Hash) are directly obtained from plaintext information of a PPTP VPN password communication message, the challenge response is a ciphertext value obtained by encrypting 8 lower bytes of the challenge Hash through three independent DES, encryption keys of the three DES are obtained by respectively transforming 2 upper bytes, 7 middle bytes and 7 lower bytes of the NTHash value, and the NTHash value can be obtained only by respectively carrying out brute force traversal on the encryption keys of the three DES because the challenge response value and the challenge Hash value are known.
At present, brute force traversal of three groups of independent DES encryption keys is the most effective means for PPTP VPN password recovery, the recovery success rate can reach 100%, but each traversal can only complete the verification of a pair of challenge response and challenge hash values. How to improve the efficiency of verifying the PPTP VPN password is the current main research direction, the current research mainly focuses on improving the speed of violent traversal through various hardware acceleration, algorithm optimization and distributed technologies so as to shorten the traversal time, but the method for improving the traversal speed only can linearly reduce the single traversal time, and for a large amount of PPTP PVPN password information on the network, even if the same user logs in each time, the ChangleResponse and the ChangleHash values generated by different random codes are different, and the geometric progression of the traversal time can be increased if the verification of a large amount of PPTP VPN passwords is completed.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: a PPTP VPN password verification method and a computer readable storage medium are provided to improve the verification efficiency of PPTP VPN passwords.
In order to solve the technical problems, the invention adopts the technical scheme that: a PPTP VPN password verification method comprises the following steps:
acquiring an authentication Hash value and an authentication response value of a PPTP VPN password;
according to the value of the lower 8 bytes of the authentication Hash value and the value of the upper 8 bytes of the authentication response value, the value of the upper 2 bytes of the NThash value corresponding to the authentication Hash value and the authentication response value is obtained through violence traversal;
generating an index table according to the value of the upper 2 bytes of the NTHash value and the password information corresponding to the value, wherein the password information comprises an authentication Hash value and an authentication response value;
generating a password in a preset password traversal mode, and calculating to obtain a suspicious NTHash value corresponding to the password according to the password;
acquiring a corresponding authentication Hash value and an authentication response value from the index table according to the value of the upper 2 bytes of the suspicious NThash value;
and checking the suspicious NTHash value according to the corresponding authentication Hash value and the authentication response value.
The invention also relates to a computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method as described above.
The invention has the beneficial effects that: by utilizing the characteristic that one group of DES encryption algorithm can quickly recover the value of the upper 2 bytes of the corresponding NTHash value by traversing the encryption key of 2 bytes, the suspicious NTHash value is calculated by generating a password and an index table of the value of the upper 2 bytes of the NTHash value and the authentication Hash value and the authentication response value, and the corresponding authentication Hash value and the authentication response value are preliminarily found out by using the index table, and then further verification is carried out, thereby realizing the process of carrying out parallel verification on a plurality of groups of passwords by once traversal. The invention can reduce the traversal time and improve the verification efficiency.
Drawings
FIG. 1 is a flow chart of a PPTP VPN password verification method of the present invention;
FIG. 2 is a flowchart illustrating a first method of step S6 according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method of step S6 according to a first embodiment of the present invention;
FIG. 4 is a flowchart of the method of step S3 according to the second embodiment of the present invention;
FIG. 5 is a flowchart of the method of steps S5 and S6 according to the second embodiment of the present invention.
Detailed Description
In order to explain technical contents, objects and effects of the present invention in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
The most key concept of the invention is as follows: the brute force traversal exit enables the value of the upper 2 bytes of the NTHash value corresponding to the information to be found, and the password information corresponding to the suspicious NTHash value can be obtained quickly in the follow-up process by establishing the index table of the two values.
Referring to fig. 1, a method for verifying PPTP VPN password includes:
acquiring an authentication Hash value and an authentication response value of a PPTP VPN password;
according to the value of the lower 8 bytes of the authentication Hash value and the value of the upper 8 bytes of the authentication response value, the value of the upper 2 bytes of the NThash value corresponding to the authentication Hash value and the authentication response value is obtained through violence traversal;
generating an index table according to the value of the upper 2 bytes of the NTHash value and the password information corresponding to the value, wherein the password information comprises an authentication Hash value and an authentication response value;
generating a password in a preset password traversal mode, and calculating to obtain a suspicious NTHash value corresponding to the password according to the password;
acquiring a corresponding authentication Hash value and an authentication response value from the index table according to the value of the upper 2 bytes of the suspicious NThash value;
and checking the suspicious NTHash value according to the corresponding authentication Hash value and the authentication response value.
From the above description, the beneficial effects of the present invention are: the traversal time can be reduced, and the checking efficiency is improved.
Further, the password information includes a value of the lower 8 bytes of the authentication Hash value and a value of the middle 8 bytes or the lower 8 bytes of the authentication response value.
As can be seen from the above description, since the data mainly used for the subsequent verification is the value of the lower 8 bytes of the authentication Hash value and the value of the middle 8 bytes or the lower 8 bytes of the authentication response value, the verification can be completed by only storing these pieces of information, and the occupied space of the index table can be reduced.
Further, the "checking the suspicious NTHash value according to the corresponding authentication Hash value and authentication response value" specifically includes:
transforming the value of 7 bytes at the lower position of the suspicious NTHash value to generate an encryption key of 8 bytes;
according to the encryption key, DES encryption is carried out on the value of 8 bytes at the lower position of the authentication Hash value corresponding to the suspicious NThash value to obtain a first ciphertext;
judging whether the values of the lower 8 bytes of the authentication response value corresponding to the first ciphertext and the suspicious NTHash value are the same or not;
if yes, judging that the verification is passed;
if not, the verification is judged not to pass.
As can be seen from the above description, since the value of the lower 8 bytes of the authentication response value is obtained by encrypting the value of the lower 8 bytes of the authentication Hash value through the set of DES, and the encryption key is obtained according to the value of the lower 7 bytes of the NTHash value, the suspicious NTHash value can be verified by using this feature.
Further, the "checking the suspicious NTHash value according to the corresponding authentication Hash value and authentication response value" specifically includes:
transforming the value of the suspicious NTHash value from the 3 rd byte to the 9 th byte from the high order to the low order to generate an encryption key of 8 bytes;
according to the encryption key, DES encryption is carried out on the value of 8 bytes at the lower position of the authentication Hash value corresponding to the suspicious NThash value to obtain a second ciphertext;
judging whether the values of the middle 8 bytes of the authentication response value corresponding to the second ciphertext and the suspicious NTHash value are the same or not;
if yes, judging that the verification is passed;
if not, the verification is judged not to pass.
As can be seen from the above description, since the value of the middle 8 bytes of the authentication response value is obtained by encrypting the value of the lower 8 bytes of the authentication Hash value by using a set of DES, and the encryption key is obtained according to the value of the upper 3 rd byte to the lower 9 th byte of the NTHash value, the suspicious NTHash value can be verified by using this feature.
Further, after the "if, determining that the check passes", further comprising:
according to the corresponding authentication Hash value and the authentication response value, carrying out complete verification on the suspicious NTHash value;
and if the verification is passed, judging that the suspicious NTHash value is the NTHash value corresponding to the authentication Hash value and the authentication response value.
As can be seen from the above description, after the verification, it indicates that the restructuring password information corresponding to the suspicious NTHash value is a large probability event, and at this time, complete verification is performed, so as to further ensure the accuracy of the result.
Further, the "generating a password in a preset password traversal manner, and calculating to obtain a suspicious NTHash value corresponding to the password" specifically includes:
generating a password in a violence traversal or dictionary traversal mode;
and performing MD4 encryption operation on the password to obtain a suspicious NTHash value corresponding to the password.
From the above description, it can be seen that, because the user password has 16-byte NTHash value obtained by MD4 encryption algorithm, by using this feature, a large number of suspicious NTHash values can be calculated according to a large number of traversed passwords.
Further, the "generating an index table according to the value of the upper 2 bytes of the NTHash value and the password information corresponding thereto" specifically includes:
constructing a first index table, a second index table and a third index table, wherein index addresses in the first index table and the second index table are first index addresses, the values of the first index addresses are 0-65535 respectively, and the index address in the third index table is a second index address;
storing the password information into a third index table to obtain a second index address corresponding to the password information;
setting the flag bits stored in the first index address matched with the value of the upper 2 bytes of the NTHash value as effective values in the first index table, and setting the flag bits stored in other first index addresses as invalid values;
acquiring a first index address matched with a value of 2 bytes at the upper position of an NTHash value corresponding to a password information from a second index table;
judging whether the matched first index address is occupied or not;
if not, writing a second index address corresponding to the password information into the matched first index address;
if so, writing a second index address corresponding to the password information into a next unoccupied first index address along the matched first index address;
if other password information with the same value of the high-order 2 bytes of the corresponding NTHash value and the high-order 2 bytes of the NTHash value corresponding to the password information exists, second index addresses corresponding to the other password information are sequentially written into a next unoccupied first index address extended by a third index address in a second index table, and the third index address is the first index address in which the second index address corresponding to the password information is stored.
From the above description, dividing the index table into three pieces can optimize the processing efficiency of the FPGA.
Further, the step of acquiring a corresponding authentication Hash value and an authentication response value from the index table according to the value of the upper 2 bytes of the suspicious NTHash value; according to the corresponding authentication Hash value and authentication response value, the step of checking the suspicious NTHash value specifically comprises the following steps:
judging whether a flag bit stored in a first index address matched with the value of the upper 2 bytes of the suspicious NTHash value in the first index table is a valid value or not;
if yes, storing the suspicious NTHash value into a FIFO memory;
sequentially acquiring a suspicious NTHash value from the FIFO memory;
acquiring a second index address stored in a first index address matched with the value of the upper 2 bytes of the suspicious NTHash value from a second index table;
acquiring corresponding password information in a third index table according to the acquired second index address;
checking the suspicious NTHash value according to the corresponding password information;
acquiring a next first index address of a first index address continuation matched with the value of the high-order 2 bytes of the suspicious NTHash value;
judging whether the next first index address stores a valid second index address;
if not, judging that the check of the suspicious NTHash value is finished;
if so, acquiring a second index address stored in the next first index address;
acquiring corresponding password information in a third index table according to the acquired second index address;
checking the suspicious NTHash value according to the corresponding password information;
acquiring a next first index address of the next first index address;
and continuing to execute the step of judging whether the next first index address stores a valid second index address.
As can be seen from the above description, it can be ensured that each group of password information corresponding to the suspicious NTHash value is verified.
The invention also proposes a computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method as described above.
Example one
Referring to fig. 1, a first embodiment of the present invention is: a PPTP VPN password verification method comprises the following steps:
s1: acquiring an authentication Hash value and an authentication response value of a PPTP VPN password; the authentication response value (challenge response) of 24 bytes and the authentication Hash value (challenge Hash) of 20 bytes can be directly obtained from the plaintext information of the PPTP VPN password communication message.
S2: according to the value of the lower 8 bytes of the authentication Hash value and the value of the upper 8 bytes of the authentication response value, the value of the upper 2 bytes of the NThash value corresponding to the authentication Hash value and the authentication response value is obtained through violence traversal; because the value of the upper 2 bytes of the NTHash value is used as an encryption key after specific transformation, and the value of the lower 8 bytes of the authentication Hash value is encrypted to obtain the value of the upper 8 bytes of the authentication response value, the value of the upper 2 bytes of the NTHash value corresponding to the authentication Hash value and the authentication response value can be obtained through violent traversal.
S3: generating an index table according to the value of the upper 2 bytes of the NTHash value and the password information corresponding to the value, wherein the password information comprises an authentication Hash value and an authentication response value; the value of the high-order 2 bytes of the NTHash value can be used as an index address, and the authentication Hash value and the authentication response value corresponding to the NTHash value are stored in the index address; since there may be more than two groups of password information corresponding to the same NTHash value, if there is only one index table, there may be more than two groups of password information stored in one index address.
Further, when the index table is one, the range of the index address may include only the index address corresponding to the value of the upper 2 bytes of the NTHash value, or the range of the index address may be set to 0 to 65535 (total 2 index addresses of 16 th power), in this case, the field of the index table may include the index address, a flag bit, a password number, and password information, where the flag bit is used to mark whether the index address is valid, that is, whether the value of the upper 2 bytes of the NTHash value matches with the value of the index address, and if there is a value of the upper 2 bytes of the NTHash value matching with the index address, the flag bit corresponding to the index address is set to a valid value; the password number is used for recording the group number of password information corresponding to the NTHash value corresponding to the index address; and the password information is used for recording password information corresponding to the NTHash value corresponding to the index address.
S4: generating a password in a preset password traversal mode, and calculating to obtain a suspicious NTHash value corresponding to the password according to the password; further, a password is generated through violence traversal or dictionary traversal, the password is encrypted through MD4, and the obtained ciphertext is the suspicious NTHash value corresponding to the password. Each password may calculate a suspect NTHash value.
S5: acquiring a corresponding authentication Hash value and an authentication response value from the index table according to the value of the upper 2 bytes of the suspicious NThash value;
s6: and checking the suspicious NTHash value according to the corresponding authentication Hash value and the authentication response value. If a suspicious NTHash value obtains more than two groups of password information, the suspicious NTHash value is respectively checked.
Further, the step S6 may include one of the following two specific verification methods, or both of them may be performed;
first, as shown in fig. 2, the method includes the following steps:
s601: transforming the value of 7 bytes at the lower position of the suspicious NTHash value to generate an encryption key of 8 bytes;
s602: according to the encryption key, DES encryption is carried out on the value of 8 bytes at the lower position of the authentication Hash value corresponding to the suspicious NThash value to obtain a first ciphertext;
s603: judging whether the values of the lower 8 bytes of the authentication response value corresponding to the first ciphertext and the suspicious NTHash value are the same, if so, executing a step S604, and if not, executing a step S605;
s604: judging that the verification is passed;
s605: and judging that the verification fails.
Secondly, as shown in fig. 3, the method comprises the following steps:
s611: transforming the value of the suspicious NTHash value from the 3 rd byte to the 9 th byte from the high order to the low order (or from the 8 th byte to the 14 th byte from the low order to the high order) to generate an 8-byte encryption key;
s612: according to the encryption key, DES encryption is carried out on the value of 8 bytes at the lower position of the authentication Hash value corresponding to the suspicious NThash value to obtain a second ciphertext;
s613: judging whether the values of the middle 8 bytes of the authentication response value corresponding to the second ciphertext and the suspicious NTHash value are the same, if so, executing a step S614, and if not, executing a step S615;
s614: judging that the verification is passed;
s615: and judging that the verification fails.
The two above modes differ only in the position of the 7 bytes taken from the suspect NTHash value and in the position of the 8 bytes of the matching authentication response value.
Since the authentication response value is 24 bytes, the upper 8 bytes of the authentication response value are from the 1 st byte to the 8 th byte from the upper bit to the lower bit, the middle 8 bytes are from the 9 th byte to the 16 th byte, and the lower 8 bytes are from the 17 th byte to the 24 th byte.
Further, for the transformation in S601 and S611, the same binary number (0 or 1) may be inserted into every 7 bits of the 7-byte values of the suspected NTHash value, so as to obtain 8-byte values.
Further, when only one of the two verification methods is performed in step S6, since only the value of the lower 8 bytes of the authentication Hash value and the value of the middle 8 bytes or the lower 8 bytes of the authentication response value need to be used, the password information may only include the value of the lower 8 bytes of the authentication Hash value and the value of the middle 8 bytes or the lower 8 bytes of the authentication response value, so as to reduce the occupied space of the index table. When both of the above-described verification methods are performed in step S6, the password information includes a value of the lower 8 bytes of the authentication Hash value and a value of the middle 8 bytes and a value of the lower 8 bytes of the authentication response value.
Further, after steps S604 and S614, the suspicious NTHash value may be completely checked according to the corresponding authentication Hash value and authentication response value. Specifically, the upper 2 bytes, the middle 7 bytes and the lower 7 bytes of the suspicious NTHash value are respectively transformed to obtain three sets of DES encryption keys, then DES encryption is respectively performed on the lower 8 bytes of the authentication Hash value, the obtained three sets of ciphertexts are respectively matched with the upper 8 bytes, the middle 8 bytes and the lower 8 bytes of the authentication response value, and if the two sets of ciphertexts are the same, the suspicious NTHash value is determined to be the NTHash value corresponding to the authentication Hash value and the authentication response value.
In the embodiment, by utilizing the characteristic that one group of DES encryption algorithm can quickly recover the value of the upper 2 bytes of the corresponding NTHash value by traversing the encryption key of 2 bytes, through establishing an index table of the value of the upper 2 bytes of the NTHash value and the authentication Hash value and the authentication response value, generating a password to calculate the suspicious NTHash value, preliminarily finding out the corresponding authentication Hash value and the authentication response value by using the index table, and then performing further verification, thereby realizing the process of performing parallel verification on a plurality of groups of passwords by once traversal. The traversal time can be reduced, and the checking efficiency is improved.
Example two
This embodiment is a further development of steps S3, S5, and S6 in the first embodiment.
As shown in fig. 4, the step S3 includes the following steps:
s301: and constructing a first index table, a second index table and a third index table, wherein index addresses in the first index table and the second index table are first index addresses, the values of the first index addresses are 0-65535 respectively, and the index address in the third index table is a second index address.
S302: storing the password information into a third index table to obtain a second index address corresponding to the password information; that is, the password information is stored in the space of the second index addresses in the third index table, and only one group of password information is stored in each space of the second index addresses.
S303: setting the flag bits stored in the first index address matched with the value of the upper 2 bytes of the NTHash value as effective values in the first index table, and setting the flag bits stored in other first index addresses as invalid values; for example, if the value of the upper 2 bytes of the NTHash value corresponding to a group of password information is 0x1F10, a preset effective value (e.g., 1) is written in the space with the first index address of 0x1F10 in the first index table, and when the value of the upper 2 bytes of the NTHash value is the value of the address, the corresponding password information exists; if the value of the upper 2 bytes of the NTHash value of all password information is not matched with a first index address, a preset invalid value (such as 0) is written in the space of the first index address, and when the value of the upper 2 bytes of the NTHash value is the value of the address, corresponding password information does not exist.
S304: acquiring a first index address matched with a value of 2 bytes at the upper position of an NTHash value corresponding to a password information from a second index table;
s305: and judging whether the matched first index address is occupied, if not, executing a step S306, and if so, executing a step S307.
S306: writing a second index address corresponding to the password information into the matched first index address; step S308 is performed.
S307: writing a second index address corresponding to the password information into a next unoccupied first index address along the matched first index address; step S308 is performed.
S308: and judging whether other password information exists, wherein the value of the upper 2 bytes of the NTHash value corresponding to the other password information is the same as the value of the upper 2 bytes of the NTHash value corresponding to the password information, and if so, executing the step S309.
S309: and sequentially writing second index addresses corresponding to the other password information into a next unoccupied first index address along a third index address in a second index table, wherein the third index address is the first index address in which the second index address corresponding to the password information is stored.
For steps S304-S309, the second index table is re-ordered. Specifically, when the values of the upper 2 bytes of the NTHash value corresponding to more than two groups of password information are the same, the corresponding first index address needs to be carried forward; for example, if the values of the upper 2 bytes of the NTHash values corresponding to two sets of password information are all 0x1F10, the second index address corresponding to one set of password information is filled in the 0x1F10 address, and the second index address corresponding to the other set of password information is filled in the 0x1F11 address. If the high-order 2 bytes of NTHash values corresponding to a group of password information have uniqueness, but the corresponding address space is occupied, the backward continuation is also needed; for example, if the upper 2 bytes of the NTHash value corresponding to the current set of password information is 0x1F11, and the 0x1F11 address space is already occupied, the second index address corresponding to the current set of password information should be filled in the 0x1F12 address. If the upper 2 bytes of the NTHash values corresponding to the two groups of password information have a value of 0x1F11, and the 0x1F11 address space is already occupied, the second index address corresponding to one group of password information is filled in the 0x1F12 address, the second index address corresponding to the other group of password information is filled in the 0x1F13 address, and so on.
After step S309, for the unoccupied first index addresses in the second index table, a predetermined invalid value (e.g., 0x1FFF) may be filled in the first index addresses.
As can be seen from the above steps, in this embodiment, the index table is divided into three index tables, which are the first index table, the second index table and the third index table.
The space size of the first index table is 65536 × 1, the index address range is 0-65535, each address space stores 1-bit information, i.e. 1-bit flag bits, in this embodiment, 0 represents an invalid value, and 1 represents an effective value.
The space size of the second index table is 65536 × 13, the index address range is 0-65535, each address space stores 13-bit information, represents the index address of the third index table, and appoints 0 × 1FFF as an invalid value.
The space size of the third index table is 8192 multiplied by 128, the index address range is 0-8191, and each address space stores 128-bit information, specifically, a value of the lower 8 bytes of the authentication Hash value and a value of the middle 8 bytes or the lower 8 bytes of the authentication response value.
The purpose of the first index table is to primarily screen suspicious NThash values, and in order to prevent overflow of a subsequent cache due to excessive screened suspicious NThash values, theoretically, the number of effective information in the first index table cannot exceed one eighth of a table space, that is, a group of index tables (the three index tables are a group of index tables) stores about 8000 groups of password information at most. Therefore, 8192 index addresses, namely 13 powers of 2, are set in the third index table, and therefore, each address space in the second index table stores 13-bit information. If more than 8000 groups of password information need to be checked at the same time, a plurality of groups of index tables can be set.
Step S3 may be executed by the CPU, and then the obtained three index tables are configured into a table space corresponding to the FPGA, and a password traversal mode is configured.
In step S4, the FPGA generates passwords according to the configured password traversal manner, and each password calculates a corresponding suspicious NTHash value.
Since the storage manner of the index table in step S3 is improved, steps S5 and S6 are also improved.
As shown in fig. 5, the steps S5, S6 corresponding to the above step S3 include the steps of:
s501: judging whether a flag bit stored in a first index address matched with the value of the upper 2 bytes of the suspicious NTHash value in the first index table is a valid value or not; if yes, go to step S502. For example, if the value of the upper 2 bytes of a suspected NTHash value is 0x1F10, and the information in the space of the 0x1F10 address in the first index table is 1, which represents a valid value, step S502 is executed, otherwise, the suspected NTHash value is discarded, and the next suspected NTHash value is determined.
S502: storing the suspicious NTHash value into a FIFO memory; because the FPGA adopts a full-flow design, the purpose of storing the suspicious NTHash value into the FIFO memory is to prevent the current NTHash value from not processing the following flow and causing a conflict with another NTHash value in the following steps.
S503: obtaining a suspicious NTHash value from the FIFO memory;
s504: acquiring a second index address stored in a first index address matched with the value of the upper 2 bytes of the suspicious NTHash value from a second index table;
s505: acquiring corresponding password information in a third index table according to the acquired second index address;
s506: checking the suspicious NTHash value according to the corresponding password information; this step corresponds to step S6 in the first embodiment;
s507: acquiring a next sequential first index address, namely ad +1, wherein the initial value of the ad is the value of the high-order 2 bytes of the current suspicious NTHash value;
s508: judging whether the next first index address stores a valid second index address, namely judging whether the second index address in the third index table is stored instead of an invalid value (0x1 FFF); if yes, executing step S509, if no, determining that the checking of the suspicious NTHash value is completed, and acquiring the next suspicious NTHash value from the FIFO memory, that is, executing step S503 until all the suspicious NTHash values in the FIFO memory have been traversed.
S509: acquiring a second index address stored in the next first index address; the process returns to step S505.
That is to say, a suspicious NTHash value is read from the FIFO memory, a value of 2 bytes at the upper position of the suspicious NTHash value is taken as an index address of the second index table, a corresponding second index address is read, corresponding password information is read from the third index table according to the second index address for verification, after the verification is completed, values in an address space behind the index address in the second index table need to be sequentially read for further verification, and the next suspicious NTHash value can be read from the FIFO memory only if the verification of the current suspicious NTHash value is completed until the value in the index address in the second index table is an invalid value 0x1 FFF.
For example, in the second index table, the address spaces of 0x1F10, 0x1F11, 0x1F12, and 0x1F13 all store the second index address, and the address space of 0x1F14 stores the invalid value of 0x1FFF, so if the value of the upper 2 bytes of a suspected NTHash value is 0x1F10, it is necessary to sequentially obtain the second index address in the four address spaces of 0x1F10, 0x1F11, 0x1F12, and 0x1F13, and after obtaining the second index address in one address space, obtain the corresponding password information from the third index table according to the second index address to check, and after the check is completed, obtain the second index information in the next address space, and so on.
In the embodiment, the index table is divided into three tables, so that the efficiency of the FPGA can be optimized; and acquiring a second index address from the space of the first index address matched with the value of the upper 2 bytes of the suspicious NTHash value in a second index table, thereby acquiring the second index address in the subsequent address space after acquiring the corresponding password information for verification, and verifying the corresponding password information to ensure that each group of password information corresponding to the suspicious NTHash value is verified.
EXAMPLE III
The present embodiment is a computer-readable storage medium corresponding to the above-mentioned embodiments, on which a computer program is stored, which when executed by a processor, performs the steps of:
acquiring an authentication Hash value and an authentication response value of a PPTP VPN password;
according to the value of the lower 8 bytes of the authentication Hash value and the value of the upper 8 bytes of the authentication response value, the value of the upper 2 bytes of the NThash value corresponding to the authentication Hash value and the authentication response value is obtained through violence traversal;
generating an index table according to the value of the upper 2 bytes of the NTHash value and the password information corresponding to the value, wherein the password information comprises an authentication Hash value and an authentication response value;
generating a password in a preset password traversal mode, and calculating to obtain a suspicious NTHash value corresponding to the password according to the password;
acquiring a corresponding authentication Hash value and an authentication response value from the index table according to the value of the upper 2 bytes of the suspicious NThash value;
and checking the suspicious NTHash value according to the corresponding authentication Hash value and the authentication response value.
Further, the password information includes a value of the lower 8 bytes of the authentication Hash value and a value of the middle 8 bytes or the lower 8 bytes of the authentication response value.
Further, the "checking the suspicious NTHash value according to the corresponding authentication Hash value and authentication response value" specifically includes:
transforming the value of 7 bytes at the lower position of the suspicious NTHash value to generate an encryption key of 8 bytes;
according to the encryption key, DES encryption is carried out on the value of 8 bytes at the lower position of the authentication Hash value corresponding to the suspicious NThash value to obtain a first ciphertext;
judging whether the values of the lower 8 bytes of the authentication response value corresponding to the first ciphertext and the suspicious NTHash value are the same or not;
if yes, judging that the verification is passed;
if not, the verification is judged not to pass.
Further, the "checking the suspicious NTHash value according to the corresponding authentication Hash value and authentication response value" specifically includes:
transforming the value of the suspicious NTHash value from the 3 rd byte to the 9 th byte from the high order to the low order to generate an encryption key of 8 bytes;
according to the encryption key, DES encryption is carried out on the value of 8 bytes at the lower position of the authentication Hash value corresponding to the suspicious NThash value to obtain a second ciphertext;
judging whether the values of the middle 8 bytes of the authentication response value corresponding to the second ciphertext and the suspicious NTHash value are the same or not;
if yes, judging that the verification is passed;
if not, the verification is judged not to pass.
Further, after the "if, determining that the check passes", further comprising:
according to the corresponding authentication Hash value and the authentication response value, carrying out complete verification on the suspicious NTHash value;
and if the verification is passed, judging that the suspicious NTHash value is the NTHash value corresponding to the authentication Hash value and the authentication response value.
Further, the "generating a password in a preset password traversal manner, and calculating to obtain a suspicious NTHash value corresponding to the password" specifically includes:
generating a password in a violence traversal or dictionary traversal mode;
and performing MD4 encryption operation on the password to obtain a suspicious NTHash value corresponding to the password.
Further, the "generating an index table according to the value of the upper 2 bytes of the NTHash value and the password information corresponding thereto" specifically includes:
constructing a first index table, a second index table and a third index table, wherein index addresses in the first index table and the second index table are first index addresses, the values of the first index addresses are 0-65535 respectively, and the index address in the third index table is a second index address;
storing the password information into a third index table to obtain a second index address corresponding to the password information;
setting the flag bits stored in the first index address matched with the value of the upper 2 bytes of the NTHash value as effective values in the first index table, and setting the flag bits stored in other first index addresses as invalid values;
acquiring a first index address matched with a value of 2 bytes at the upper position of an NTHash value corresponding to a password information from a second index table;
judging whether the matched first index address is occupied or not;
if not, writing a second index address corresponding to the password information into the matched first index address;
if so, writing a second index address corresponding to the password information into a next unoccupied first index address along the matched first index address;
if other password information with the same value of the high-order 2 bytes of the corresponding NTHash value and the high-order 2 bytes of the NTHash value corresponding to the password information exists, second index addresses corresponding to the other password information are sequentially written into a next unoccupied first index address extended by a third index address in a second index table, and the third index address is the first index address in which the second index address corresponding to the password information is stored.
Further, the step of acquiring a corresponding authentication Hash value and an authentication response value from the index table according to the value of the upper 2 bytes of the suspicious NTHash value; according to the corresponding authentication Hash value and authentication response value, the step of checking the suspicious NTHash value specifically comprises the following steps:
judging whether a flag bit stored in a first index address matched with the value of the upper 2 bytes of the suspicious NTHash value in the first index table is a valid value or not;
if yes, storing the suspicious NTHash value into a FIFO memory;
sequentially acquiring a suspicious NTHash value from the FIFO memory;
acquiring a second index address stored in a first index address matched with the value of the upper 2 bytes of the suspicious NTHash value from a second index table;
acquiring corresponding password information in a third index table according to the acquired second index address;
checking the suspicious NTHash value according to the corresponding password information;
acquiring a next first index address of a first index address continuation matched with the value of the high-order 2 bytes of the suspicious NTHash value;
judging whether the next first index address stores a valid second index address;
if not, judging that the check of the suspicious NTHash value is finished;
if so, acquiring a second index address stored in the next first index address;
acquiring corresponding password information in a third index table according to the acquired second index address;
checking the suspicious NTHash value according to the corresponding password information;
acquiring a next first index address of the next first index address;
and continuing to execute the step of judging whether the next first index address stores a valid second index address.
In summary, according to the PPTP VPN password verification method and the computer-readable storage medium provided by the present invention, by using the characteristic that one set of DES encryption algorithm can quickly recover the value of the upper 2 bytes of the corresponding NTHash value by traversing the encryption key of 2 bytes, the suspicious NTHash value is calculated by establishing the index table of the value of the upper 2 bytes of the NTHash value and the authentication Hash value and the authentication response value, and then the index table is used to preliminarily find out the corresponding authentication Hash value and the authentication response value, and then further verification is performed, thereby realizing the process of performing parallel verification on multiple sets of passwords by traversing once. The invention can reduce the traversal time and improve the verification efficiency.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.

Claims (8)

1. A PPTP VPN password verification method is characterized by comprising the following steps:
acquiring an authentication Hash value and an authentication response value of a PPTP VPN password;
according to the value of the lower 8 bytes of the authentication Hash value and the value of the upper 8 bytes of the authentication response value, the value of the upper 2 bytes of the NThash value corresponding to the authentication Hash value and the authentication response value is obtained through violence traversal;
generating an index table according to the value of the upper 2 bytes of the NTHash value and the password information corresponding to the value, wherein the password information comprises an authentication Hash value and an authentication response value;
generating a password in a preset password traversal mode, and calculating to obtain a suspicious NTHash value corresponding to the password according to the password;
acquiring a corresponding authentication Hash value and an authentication response value from the index table according to the value of the upper 2 bytes of the suspicious NThash value;
checking the suspicious NTHash value according to the corresponding authentication Hash value and the authentication response value;
the steps of generating a password in a preset password traversal mode and calculating to obtain a suspicious NTHash value corresponding to the password are as follows:
generating a password in a violence traversal or dictionary traversal mode;
and performing MD4 encryption operation on the password to obtain a suspicious NTHash value corresponding to the password.
2. The PPTP VPN password verification method of claim 1, wherein the password information comprises a value of the lower 8 bytes of the authentication Hash value and a value of the middle 8 bytes or the lower 8 bytes of the authentication reply value.
3. The PPTP VPN password verification method according to claim 1, wherein said "verifying the suspicious NTHash value according to the corresponding authentication Hash value and authentication response value" specifically comprises:
transforming the value of 7 bytes at the lower position of the suspicious NTHash value to generate an encryption key of 8 bytes;
according to the encryption key, DES encryption is carried out on the value of 8 bytes at the lower position of the authentication Hash value corresponding to the suspicious NThash value to obtain a first ciphertext;
judging whether the values of the lower 8 bytes of the authentication response value corresponding to the first ciphertext and the suspicious NTHash value are the same or not;
if yes, judging that the verification is passed;
if not, the verification is judged not to pass.
4. The PPTP VPN password verification method according to claim 1, wherein said "verifying the suspicious NTHash value according to the corresponding authentication Hash value and authentication response value" specifically comprises:
transforming the value of the suspicious NTHash value from the 3 rd byte to the 9 th byte from the high order to the low order to generate an encryption key of 8 bytes;
according to the encryption key, DES encryption is carried out on the value of 8 bytes at the lower position of the authentication Hash value corresponding to the suspicious NThash value to obtain a second ciphertext;
judging whether the values of the middle 8 bytes of the authentication response value corresponding to the second ciphertext and the suspicious NTHash value are the same or not;
if yes, judging that the verification is passed;
if not, the verification is judged not to pass.
5. The PPTP VPN password verification method as claimed in claim 3 or 4, wherein after determining that the verification is passed if yes, further comprising:
according to the corresponding authentication Hash value and the authentication response value, carrying out complete verification on the suspicious NTHash value;
and if the verification is passed, judging that the suspicious NTHash value is the NTHash value corresponding to the authentication Hash value and the authentication response value.
6. The PPTP VPN password verification method according to claim 1, wherein the generating of the index table according to the value of the upper 2 bytes of the NTHash value and the password information corresponding thereto specifically comprises:
constructing a first index table, a second index table and a third index table, wherein index addresses in the first index table and the second index table are first index addresses, the values of the first index addresses are 0-65535 respectively, and the index address in the third index table is a second index address;
storing the password information into a third index table to obtain a second index address corresponding to the password information;
setting the flag bits stored in the first index address matched with the value of the upper 2 bytes of the NTHash value as effective values in the first index table, and setting the flag bits stored in other first index addresses as invalid values;
acquiring a first index address matched with a value of 2 bytes at the upper position of an NTHash value corresponding to a password information from a second index table;
judging whether the matched first index address is occupied or not;
if not, writing a second index address corresponding to the password information into the matched first index address;
if so, writing a second index address corresponding to the password information into a next unoccupied first index address along the matched first index address;
if other password information with the same value of the high-order 2 bytes of the corresponding NTHash value and the high-order 2 bytes of the NTHash value corresponding to the password information exists, second index addresses corresponding to the other password information are sequentially written into a next unoccupied first index address extended by a third index address in a second index table, and the third index address is the first index address in which the second index address corresponding to the password information is stored.
7. The PPTP VPN password verification method according to claim 6, wherein said "obtaining the corresponding authentication Hash value and authentication response value from the index table according to the value of the upper 2 bytes of the suspected NTHash value; according to the corresponding authentication Hash value and authentication response value, the step of checking the suspicious NTHash value specifically comprises the following steps:
judging whether a flag bit stored in a first index address matched with the value of the upper 2 bytes of the suspicious NTHash value in the first index table is a valid value or not;
if yes, storing the suspicious NTHash value into a FIFO memory;
sequentially acquiring a suspicious NTHash value from the FIFO memory;
acquiring a second index address stored in a first index address matched with the value of the upper 2 bytes of the suspicious NTHash value from a second index table;
acquiring corresponding password information in a third index table according to the acquired second index address;
checking the suspicious NTHash value according to the corresponding password information;
acquiring a next first index address of a first index address continuation matched with the value of the high-order 2 bytes of the suspicious NTHash value;
judging whether the next first index address stores a valid second index address;
if not, judging that the check of the suspicious NTHash value is finished;
if so, acquiring a second index address stored in the next first index address;
acquiring corresponding password information in a third index table according to the acquired second index address;
checking the suspicious NTHash value according to the corresponding password information;
acquiring a next first index address of the next first index address;
and continuing to execute the step of judging whether the next first index address stores a valid second index address.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN201710665048.8A 2017-08-07 2017-08-07 PPTP VPN password verification method and computer readable storage medium Active CN107566123B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710665048.8A CN107566123B (en) 2017-08-07 2017-08-07 PPTP VPN password verification method and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710665048.8A CN107566123B (en) 2017-08-07 2017-08-07 PPTP VPN password verification method and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107566123A CN107566123A (en) 2018-01-09
CN107566123B true CN107566123B (en) 2021-04-27

Family

ID=60975190

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710665048.8A Active CN107566123B (en) 2017-08-07 2017-08-07 PPTP VPN password verification method and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107566123B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111181972A (en) * 2019-12-31 2020-05-19 厦门市美亚柏科信息股份有限公司 Processing method and device for PPTP data real-time analysis
CN112751821B (en) * 2020-07-29 2022-12-13 上海安辰网络科技有限公司 Data transmission method, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105847247A (en) * 2016-03-21 2016-08-10 飞天诚信科技股份有限公司 Authentication system and working method thereof
CN106789524A (en) * 2016-11-24 2017-05-31 中国电子科技集团公司第三十研究所 The high speed parsing of VPN encrypted tunnels and restoring method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8892885B2 (en) * 2011-08-31 2014-11-18 Duo Security, Inc. System and method for delivering a challenge response in an authentication protocol
KR101492442B1 (en) * 2014-01-09 2015-02-24 한국전자통신연구원 Apparatus and method for packet analysis, vpn server

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105847247A (en) * 2016-03-21 2016-08-10 飞天诚信科技股份有限公司 Authentication system and working method thereof
CN106789524A (en) * 2016-11-24 2017-05-31 中国电子科技集团公司第三十研究所 The high speed parsing of VPN encrypted tunnels and restoring method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
破解PPTP加密类型的VPN;此号被封;《安全脉搏》;20150424;全文 *

Also Published As

Publication number Publication date
CN107566123A (en) 2018-01-09

Similar Documents

Publication Publication Date Title
JP6084757B2 (en) Structure and use of variable input length adjustable ciphers
US10009169B2 (en) Format-preserving cipher
US8442218B2 (en) Method and apparatus for compound hashing via iteration
US10461924B2 (en) Format-preserving cipher
CN114175572B (en) System and method for performing equal and less operations on encrypted data using a quasi-group operation
US20110179281A1 (en) Hash function using a quasi-group operation
WO2015156786A1 (en) Redactable document signatures
US9313023B1 (en) Format-preserving cipher
US10805090B1 (en) Address whitelisting using public/private keys and ring signature
JP2008513811A (en) Calculation conversion method and system
CN107566123B (en) PPTP VPN password verification method and computer readable storage medium
Chaigneau et al. Cryptanalysis of NORX v2. 0
EP3078154B1 (en) A computing device for iterative application of table networks
KR102142955B1 (en) A privatekey management method
CN114065242A (en) Privacy data protection method based on block chain technology
US8832450B2 (en) Methods and apparatus for data hashing based on non-linear operations
CN117135291A (en) Image encryption method, system, equipment and medium
CN111901097A (en) White box implementation method and device, electronic equipment and computer storage medium
US20220321322A1 (en) Encryption device, decryption device, encryption method, decryption method, and computer readable medium
JP6844696B2 (en) Authentication tag generator, authentication tag verification device, method and program
Biham New techniques for cryptanalysis of hash functions and improved attacks on Snefru
EP3832945A1 (en) System and method for protecting memory encryption against template attacks
US20110302422A1 (en) Hash function using a repeated function with shifts
CN112836239A (en) Method and device for cooperatively determining target object data by two parties for protecting privacy
Bok-Min et al. Incremental hash function based on pair chaining & modular arithmetic combining

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant