Login verification method and device, electronic equipment and computer readable storage medium
By returning a login failure prompt after the initial login password is successfully verified and collecting N consecutive login information, a deception mechanism is designed to solve the problem of being unable to effectively prevent brute force cracking in the existing technology and improve data security.
Patent Information
- Application Number
- CN202411080456.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-10-15
Smart Images

Figure CN118784247A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of communication technology and information security technology, and more specifically, to a login verification method, device, electronic device, and computer-readable storage medium. Background Art
[0002] Brute force is a very direct and relatively simple method of password cracking. It tries all possible character combinations to find the correct password or key. This method usually involves automated software that generates and tries various password combinations according to preset rules (such as full permutations of letters, numbers, special characters) until a matching password is found. Brute force can be applied to a variety of scenarios, including but not limited to: Account password cracking: The attacker tries to guess the user's login password, which may be access to online services, operating system accounts, databases, etc. Encrypted data cracking: When trying to decrypt encrypted information, the correct decryption key is found by enumerating possible keys.
[0003] In the prior art, when encountering brute force cracking, once the attacker enters the correct password, the password will be cracked successfully, resulting in the risk of data leakage.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The present application provides a login verification method, device, electronic device and computer-readable storage medium to at least solve the technical problem of low data security caused by the inability to effectively detect and prevent brute force attacks in the prior art.
[0006] According to one aspect of the present application, a login verification method is provided, comprising: obtaining initial login information sent by a terminal device when requesting access to a target system, wherein the initial login information includes at least an initial login password; upon detecting that the initial login password in the initial login information is successfully verified, returning a prompt message indicating a login failure to the terminal device, wherein the prompt message is also used to prompt the terminal device to resend the login information; collecting target login information sent N times consecutively by the terminal device after receiving the prompt message, wherein N is an integer greater than or equal to 1; and determining whether to allow the terminal device to access the target system based on the verification results of the target login password in the target login information N times.
[0007] Optionally, in the login verification method provided in the present application, whether to allow the terminal device to access the target system is determined based on the verification results of the target login password in the target login information N times, including: when it is detected that all the target login passwords in the target login information N times are verified successfully, allowing the terminal device to access the target system; when it is detected that the verification of the target login password in the target login information sent the i-th time out of N times fails, prohibiting the terminal device from accessing the target system, and using the login information sent by the terminal device the i+1th time as the new initial login information.
[0008] Optionally, in the login verification method provided in the present application, the initial login information also includes at least an initial network address used by the terminal device when sending the initial login information, and determines whether to allow the terminal device to access the target system based on the verification result of the target login password in the target login information, including: detecting whether the target network address used by the terminal device each time it sends the target login information is the same as the initial network address, and obtaining a detection result; determining whether to allow the terminal device to access the target system based on the detection result and the verification result of the target login password in the target login information.
[0009] Optionally, in the login verification method provided in the present application, whether to allow the terminal device to access the target system is determined based on the detection result and the verification result of the target login password in the target login information, including: when the target network address is the same as the initial network address and the target login passwords in the target login information sent N times in succession are all verified successfully, allowing the terminal device to access the target system; when the target network address is different from the initial network address and / or the verification of the target login password in the target login information sent any one of N consecutive times fails, prohibiting the terminal device from accessing the target system.
[0010] Optionally, the login verification method also includes: when the initial login password verification is successful, detecting whether the initial login password is a weak password, wherein the weak password is a password with a character length less than a preset length or a password with a number of character types less than a preset threshold; when the initial login password is the weak password, returning a prompt message of login failure to the terminal device, and collecting target login information sent N times consecutively by the terminal device after receiving the prompt message; when the initial login password is not a weak password, allowing the terminal device to access the target system.
[0011] Optionally, in the login verification method provided by the present application, after determining whether the terminal device is allowed to access the target system based on the verification result of the target login password in the target login information, the login verification method also includes: detecting whether the number of times the terminal device is continuously prohibited from accessing the target system is greater than a first preset number; detecting whether the number of times the terminal device is prohibited from accessing the target system within a preset time period is greater than a second preset number; upon detecting that the number of times the terminal device is continuously prohibited from accessing the target system is greater than the first preset number, and / or the number of times the terminal device is prohibited from accessing the target system within the preset time period is greater than the second preset number, determining that the terminal device is an abnormal device that performs brute force cracking on the target system.
[0012] Optionally, in the login verification method provided in the present application, when it is detected that the number of times the terminal device is continuously prohibited from accessing the target system is less than or equal to the first preset number of times, and the number of times the terminal device is prohibited from accessing the target system within a preset time period is less than or equal to a second preset number of times, it is determined that the terminal device is not an abnormal device that performs brute force cracking on the target system.
[0013] Optionally, the login verification method also includes: detecting whether a preset login password stored in the target system by a user of the target system is a weak password; in the case where it is detected that the preset login password is the weak password, generating target information, wherein the target information is used to prompt the user to modify the weak password to a non-weak password, or to prompt the user to enable an N+1 password verification mechanism, wherein the N+1 password verification mechanism indicates that a prerequisite for the user to successfully access the target system is to enter the correct weak password N+1 times in a row.
[0014] According to another aspect of the present application, a login verification device is also provided, wherein the login verification device includes: an acquisition unit, used to acquire initial login information sent by a terminal device when requesting access to a target system, wherein the initial login information includes at least an initial login password; a processing unit, used to return a prompt message of login failure to the terminal device when detecting that the initial login password in the initial login information is successfully verified, wherein the prompt message is also used to prompt the terminal device to resend the login information; a collection unit, used to collect the target login information sent N times consecutively by the terminal device after receiving the prompt message, wherein N is an integer greater than or equal to 1; a determination unit, used to determine whether the terminal device is allowed to access the target system based on the verification results of the target login password in the target login information N times.
[0015] According to another aspect of the present application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, wherein when the computer program is set to run, the computer device where the computer program is located executes any one of the login verification methods described above.
[0016] According to another aspect of the present application, an electronic device is also provided, wherein the electronic device includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute any one of the login verification methods described above.
[0017] In the present application, after the initial login password is successfully verified, the login information still needs to be collected again. First, the initial login information sent by the terminal device when requesting to access the target system is obtained, wherein the initial login information at least includes the initial login password. When it is detected that the initial login password in the initial login information is successfully verified, a prompt message of login failure is returned to the terminal device, wherein the prompt message is also used to prompt the terminal device to resend the login information. Then, the target login information sent by the terminal device N times in succession after receiving the prompt message is collected, wherein N is an integer greater than or equal to 1. Finally, according to the verification results of the target login password in the target login information N times, it is determined whether the terminal device is allowed to access the target system.
[0018] As can be seen from the above content, the present application proposes a login verification method for the above problems in the prior art. When the initial login password verification is successful, the terminal device is not directly allowed to access the target system, but a prompt message of login failure is returned to the terminal device, and the terminal device is prompted to resend the login information. In this way, it is equivalent to designing a deception mechanism for the terminal device. If the terminal device is a device that is performing brute force cracking, after receiving the prompt message, it will mistakenly think that the initial login password is a "wrong password", and thus use other passwords for cracking instead, which will cause the terminal device to fail to pass the verification after receiving the "real" wrong login passwords subsequently sent by the terminal device, and the terminal device cannot successfully access the target system, thereby achieving effective prevention of brute force cracking by the terminal device. Of course, if the terminal device is not a device that is performing brute force cracking, it will continue to enter the correct initial login password, and the terminal device can be allowed to access the target system at this time.
[0019] It can be seen that through the technical solution of the present application, the purpose of effectively detecting and preventing brute force cracking attacks that may be sent by terminal devices is achieved, thereby improving the data security during data communication between the target system and the terminal device, and further solving the technical problem of low data security caused by the inability to effectively detect and prevent brute force cracking attacks in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0021] Figure 1 is a flowchart of an optional login verification method according to an embodiment of the present application;
[0022] Figure 2 is a schematic diagram of an anti-brute force cracking system according to an embodiment of the present application;
[0023] Figure 3 It is a schematic diagram of an optional login verification device according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] It should also be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) collected by this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with the relevant laws, regulations and standards of the relevant regions, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation portals are provided for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.
[0027] According to an embodiment of the present application, an embodiment of a login verification method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] Figure 1 is a flowchart of an optional login verification method according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0029] Step S101, obtaining initial login information sent by a terminal device when requesting to access a target system.
[0030] In step S101, the initial login information at least includes an initial login password.
[0031] In an optional embodiment, an anti-brute force cracking system can be used as the execution subject of the login verification method in the embodiment of the present application, wherein the anti-brute force cracking system can be a software system or an embedded system combining software and hardware. In addition, the anti-brute force cracking system can also appear in the form of objects such as devices, plug-ins, components, and modules. For example, the anti-brute force cracking system can be a plug-in embedded in the target system to protect the target system from brute force cracking attacks.
[0032] In some examples, the target system may include, but is not limited to: an operating system, a database system, or a business system with an access control mechanism.
[0033] In an optional embodiment, Figure 2 is a schematic diagram of an anti-brute force cracking system according to an embodiment of the present application, such as Figure 2As shown, the anti-brute force cracking system includes two modules, one is a login process interception module, and the other is a brute force cracking protection module.
[0034] Optionally, the login process interception module is mainly used to intercept the login request process of the terminal device and collect login information sent by the terminal device when requesting to access the target system.
[0035] Optionally, the terminal device can be any device with network communication function, such as a smart phone, a laptop, a desktop computer, a smart tablet, a server, etc. The target system includes but is not limited to various software systems or embedded systems that require login authentication, such as databases, operating systems, online services, etc.
[0036] Optionally, the login process interception module can intercept the initial login information sent by the terminal device when requesting access to the target system, wherein the initial login information includes at least an initial login password, and the initial login information may also include: login IP, login user, login credentials, login status (success / failure) and other information.
[0037] Optionally, different login process interception modules can be designed for different target systems. For example, taking the Linux operating system as an example, the PAM (Pluggable Authentication Modules) authentication process can be modified. The modification method can be to recompile the existing pam_unix.so or to add a new PAM module and add it to the PAM authentication configuration.
[0038] Among them, when the modification method is to recompile the existing pam_unix.so, you can modify the existing pam_unix.so source code, add relevant detection logic, and then rewrite and compile it into pam_unix.so, overwriting the original pam_unix.so file. The reference code is as follows:
[0039] #Verify that the password is correct;
[0040] retval=_unix_verify_password(pamh,username,pass,ctrl);
[0041] #If the password authentication is successful, collect the login IP, login username, and login password pass and give them to the brute force cracking protection module;
[0042] if(retval==PAM_SUCCESS&&checkWeekPassFistLogin(ip,username,pass)){
[0043] return PAM_SYSTEM_ERR;
[0044] }
[0045] Optionally, when the modification method is to add a new PAM module to the PAM authentication configuration, you can add a new PAM module and compile it into pam_check_weekpass_auth.so. The core code logic is the same as the reference code above. Then edit the / etc / pam.d / sshd file and add a line at the appropriate position (such as the beginning or end of the authentication phase), referring to the configuration file such as: auth required pam_check_weekpass_auth.so.
[0046] Step S102, when it is detected that the initial login password in the initial login information is successfully verified, a prompt message indicating a login failure is returned to the terminal device.
[0047] In step S102, the prompt information is also used to prompt the terminal device to resend the login information.
[0048] Optionally, if the anti-brute force cracking system detects that the initial login password verification is successful, the anti-brute force cracking system does not directly allow the terminal device to access the target system, but returns a prompt message of login failure to the terminal device and prompts the terminal device to resend the login information.
[0049] It can be seen that according to the scheme of the present application, it is equivalent to designing a mechanism for deliberately deceiving terminal devices. If the terminal device is a device that is performing brute force cracking, then after receiving the prompt information, the terminal device will mistakenly believe that the initial login password is a "wrong password", and will use other passwords different from the initial login password for cracking, which will result in the terminal device still denying access to the other passwords after receiving them because the other passwords are truly wrong passwords.
[0050] However, in order to ensure that the terminal device that does not perform brute force cracking can access the target system normally, the present application also designs steps S103 and S104.
[0051] Step S103, collecting target login information sent N times in succession by the terminal device after receiving the prompt information.
[0052] In step S103, N is an integer greater than or equal to 1.
[0053] Step S104, determining whether to allow the terminal device to access the target system based on the verification results of the target login password in the target login information N times.
[0054] Optionally, after the initial login verification is successful, the anti-brute force cracking system does not directly allow the terminal device to access the target system, but returns a prompt message indicating that the login failed to the terminal device, and prompts the terminal device to resend the login information. If the terminal device is a device that is performing a brute force cracking attack, after receiving the prompt message, the terminal device will mistakenly believe that the initial login password is a "wrong" login password, and will switch to using other passwords to continue trying to log in to the target system. In other words, at this time, the target login passwords in the target login information sent N times in a row by the terminal device after receiving the prompt message are actually truly wrong passwords. On this basis, the anti-brute force cracking system can determine that the terminal device is suspected to be a device that has engaged in brute force cracking behavior, and the terminal device will never be able to access the target system.
[0055] However, if the terminal device is not a device that is performing a brute force cracking attack, after receiving the prompt information, the terminal device will not consider the initial login password to be a "wrong" login password. The target login password in the target login information sent by the terminal device N times in a row after receiving the prompt information will actually still be the initial login password (i.e., the correct login password). On this basis, the anti-brute force cracking system can allow the terminal device to access the target system after the target login information sent for the Nth time is successfully verified.
[0056] It should be noted that in order to prevent users from frequently re-entering the correct login password, the value of N should not be set too large. For example, N can be set to 1 or 2, so as to improve the user experience. In addition, since the main purpose of the technical solution of the present application is to prevent potential brute force attacks, the multiple login authentication (i.e., N+1 login authentication) mechanism provided by the present application can inform the real users of the target system in advance, so as to ensure that these real users, after outputting the correct login password, are prompted that the login fails and need to re-enter the login information, but these users know that they only need to enter the same correct login password N times again to access the target system normally, thereby avoiding the trouble of the real users during use. In addition, since the attacker has no way of knowing that the target system uses the multiple login authentication (i.e., N+1 login authentication) mechanism provided by the present application, because the attacker will not continue to enter the same correct login password N times in the subsequent process, the target system is protected from brute force attacks.
[0057] It should also be noted that, unlike the existing multiple verification methods that use different verification methods to verify login information, according to the technical solution of the present application, the method for verifying the initial login information and the target login information is the same verification method.
[0058] Based on the contents of the above steps S101 to S104, it can be known that in the present application, after the initial login password is successfully verified, the login information still needs to be collected again. First, the initial login information sent by the terminal device when requesting to access the target system is obtained, wherein the initial login information at least includes the initial login password. When it is detected that the initial login password in the initial login information is successfully verified, a prompt message of login failure is returned to the terminal device, wherein the prompt message is also used to prompt the terminal device to resend the login information. Then, the target login information sent by the terminal device N times in succession after receiving the prompt message is collected, wherein N is an integer greater than or equal to 1. Finally, based on the verification results of the target login password in the target login information N times, it is determined whether the terminal device is allowed to access the target system.
[0059] As can be seen from the above content, the present application proposes a login verification method. When the initial login password verification succeeds, the terminal device is not directly allowed to access the target system, but a prompt message of login failure is returned to the terminal device, and the terminal device is prompted to resend the login information. In this way, it is equivalent to designing a deception mechanism for the terminal device. If the terminal device is a device that is performing brute force cracking, after receiving the prompt message, it will mistakenly think that the initial login password is a "wrong password", and thus use other passwords for cracking instead, which will cause the terminal device to fail to pass the verification after receiving the "real" wrong login passwords subsequently sent by the terminal device, and the terminal device cannot successfully access the target system, thereby achieving effective prevention of brute force cracking by the terminal device. Of course, if the terminal device is not a device that is performing brute force cracking, it will continue to enter the correct initial login password, and the terminal device can be allowed to access the target system at this time.
[0060] It can be seen that through the technical solution of the present application, the purpose of effectively detecting and preventing brute force cracking attacks that may be sent by terminal devices is achieved, thereby improving the data security during data communication between the target system and the terminal device, and further solving the technical problem of low data security caused by the inability to effectively detect and prevent brute force cracking attacks in the prior art.
[0061] In an optional embodiment, when it is detected that the target login passwords in the target login information are all successfully verified N times, the terminal device is allowed to access the target system; when it is detected that the target login password in the target login information sent for the i-th time out of N times fails to be verified, the terminal device is prohibited from accessing the target system, and the login information sent by the terminal device for the i+1th time is used as the new initial login information.
[0062] Optionally, the present application provides an N+1 re-login authentication mechanism, where, when the initial login password is successfully authenticated, the subsequent N target login passwords must also be successfully authenticated before the terminal device is allowed to access the target system. If any of the subsequent N target login passwords fails to be authenticated, the terminal device is prohibited from accessing the target system.
[0063] For example, assuming that N+1=2, after the first login password (initial login password) sent by the terminal device is successfully verified, even if the anti-brute force cracking system returns a login failure prompt message to the terminal device, the second login password (i.e., the target login password) resent by the terminal device is still successfully verified (usually the target login password is the same as the initial login password), then the anti-brute force cracking system allows the terminal device to access the target system. However, if the second login password resent by the terminal device is different from the initial login password, resulting in the failure of the second login password verification, the anti-brute force cracking system can determine that the terminal device is suspected to be a device that is carrying out a brute force attack, and the anti-brute force cracking system will prohibit the terminal device from accessing the target system.
[0064] From the above content, it can be seen that the N+1 login verification mechanism can effectively prevent potential brute force attacks, thereby improving the data security of the target system.
[0065] In an optional embodiment, the initial login information also includes at least the initial network address used by the terminal device when sending the initial login information. When determining whether to allow the terminal device to access the target system based on the verification result of the target login password in the target login information, the anti-brute force cracking system can also detect whether the target network address used by the terminal device each time when sending the target login information is the same as the initial network address to obtain a detection result; and determine whether to allow the terminal device to access the target system based on the detection result and the verification result of the target login password in the target login information.
[0066] Optionally, the initial network address and the target network address can be addresses used in various networks such as IP addresses and MAC addresses. The anti-brute force cracking system can introduce the network address (such as login IP) used by the terminal device each time it sends login information, and verify whether the terminal device is a device that attempts to implement brute force cracking in combination with the login password, and determine whether the terminal device is allowed to access the target system.
[0067] It should be noted that when attackers carry out brute force cracking, they sometimes bypass the system's defense detection by frequently changing the login IP. Therefore, by combining network addresses and login passwords to detect and prevent brute force cracking, the technical effect of improving the success rate of brute force cracking detection and defense can be achieved.
[0068] In an optional embodiment, when the target network address is the same as the initial network address and the target login passwords in the target login information sent N times in succession are all successfully verified, the terminal device is allowed to access the target system; when the target network address is different from the initial network address and / or the target login password in the target login information sent N times in succession fails to be verified, the terminal device is prohibited from accessing the target system.
[0069] From the above content, only when the target network address used by the terminal device in the subsequent N target login information sent is the same as the initial network address, and the target login passwords in the target login information sent N times are all successfully verified, the anti-brute force cracking system allows the terminal device to access the target system; when the target network address is different from the initial network address. If any of the target network addresses is different from the initial network address, or the target login password in any of the target login information sent fails to be verified, the terminal device will be prohibited from accessing the target system.
[0070] It should be noted that, in another optional embodiment, the following target system login verification method is also provided:
[0071] When the target network address is the same as the initial network address and, among the target login information sent N times, the number of target login information in which the target login password is successfully verified is greater than or equal to a preset number, the terminal device is allowed to access the target system; when the target network address is different from the initial network address and / or, among the target login information sent N times, the number of target login information in which the target login password is successfully verified is less than the preset number, the terminal device is prohibited from accessing the target system.
[0072] It should also be noted that since the login IP of the terminal device generally does not change frequently during the normal login process, if it is detected that the login IP of the terminal device changes frequently during the process of sending login information N times in a row, anti-brute force cracking can prohibit the terminal device from accessing the target system, thereby improving the data security of the target system.
[0073] In an optional embodiment, when the initial login password is successfully verified, the anti-brute force cracking system can detect whether the initial login password is a weak password, wherein the weak password is a password with a character length less than a preset length or a password with a number of character types less than a preset threshold; when the initial login password is the weak password, the anti-brute force cracking system returns a prompt message of login failure to the terminal device, and collects the target login information sent N times consecutively by the terminal device after receiving the prompt message; when the initial login password is not a weak password, the terminal device is allowed to access the target system.
[0074] Alternatively, a weak password is a password that is easily guessed by others or quickly cracked by automated tools. Such passwords are usually very insecure because they are too simple and common. Using weak passwords will expose user accounts, systems, or services to higher security risks. The following are some typical examples and characteristics of weak passwords:
[0075] Default password: A default password that is not changed when many devices or services are first set up, such as "admin", "password", or "123456".
[0076] Simple sequence or repeated characters: such as "12345678", "qwerty", "aaaaaa", etc.
[0077] Personal information: A user's birthday, phone number, name, or variations thereof that is readily available to someone familiar with the user or through social media.
[0078] Common vocabulary: Use words directly from the dictionary, especially common words without any modification.
[0079] Short password: Generally refers to a password with less than 8 characters, because its combination number is limited and it is easy to be cracked by exhaustive cracking.
[0080] Lack of complexity: Does not contain a combination of uppercase letters, lowercase letters, numbers, and special symbols.
[0081] Optionally, when N is 1, the technical solution of the present application can be understood as a dual verification method based on a login password. The method may include the following steps:
[0082] Step 1: When a certain IP uses a certain account to log in for the first time and the password authentication is successful;
[0083] Step 2: The login process interception module intercepts the login process and collects the login IP, login account, login password and other information and passes it to the brute force cracking protection module;
[0084] Step 3: The protection module first checks whether the login password is a weak password. If not, the login is successful.
[0085] Step 4: If it is a weak password, determine whether the IP has successfully authenticated the password twice in a row. If so, the login is successful and one is added to the recorded number of successful logins.
[0086] Step 5: If the password authentication is successful for the first time (the last authentication failed), the login failure is returned directly, and the user is asked to log in again. The number of successful logins is recorded as 1, and the number of successful logins is strongly bound to the login user name and login IP.
[0087] Step 6: If the user logs in again using the same account and password, the above determination process will be repeated, and finally it will be recognized that the password authentication is successful twice in a row, and the login is successful;
[0088] Step 7: If it is an attacker, then even if the correct password was used last time, since the feedback result is failure, the new password will be used to try to log in next time.
[0089] It should be noted that in order to facilitate login authentication for users or related programs, this application provides a strategy that only requires two-factor authentication for the first login with a weak password. However, this strategy can be adjusted. If it is necessary to ensure security, all passwords can be required to be two-factor authenticated, or weak passwords can require two-factor authentication each time, or the number of repeated authentications can exceed 2 times. These changes should be within the scope of protection of this application.
[0090] In an optional embodiment, after determining whether to allow the terminal device to access the target system according to the verification result of the target login password in the target login information, the anti-brute force cracking system can detect whether the number of times the terminal device is continuously prohibited from accessing the target system is greater than a first preset number; and detect whether the number of times the terminal device is prohibited from accessing the target system within a preset time period is greater than a second preset number. In the case where it is detected that the number of times the terminal device is continuously prohibited from accessing the target system is greater than the first preset number, and / or the number of times the terminal device is prohibited from accessing the target system within a preset time period is greater than the second preset number, it is determined that the terminal device is an abnormal device that implements brute force cracking behavior on the target system; in the case where it is detected that the number of times the terminal device is continuously prohibited from accessing the target system is less than or equal to the first preset number, and the number of times the terminal device is prohibited from accessing the target system within the preset time period is less than or equal to the second preset number, it is determined that the terminal device is not an abnormal device that implements brute force cracking behavior on the target system.
[0091] In an optional embodiment, the anti-brute force cracking system can also detect whether a preset login password stored by a user of the target system in the target system is a weak password. When it is detected that the preset login password is the weak password, target information is generated, wherein the target information is used to prompt the user to modify the weak password to a non-weak password, or to prompt the user to enable an N+1 password verification mechanism, wherein the N+1 password verification mechanism indicates that a prerequisite for the user to successfully access the target system is to enter the correct weak password N+1 times in a row.
[0092] Optionally, the anti-brute force cracking system can actively scan whether the preset login password stored by the user in the target system is a weak password, or detect whether the preset login password of the user is a weak password when the user registers an account. If it is detected that the preset login password of the user is a weak password, the following methods can be used for the user to choose:
[0093] The first method is to prompt the user to modify the weak password to a non-weak password, thereby improving the user's data security and avoiding the problem of being easily cracked by brute force due to the login password set by the user being too simple.
[0094] The second method is to prompt the user to enable the N+1 repeated password verification mechanism, wherein the N+1 repeated password verification mechanism indicates that the prerequisite for the user to successfully access the target system is to continuously enter the correct weak password N+1 times. In other words, after the user starts the N+1 repeated password verification mechanism, the user can continue to use the weak password, but in order to avoid being cracked by brute force, the user is allowed to access the target system only after the user continuously enters the correct weak password N+1 times.
[0095] From the above content, it can be known that for devices that are prohibited from accessing for multiple consecutive times (the number of times the corresponding device is prohibited from accessing the target system is greater than the first preset number of times), or devices that are prohibited from accessing too many times within a preset time period (the number of times the device is prohibited from accessing the target system within a preset time period is greater than the second preset number of times), it can be identified as a device that is performing brute force cracking. For devices that are identified as performing brute force cracking, the anti-brute force cracking system can generate a prompt message to prompt the administrator of the target system that the device may be under brute force attack.
[0096] It can be seen that through the technical solution of the present application, the purpose of effectively detecting and preventing brute force cracking attacks that may be sent by terminal devices is achieved, thereby improving the data security during data communication between the target system and the terminal device, and further solving the technical problem of low data security caused by the inability to effectively detect and prevent brute force cracking attacks in the prior art.
[0097] According to another aspect of the embodiment of the present application, a login verification device is also provided, wherein, Figure 3 As shown, the login verification device includes: an acquisition unit 301, which is used to acquire initial login information sent by the terminal device when requesting to access the target system, wherein the initial login information at least includes an initial login password; a processing unit 302, which is used to return a prompt message of login failure to the terminal device when detecting that the initial login password in the initial login information is successfully verified, wherein the prompt message is also used to prompt the terminal device to resend the login information; a collection unit 303, which is used to collect the target login information sent by the terminal device N times in succession after receiving the prompt message, wherein N is an integer greater than or equal to 1; a determination unit 304, which is used to determine whether the terminal device is allowed to access the target system based on the verification result of the target login password in the target login information.
[0098] Optionally, the determination unit 304 includes: a first processing subunit and a second processing subunit. The first processing subunit is used to allow the terminal device to access the target system when it is detected that the target login password in the target login information is successfully verified for N times; the second processing subunit is used to prohibit the terminal device from accessing the target system when it is detected that the target login password in the target login information sent for the i-th time out of the N times fails to be verified, and use the login information sent for the i+1th time by the terminal device as the new initial login information.
[0099] Optionally, the initial login information also includes at least an initial network address used by the terminal device when sending the initial login information, and the determination unit 304 includes: a detection subunit and a determination subunit. The detection subunit is used to detect whether the target network address used by the terminal device each time when sending the target login information is the same as the initial network address to obtain a detection result; the determination subunit is used to determine whether the terminal device is allowed to access the target system based on the detection result and the verification result of the target login password in the target login information.
[0100] Optionally, the determination subunit includes: a first processing module and a second processing module. The first processing module is used to allow the terminal device to access the target system if the target network address is the same as the initial network address and the target login passwords in the target login information sent N times in succession are all successfully verified; the second processing module is used to prohibit the terminal device from accessing the target system if the target network address is different from the initial network address and / or the target login password in any of the target login information sent N times in succession fails to be verified.
[0101] Optionally, the login verification device further includes: a weak password detection unit, a first processing unit, and a second processing unit. The weak password detection unit is used to detect whether the initial login password is a weak password when the initial login password verification succeeds, wherein the weak password is a password with a character length less than a preset length or a password with a number of character types less than a preset threshold; the first processing unit is used to return a login failure prompt message to the terminal device when the initial login password is the weak password, and collect the target login information sent by the terminal device N times in succession after receiving the prompt message; the second processing unit is used to allow the terminal device to access the target system when the initial login password is not a weak password.
[0102] Optionally, the login verification device further includes: a first detection unit, a second detection unit, a first determination unit, and a second determination unit. The first detection unit is used to detect whether the number of times the terminal device is continuously prohibited from accessing the target system is greater than a first preset number; the second detection unit is used to detect whether the number of times the terminal device is prohibited from accessing the target system within a preset time period is greater than a second preset number; the first determination unit is used to determine that the terminal device is an abnormal device that implements brute force cracking behavior on the target system when it is detected that the number of times the terminal device is continuously prohibited from accessing the target system is greater than the first preset number, and / or the number of times the terminal device is prohibited from accessing the target system within a preset time period is greater than the second preset number; the second determination unit is used to determine that the terminal device is not an abnormal device that implements brute force cracking behavior on the target system when it is detected that the number of times the terminal device is continuously prohibited from accessing the target system is less than or equal to the first preset number, and the number of times the terminal device is prohibited from accessing the target system within a preset time period is less than or equal to the second preset number.
[0103] Optionally, the login verification device also includes: a weak password processing unit, used to detect whether a preset login password stored in the target system by a user of the target system is a weak password; when it is detected that the preset login password is the weak password, target information is generated, wherein the target information is used to prompt the user to modify the weak password to a non-weak password, or to prompt the user to enable an N+1 password verification mechanism, wherein the N+1 password verification mechanism indicates that the prerequisite for the user to successfully access the target system is to enter the correct weak password N+1 times in a row.
[0104] According to another aspect of the present application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, wherein when the computer program is set to run, the computer device where the computer program is located executes any one of the login verification methods described above.
[0105] According to another aspect of the present application, an electronic device is also provided, wherein the electronic device includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute any one of the login verification methods described above.
[0106] 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.
[0107] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0108] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0109] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0110] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0111] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0112] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A login verification method, characterized in that: include: Acquire initial login information sent by the terminal device when requesting to access the target system, wherein the initial login information at least includes an initial login password; When it is detected that the initial login password in the initial login information is successfully verified, returning a prompt message indicating a login failure to the terminal device, wherein the prompt message is also used to prompt the terminal device to resend the login information; Collecting the target login information sent by the terminal device N times in succession after receiving the prompt information, where N is an integer greater than or equal to 1; Determine whether to allow the terminal device to access the target system based on the verification results of the target login password in the target login information N times.
2. The login verification method according to claim 1, characterized in that: Determining whether to allow the terminal device to access the target system according to the verification results of the target login password in the target login information N times includes: When it is detected that all the target login passwords in the target login information are successfully verified N times, allowing the terminal device to access the target system; When it is detected that the target login password verification in the target login information sent for the i-th time out of N times fails, the terminal device is prohibited from accessing the target system, and the login information sent by the terminal device for the i+1th time is used as the new initial login information, where i is a positive integer less than or equal to N.
3. The login verification method according to claim 1, characterized in that: The initial login information also includes at least an initial network address used by the terminal device when sending the initial login information, and determining whether to allow the terminal device to access the target system according to a verification result of a target login password in the target login information, the login verification method further includes: Detecting whether the target network address used by the terminal device each time when sending the target login information is the same as the initial network address, and obtaining a detection result; According to the detection result and the verification result of the target login password in the target login information, it is determined whether the terminal device is allowed to access the target system.
4. The login verification method according to claim 3, characterized in that: Determining whether to allow the terminal device to access the target system according to the detection result and the verification result of the target login password in the target login information includes: If the target network address is the same as the initial network address and the target login passwords in the target login information sent N times in succession are all successfully verified, allowing the terminal device to access the target system; In the case that the target network address is different from the initial network address and / or the target login password in the target login information sent any one of N consecutive times fails to be verified, the terminal device is prohibited from accessing the target system.
5. The login verification method according to claim 1, characterized in that: The login verification method further includes: If the initial login password is successfully verified, detecting whether the initial login password is a weak password, wherein the weak password is a password whose character length is less than a preset length or a password whose number of character types is less than a preset threshold; In the case where the initial login password is the weak password, returning a prompt message indicating a login failure to the terminal device, and collecting target login information sent N times consecutively by the terminal device after receiving the prompt message; In a case where the initial login password is not a weak password, the terminal device is allowed to access the target system.
6. The login verification method according to any one of claims 1 to 5, characterized in that: After determining whether to allow the terminal device to access the target system according to the verification result of the target login password in the target login information, the login verification method further includes: Detecting whether the number of times the terminal device is continuously prohibited from accessing the target system is greater than a first preset number; Detecting whether the number of times the terminal device is prohibited from accessing the target system within a preset time period is greater than a second preset number; When it is detected that the number of times the terminal device is continuously prohibited from accessing the target system is greater than the first preset number of times, and / or the number of times the terminal device is prohibited from accessing the target system within a preset time period is greater than a second preset number of times, the terminal device is determined to be an abnormal device that performs brute force cracking on the target system; When it is detected that the number of times the terminal device is continuously prohibited from accessing the target system is less than or equal to the first preset number, and the number of times the terminal device is prohibited from accessing the target system within a preset time period is less than or equal to a second preset number, it is determined that the terminal device is not an abnormal device that performs brute force cracking on the target system.
7. The login verification method according to claim 1, characterized in that: The login verification method further includes: Detecting whether a preset login password stored in the target system by a user of the target system is a weak password; When it is detected that the preset login password is the weak password, target information is generated, wherein the target information is used to prompt the user to change the weak password to a non-weak password, or to prompt the user to enable an N+1 password verification mechanism, wherein the N+1 password verification mechanism indicates that a prerequisite for the user to successfully access the target system is to enter the correct weak password N+1 times in a row.
8. A login verification device, characterized in that: include: An acquisition unit, configured to acquire initial login information sent by a terminal device when requesting to access a target system, wherein the initial login information at least includes an initial login password; a processing unit, configured to return a prompt message indicating a login failure to the terminal device when detecting that the initial login password in the initial login information is successfully verified, wherein the prompt message is further configured to prompt the terminal device to resend the login information; A collecting unit, used to collect the target login information sent by the terminal device N times in succession after receiving the prompt information, where N is an integer greater than or equal to 1; A determination unit is used to determine whether to allow the terminal device to access the target system based on the verification results of the target login password in the target login information N times.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is configured to be executed, the computer device where the computer program is located executes the login verification method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the login verification method described in any one of claims 1 to 7.
