Password recovery method and system for VPN network layer, and storage medium

Through intercepting packets and Diffie-Hellman key replacement technology, combined with MD5 iterative traversal and MS-CHAP authentication, PSK and Password recovery of L2TP/IPSec VPN is realized, solving the problem of short timeliness and inability to recover simultaneously in the existing technology. , reduces the amount of calculation and improves the long-term effectiveness of recovery.

CN119324778APending Publication Date: 2025-01-17NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411310953.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

The existing L2TP/IPSec VPN password recovery technology mainly relies on vulnerabilities and exhaustive methods, with short timeliness, and cannot recover PSK and Password in both active and main modes at the same time, and is invalid for Password recovery.

Method used

Obtain target parameters by intercepting the data packet, use the Diffie-Hellman encryption algorithm to generate key K, combine it with MD5 iterative traversal, obtain the pre-shared key PSK and login password Password, and perform key replacement and MS-CHAP authentication on the intermediate server to achieve PSK and Password recovery.

Benefits of technology

It realizes the simultaneous recovery of PSK and Password in the active mode of L2TP/IPSec VPN and the main mode, reducing the amount of computing, long-term timeliness, and not limited to encryption algorithms and modes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119324778A_ABST
    Figure CN119324778A_ABST
Patent Text Reader

Abstract

The invention discloses a password recovery method and system of a VPN network layer and a storage medium, and relates to the communication and network security technology, and the method comprises the steps: in a positive mode of L2TP / IPSecVPN, obtaining a target parameter based on an intercepted data packet, and completing the negotiation of a pre-shared key PSK; the method comprises the following steps: in a main mode of an L2TP / IPSec VPN, firstly obtaining a key K generated by a Diffie-Hellman algorithm, and traversing a pre-shared key PSK based on the key K; and on the basis of the obtained PSK, carrying out MD5 iterative traversal so as to obtain an L2TP / IPSec login password Password. According to the method, PSK and Password in the positive mode and the main mode can be recovered at the same time, and the calculation amount is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication and network security technology, and in particular to a method, system and storage medium for recovering a password at a VPN network layer. Background Art

[0002] Virtual Private Network (VPN) is a technology that establishes a dedicated channel on a public network for end-to-end communication. In the current network environment, especially in corporate networks, VPN provides users with a convenient remote access channel.

[0003] In order to enhance the ability to analyze VPN transmission content and thus increase the ability to supervise VPN, further research is needed on VPN password recovery methods. There are many types of VPNs on the current network. The mixed use of L2TP and IPSec forms the network layer protocol of VPN, also known as L2TP / IPSec VPN. L2TP / IPSec VPN is generally considered to be a VPN with good performance and wide application. L2TP / IPSec VPN uses the IPSec security system based on the construction of an end-to-end L2TP security link. The IPSec security system includes three basic sub-protocols: AH protocol, ESP protocol and IKE protocol. The AH protocol provides information source verification and integrity assurance for IP packets, the ESP protocol provides an encryption mechanism, and IKE provides shared security information and key encryption protocols for communication between the two parties. The VPN network layer password exists in the ESP and IKE mechanisms respectively, and the VPN data authentication, integrity verification and content transmission are realized based on the password.

[0004] L2TP / IPSec has two negotiation modes: active mode and main mode. Both modes go through three processes: identity authentication, data authentication, and secure transmission when building an end-to-end secure link. The password generation mechanism is different in different modes. When L2TP / IPSec communicates, it must first authenticate both parties twice, namely device identity authentication and user login authentication. The device identity authentication password uses a pre-shared key (PSK), and the user login authentication password uses a login key (Password) based on the MS-CHAP protocol. If one of the two authentications fails, the link is disconnected. If the authentication passes, both parties will synchronously generate a random transmission key.

[0005] Among the results currently published by researchers at home and abroad, the password recovery technology of L2TP / IPSec VPN is mainly based on vulnerabilities and exhaustive methods.

[0006] Vulnerability-based password recovery mainly targets weaker encryption algorithms (such as RC4) and obtains passwords when a Trojan is implanted in the client. Vulnerability-based methods are short-lived and have a limited impact. Once the vulnerability is announced, the target reinstalls the browser, the site is upgraded, or the security protocol stack disables weak cipher suites, this password recovery method will lose its effect.

[0007] The exhaustive method has been supported by relevant software, such as IKE-scan, IKEprobe, IKEcrack-snarf, etc. IKE-scan intercepts the exchange information between the client and the server, and then combines the exhaustive method to obtain the PSK; IKEprobe automatically traverses various methods to try to force the responder to perform IKE transformation, and then combines the exhaustive method to obtain the PSK; IKEcrack-snarf is also a tool for obtaining PSK, and the idea is similar to the IKE-scan mentioned above. The exhaustive method can only recover the PSK in the active mode of L2TP / IPSec, but cannot recover the PSK in the main mode, and cannot recover the password. Summary of the invention

[0008] The embodiments of the present application provide a VPN network layer password recovery method, system and storage medium, which are used to simultaneously recover PSK and Password in active mode and main mode to reduce the amount of calculation.

[0009] The present application provides a VPN network layer password recovery method, comprising:

[0010] In the active mode of L2TP / IPSecVPN, the target parameters are obtained based on the intercepted data packets, and the pre-shared key PSK negotiation is completed;

[0011] In the main mode of L2TP / IPSec VPN, first obtain the key K generated by the Diffie-Hellman encryption algorithm, and then traverse the pre-shared key PSK based on the key K;

[0012] Based on the obtained PSK, the L2TP / IPSec login password Password is obtained through MD5 iterative traversal.

[0013] Optionally, in L2TP / IPSecVPN's aggressive mode, it also includes:

[0014] Based on the negotiated pre-shared key PSK, the L2TP / IPSec login password Password is obtained through an iterative MD5 algorithm.

[0015] Optionally, in L2TP / IPSec VPN main mode, it also includes:

[0016] After the user dials in, the pre-shared key authentication is performed first, and the one-time authentication data of the pre-shared key is redirected to the intermediate server through data flow redirection;

[0017] At the intermediate server, determining the intermediate key SKEYIDd value according to the known Diffie-Hellman private key;

[0018] The key K is calculated using the determined intermediate key SKEYIDd value.

[0019] Optionally, in L2TP / IPSec VPN main mode, it also includes:

[0020] Perform two authentications on the user's dial-up behavior, using MS-CHAP authentication;

[0021] The NTHash in the MS-CHAP authentication is the MD4 value of the login password, which is also used as the key for DES calculation, so that the login key Password can be traversed through secondary iterations.

[0022] Optionally, in L2TP / IPSec VPN main mode, it also includes:

[0023] When ChallengeResponse is calculated based on MS-CHAP, multiple DES calculations are used, and the keys KEY calculated each time are concatenated to form the NTHash, wherein the last byte of the previous key and the first byte of the next key are repeated, and the last four bits of the last KEY are filled with the specified value;

[0024] The masked password guessing algorithm is used to recover the login key Password one by one.

[0025] The embodiment of the present application also provides a VPN network layer password recovery system, including:

[0026] Traffic interception and forwarding module, used to intercept user L2TP / IPSec traffic and forward the traffic to the intermediate service management end;

[0027] The intermediate service management terminal is used to capture data packets in the traffic;

[0028] The intermediate service agent is used to obtain target parameters based on intercepted data packets and complete the negotiation of the pre-shared key PSK in the active mode of L2TP / IPSecVPN;

[0029] In the main mode of L2TP / IPSec VPN, first obtain the key K generated by the Diffie-Hellman encryption algorithm, and then traverse the pre-shared key PSK based on the key K;

[0030] Based on the obtained PSK, the L2TP / IPSec login password Password is obtained through MD5 iterative traversal.

[0031] The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the VPN network layer password recovery method as described above are implemented.

[0032] The embodiments of the present application respectively propose a password (PSK+Password) recovery method in the active mode and a password (PSK+Password) recovery method in the main mode for the active mode and the main mode of L2TP / IPSecVPN, thereby realizing the simultaneous recovery of PSK and Password in the active mode and the main mode, and reducing the amount of calculation.

[0033] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0035] Figure 1 The basic process diagram of the VPN network layer password recovery method according to the embodiment of the present application is shown;

[0036] Figure 2 This is a schematic diagram of the pre-shared key PSK generation process of the L2TP / IPSec VPN active mode of the VPN network layer password recovery method of the embodiment of the present application;

[0037] Figure 3 This is a schematic diagram of the iterative recovery process of the pre-shared key PSK of the L2TP / IPSec VPN main mode of the VPN network layer password recovery method of the embodiment of the present application;

[0038] Figure 4 This is a schematic diagram of the iterative recovery process of the login key password of the L2TP / IPSec VPN main mode of the VPN network layer password recovery method of the embodiment of the present application;

[0039] Figure 5This is a schematic diagram of the NTHash structure of the VPN network layer password recovery method of the embodiment of the present application;

[0040] Figure 6 The complete design process of restoring the system in L2TP / IPsec main mode for the embodiment of the present application;

[0041] Figure 7 This is a schematic diagram of the network topology of the L2TP / IPSec channel password rapid recovery system in an embodiment of the present application;

[0042] Figure 8 This is a schematic diagram of the L2TP / IPSec channel password rapid recovery system structure of an embodiment of the present application. DETAILED DESCRIPTION

[0043] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0044] The embodiment of the present application innovatively proposes to recover the pre-shared key and login key in both L2TP / IPSec modes. The technical difficulty of the method of the present application lies in how to recover two passwords at the same time and how to optimize the password recovery algorithm to quickly obtain in limited space and time.

[0045] Specifically, this application proposes an L2TP / IPSec password iterative recovery method based on protocol analysis. This method combines Diffie-Hellman private key replacement to perform password iterative recovery. Unlike other methods that have been disclosed, this application is for password (PSK+Password) recovery in two negotiation modes of L2TP / IPSec, and has long-term validity. Specifically, Figure 1 As shown, the embodiment of the present application provides a VPN network layer password recovery method, including:

[0046] In step S101, in the active mode of L2TP / IPSecVPN, target parameters are obtained based on intercepted data packets, and negotiation of the pre-shared key PSK is completed. In some embodiments, the active mode of L2TP / IPSecVPN also includes: based on the negotiated pre-shared key PSK, an MD5 iteration is performed to obtain the L2TP / IPSec login password Password. Figure 2As shown in the figure, in the active mode of L2TP / IPSec, the negotiation of the pre-shared key PSK is completed based on parameters such as Ni, Nr, X, Y, Ci, Cr, SAi, and IDr:

[0047] HASHr=hash(hash (PSK,Ni|Nr),X|Y|Ci|Cr|SAi|IDr) (1)

[0048] In step S102, in the main mode of L2TP / IPSec VPN, the key K generated by the Diffie-Hellman encryption algorithm is first obtained, and the pre-shared key PSK is traversed based on the key K. Steps S101 and S102 of the present application do not refer to the order, and correspond to two different L2TP / IPSecVPN modes, namely the active mode and the main mode, which correspond to the corresponding processing methods respectively.

[0049] In step S103, based on the obtained PSK, MD5 is iterated to obtain the L2TP / IPSec login password Password. For example, for the active mode of L2TP / IPSecVPN, since parameters such as Ni, Nr, X, Y, Ci, Cr, SAi, IDr, HASHr, etc. are plain text that can be obtained by intercepting data packets, hash uses MD5 or SHA1, and the length of PSK is between 40 bits and 120 bits, a password recovery method for PSK is designed:

[0050] If PSK is 40 bits, the value range of PSK is [0-2 40 ], PSK values ​​are substituted into the calculation formula (1) in turn. When formula (1) is established, it means that the PSK traversal is successful. In specific applications, the current workstation computing speed takes 50 hours to traverse the PSK value range. Based on the calculated PSK, the login key Password of L2TP / IPSec is recovered.

[0051] In the specific example, in PC systems such as win7 or win10, the login key uses MD5 encryption authentication, and NTHash is transmitted in plain text. After calculating the PSK, the PC-side L2TP / IPSec login password Password can be obtained through a single MD5 iteration:

[0052] NTHash=MD5(Password||PSK) (2)

[0053] For the main mode of L2TP / IPSec VPN, the main mode of L2TP / IPSec VPN completes the Diffie-Hellman key exchange based on the pre-shared key PSK, cookie, random value (N) and security policy SAr value, generates the Diffie-Hellman public key K, and generates the intermediate encryption keys SKEYIDa and SKEYIDe. The intermediate keys SKEYIDa and SKEYIDe are used for encrypted transmission. The algorithm is as follows:

[0054] SKEYID=SHA1(Ni|Nr|PSK) (3)

[0055] SKEYIDd=SHA1 (SKEYID,K|Ci|Cr|0) (4)

[0056] SKEYIDa=SHA1 (SKEYID,SKEYIDd |K|Ci|Cr|1) (5)

[0057] SKEYIDe=SHA1 (SKEYID, SKEYIDa|K|Ci|Cr|2) (6)

[0058] Analysis of the main mode security mechanism: Cookie, random value (N) and security policy SAr value are plain text transmission and can be directly obtained. Since the pre-shared key PSK is unknown, the key K generated by the Diffie-Hellman encryption algorithm is first obtained in the specific example, which corresponds to step S102. After obtaining the Diffie-Hellman encryption key K, the pre-shared key PSK is calculated by traversal. That is, the acquisition of the pre-shared key PSK is transformed into the acquisition of the Diffie-Hellman encryption key K.

[0059] The method of the embodiment of the present application combines high-performance computing technology to design a corresponding system based on the password recovery algorithm, iteratively recovers the pre-shared key and login key of the L2TP / IPSec mode, and can use dictionaries, rainbow tables, workflows and other modes in specific applications to greatly improve the speed of password acquisition. This application only proposes a password recovery method for the VPN network layer, and cannot recover passwords for other VPN layers or decrypt information.

[0060] The embodiments of the present application respectively propose a password (PSK+Password) recovery method in the active mode and a password (PSK+Password) recovery method in the main mode for the active mode and the main mode of L2TP / IPSecVPN, thereby realizing the simultaneous recovery of PSK and Password in the active mode and the main mode, and reducing the amount of calculation.

[0061] The Diffie-Hellman algorithm is theoretically relatively secure as long as the algorithm parameters are selected correctly (e.g., the size of the finite field meets the security strength requirements, and the size of the group meets the requirements). However, in actual engineering implementation, the encryption key K of Diffie-Hellman can be obtained through an intermediate server, that is, by setting up an intermediate server, the encryption key K of Diffie-Hellman can be obtained by replacing the private key of the intermediate server under the premise of knowing the private key of the intermediate server. The method of the present application, independently or additionally, such as Figure 3 As shown, in L2TP / IPSec VPN main mode, it also includes:

[0062] After the user dials up, the pre-shared key authentication is performed first, and the one-time authentication data of the pre-shared key is redirected to the intermediate server through data flow redirection.

[0063] At the intermediate server, the intermediate key SKEYIDd value is determined based on the known Diffie-Hellman private key.

[0064] The encryption key K is calculated using the determined intermediate key SKEYIDd value.

[0065] In the specific example, the server obtains the SKEYIDd value when the Diffie-Hellman private key is known, calculates the encryption key K through the private key, and then performs two SHA1 iterations to traverse the pre-shared key PSK. This recovery method is not limited by the algorithm and mode.

[0066] Independently or additionally, the L2TP / IPSec VPN main mode also includes:

[0067] Perform two authentications on the user's dial-up behavior, using MS-CHAP encrypted authentication;

[0068] The NTHash in the MS-CHAP authentication is the MD4 value of the login password, which is also used as the key for DES calculation, so that the login key Password can be traversed through secondary iterations.

[0069] In the specific example, the user dials in for two authentications, using MS-CHAP encryption authentication. The algorithm is as follows:

[0070] ChallengeHash=SHA1(ClientChallenge||ServerChallenge||Username) (7)

[0071] NTHash=MD4(Password) (8)

[0072] ChallengeResponse=

[0073] DES(NTHash(0:7))(ChallengeHash)||DES(NTHash(7:14)(ChallengeHash)||DES(NTHash(14:21))(ChallengeHash)(9)

[0074] The authentication process of MS-CHAP is relatively simple. NTHash is the MD4 value of the login password and is also the key calculated by DES. ChallengeResponse and ServerChallenge are the input and output of DES and are transmitted in plain text. Therefore, when obtaining plain text parameters, the login key Password can be traversed through secondary iteration (i.e. DES (MD4 (Password)) iteration), such as Figure 4 As shown, it is obvious that the method of the present application is a practical method for obtaining the pre-shared key, and the recovery method of the present application is not limited by the algorithm and mode.

[0075] Independently or additionally, the L2TP / IPSec VPN main mode also includes:

[0076] When ChallengeResponse is calculated based on MS-CHAP, multiple DES calculations are used, and the keys KEY calculated each time are concatenated to form the NTHash, wherein the last byte of the previous key and the first byte of the next key are repeated, and the last four bits of the last KEY are filled with the specified value;

[0077] The masked password guessing algorithm is used to recover the login key Password one by one.

[0078] In a specific example, when ChallengeResponse is calculated based on MS-CHAP, three DES calculations are used as an example. In each calculation, although the DES key is different, there is a repetition between the last byte of the previous key and the first byte of the next key, and the last four bits of the last DES key are filled with 0.

[0079] If the login key of the L2TP / IPSec user is short, the login key can be directly obtained based on the DES (MD4 (Password)) algorithm. If the login password of the L2TP / IPSec user is long, first restore the MD4 output value NTHash of the login key. For the recovery of NTHash, an optimized recovery algorithm can also be designed to improve the recovery speed:

[0080] like Figure 5As shown in the figure: KEY1, KEY2, and KEY3 are the encryption keys of three DES respectively, which are connected in series to form NTHash. The last four bits of KEY3 are filled with 0, and KEY3 can be quickly obtained through the masked password guessing algorithm. The first bit of KEY3 is the same as the last bit of KEY2, and the first bit of KEY2 is the same as the last bit of KEY1. Therefore, when recovering the first two keys of DES, the key length is actually only 56 bits, and the recovery algorithm of KEY2 and KEY1 can be combined into one process during implementation, that is, further optimized into:

[0081] KeyOne = null;

[0082] KeyTwo = null;

[0083] For(int i=0;i<2^56;i++)

[0084] {

[0085] if(DESKEY[i](plaintext)==ciphertext1)

[0086] keyOne = key[i];

[0087] if(DESKEY[i](plaintext)==ciphertext2)

[0088] keyTwo = key[i];

[0089] }

[0090] After verification by the computing platform: the optimization method of this application can reduce the DES key recovery time by half, that is, the conventional time to obtain NTHash is shortened by half. After obtaining NTHash, the login password of the main mode can be obtained by traversing MD4 in the whole space. As we all know, MD4 is a weak encryption algorithm, and its password can be traversed and obtained in a very short time. The embodiment of this application provides an optimized L2TP / IPSec main mode login password fast recovery algorithm.

[0091] The embodiment of the present application proposes an iterative recovery method for pre-shared keys and login passwords in L2TP / IPSec main mode. The embodiment of the present application analyzes the security mechanism of the protocol in L2TP / IPSec main mode and proposes a method for iterative recovery of pre-shared keys and login passwords in L2TP / IPSec main mode.

[0092] The L2TP / IPSec channel password rapid recovery system designed in the embodiment of the present application is innovative. It performs key replacement based on Diffie-Hellman and combines password traversal to complete the recovery of pre-shared keys and login passwords. During the password recovery process, users can access the Internet normally. It is a non-perceptible password recovery method that does not affect users.

[0093] The embodiment of the present application also provides a VPN network layer password recovery system, including:

[0094] Traffic interception and forwarding module, used to intercept user L2TP / IPSec traffic and forward the traffic to the intermediate service management end;

[0095] The intermediate service management terminal is used to capture data packets in the traffic;

[0096] The intermediate service agent is used to obtain target parameters based on intercepted data packets and complete the negotiation of the pre-shared key PSK in the active mode of L2TP / IPSecVPN;

[0097] In the main mode of L2TP / IPSec VPN, first obtain the key K generated by the Diffie-Hellman encryption algorithm, and then traverse the pre-shared key PSK based on the key K;

[0098] Based on the obtained PSK, the L2TP / IPSec login password Password is obtained through MD5 iterative traversal.

[0099] Specifically, based on the aforementioned method embodiment, the embodiment of the present application proposes a VPN network layer password recovery system. The embodiment of the present application proposes a L2TP / IPSec channel password fast recovery system based on the integrity design process in the L2TP / IPSec main mode. The recovery system is for the L2TP / IPSec main mode. The process combines the recovery of device identity authentication and user login authentication passwords. The process can cope with the password recovery in the L2TP / IPSec main mode under common circumstances. The recovery process is as follows: Figure 6 shown.

[0100] In the specific example, the system network topology diagram is shown in Figure 7After the user dials up to the Internet, the router detects the user's L2TP / IPSec Internet traffic. The restorer modifies the router's policy and forwards the characteristic traffic of the handshake protocol to the intermediate server management end (other traffic is not forwarded). The intermediate server management end uses full-space traversal, dictionary traversal, rainbow table, workflow, etc. to iteratively recover and obtain the L2TP / IPSec pre-shared key. This recovery process is independent of the user's dial-up and does not affect the user's normal Internet behavior. After the pre-shared key is recovered, the pre-shared key is built into the intermediate server. After the router detects the user's L2TP / IPSec Internet traffic again, the restorer modifies the router's policy again to forward the new handshake protocol characteristic traffic to the intermediate server management end (other traffic is not forwarded). The intermediate server management end uses full-space traversal, dictionary traversal, rainbow table, workflow, etc. to iteratively recover and obtain L2TP / IPSec user name, login password and other parameters.

[0101] The module design of the system is as follows Figure 8 In some specific embodiments, the recovery system is composed of three parts, which are respectively composed of a traffic interception and forwarding module, an intermediate service (management end), and a camouflage service (agent end). The intermediate service (management end) includes a packet capture module, a recovery module, an IPSEC management module, and an IPSEC+L2TP+PPTP service module. The intermediate service (agent end) includes an IPSEC proxy module and an IPSEC+L2TP+PPTP service module.

[0102] The functions implemented by the traffic interception and forwarding module include:

[0103] Intercept user L2TP / IPSec traffic and forward it to the intermediate service (management end).

[0104] When L2TP / IPSec is not restored successfully, users can access the real server and surf the Internet normally.

[0105] After L2TP / IPSec is successfully restored, the traffic is connected to the intermediate service management end.

[0106] Direct L2TP / IPSec protocol traffic to the redirection software for reception, and then select the data packets based on the protocol characteristics. The L2TP / IPSec characteristics based on the following two points include:

[0107] L2TP / IPSec protocol data packets are transmitted via UDP protocol;

[0108] The L2TP / IPSec protocol data packet dial-up and business data communication are exchanged through UDP port 500 and port 4500 respectively;

[0109] The filtering and directing of L2TP / IPSec packets requires the use of routing rules and firewall rule settings.

[0110] Filter and label the packets.

[0111] 2) The functions implemented by the packet capture module of the intermediate service (management end) include:

[0112] Capture PPP port data packets and send the restored data packets to the data storage system.

[0113] Data can be captured dynamically based on the number of users accessing the PPP port.

[0114] You can specify the mirror port MAC address to send packets.

[0115] The functions here can be realized through the TCP-DUMP and TCP-REPLAY software packages.

[0116] 3) The functions implemented by the recovery module of the intermediate service (management end) include:

[0117] Recover the L2TP / IPSec pre-shared key.

[0118] Recover the CHAP authentication user name and login password.

[0119] After successful recovery, the L2TP / IPSec pre-shared key, CHAP authentication user name and login password are sent to the L2TP / IPSec management module.

[0120] Password recovery status management and maintenance for L2TP / IPSec users

[0121] The method of recovering the L2TP / IPSec pre-shared key and CHAP authentication username and login password has been described in parts 1, 2, and 3. Here, the main method of L2TP / IPSec user status management is proposed. The recovery status management is responsible for receiving the recovery status information sent by the L2TP / IPSec recovery management software, saving the recovery information to the database, and dynamically adjusting the firewall policy according to the recovery status.

[0122] The recovery status information management and maintenance are saved using the SQLite database.

[0123] 4) The functions implemented by the L2TP / IPSec management module of the intermediate service (management end) include:

[0124] Receive the user's outer IP, L2TP / IPSec server IP, L2TP / IPSec pre-shared key, CHAP authentication user name and login password sent by the recovery module.

[0125] Use the user's outer IP, L2TP / IPSec pre-shared key, CHAP authentication user name and login password, and restart the IPSEC+L2TP+PPP service.

[0126] Extract the correspondence between the user's outer IP and the user's inner IP from the IPSEC+L2TP+PPP service.

[0127] Select an idle intermediate service (agent) and send the L2TP / IPSec server IP, L2TP / IPSec pre-shared key, CHAP authentication user name and login password to the agent.

[0128] According to the correspondence between the user's outer IP and inner IP, the user traffic is forwarded to the corresponding intermediate service (proxy end).

[0129] Receive the user L2TP / IPSec disconnection information sent by the recovery module, and reset the corresponding recovery service (agent) to an idle state.

[0130] The netkey protocol stack that comes with the Linux system and the klips protocol stack that comes with libreswan cannot support multiple users accessing the IPSec masquerade server with the same source IP. Therefore, the implementation of the L2TP / IPSec management module of the intermediate service (management end) is mainly achieved by modifying the Libreswan source code and the PPP source code: the solution is to apply the IPSecsaref patch to the kernel and then use it with the klips protocol stack; the principle of modifying the Libreswan source code is to adjust the place where PSK is loaded according to IP to load PSK according to port, and write the port and corresponding PSK in the IPSEC-PSK configuration file; the principle of modifying the PPP source code is to send the inner IP, username, and password message to the IPSEC intermediate management end when CHAP authentication is successful, and send the inner IP message when the pppd process exits.

[0131] 5) The functions implemented by the L2TP / IPSec proxy module of the intermediate service (proxy end) include:

[0132] Receive the L2TP / IPSec connection command sent by the management end. The parameters include the L2TP / IPSec server IP, L2TP / IPSec pre-shared key, CHAP authentication user name and login password.

[0133] Use the received L2TP / IPSec dial-up parameters to connect to the real L2TP / IPSec address.

[0134] Receive user Internet traffic and allow the user's Internet traffic to access the Internet through L2TP / IPSec proxy.

[0135] Receive the L2TP / IPSec disconnect command sent by the management end and disconnect from the L2TP / IPSec server.

[0136] Here, multiple TCP long links are started, each with a different ID. The management end will send a proxy dial-up request based on the idle ID and forward the traffic to the proxy end.

[0137] The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the VPN network layer password recovery method as described above are implemented.

[0138] It should be noted that in the various embodiments of the present application, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0139] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0140] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0141] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A VPN network layer password recovery method, characterized in that: include: In the active mode of L2TP / IPSecVPN, the target parameters are obtained based on the intercepted data packets, and the pre-shared key PSK negotiation is completed; In the main mode of L2TP / IPSec VPN, first obtain the key K generated by the Diffie-Hellman encryption algorithm, and then traverse the pre-shared key PSK based on the key K; Based on the obtained PSK, the L2TP / IPSec login password Password is obtained through MD5 iterative traversal.

2. The VPN network layer password recovery method according to claim 1, characterized in that: The aggressive mode of L2TP / IPSecVPN also includes: Based on the negotiated pre-shared key PSK, the L2TP / IPSec login password Password is obtained through an iterative MD5 algorithm.

3. The VPN network layer password recovery method according to claim 1, characterized in that: In L2TP / IPSec VPN main mode, it also includes: After the user dials in, the pre-shared key authentication is performed first, and the one-time authentication data of the pre-shared key is redirected to the intermediate server through data flow redirection; At the intermediate server, determining the intermediate key SKEYIDd value according to the known Diffie-Hellman private key; The key K is calculated using the determined intermediate key SKEYIDd value.

4. The VPN network layer password recovery method according to claim 3, characterized in that: In L2TP / IPSec VPN main mode, it also includes: Perform two authentications on the user's dial-up behavior, using MS-CHAP authentication; The NTHash in the MS-CHAP authentication is the MD4 value of the login password, which is also used as the key for DES calculation, so that the login key Password can be traversed through secondary iterations.

5. The VPN network layer password recovery method according to claim 4, characterized in that: In L2TP / IPSec VPN main mode, it also includes: When ChallengeResponse is calculated based on MS-CHAP, multiple DES calculations are used, and the keys KEY calculated each time are concatenated to form the NTHash, wherein the last byte of the previous key and the first byte of the next key are repeated, and the last four bits of the last KEY are filled with the specified value; The masked password guessing algorithm is used to recover the login key Password one by one.

6. A VPN network layer password recovery system, characterized in that: include: Traffic interception and forwarding module, used to intercept user L2TP / IPSec traffic and forward the traffic to the intermediate service management end; The intermediate service management terminal is used to capture data packets in the traffic; The intermediate service agent is used to obtain target parameters based on intercepted data packets and complete the negotiation of the pre-shared key PSK in the active mode of L2TP / IPSecVPN; In the main mode of L2TP / IPSec VPN, first obtain the key K generated by the Diffie-Hellman algorithm, and then traverse the pre-shared key PSK based on the key K; Based on the obtained PSK, the L2TP / IPSec login password Password is obtained through MD5 iterative traversal.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the VPN network layer password recovery method according to any one of claims 1 to 5 are implemented.