Weak password detection method, device, system and storage medium

By using the SAM file to obtain the NTLM hash value in the Windows system and searching it in the shared password dictionary, and combining it with the SQLite file to determine the changes in the SAM file, the problem of slow weak password detection speed is solved, achieving second-level detection and efficient resource utilization.

CN114448614BActive Publication Date: 2024-11-26CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111577825.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2024-11-26
Estimated Expiration
2041-12-22

AI Technical Summary

Technical Problem

Existing technologies are slow and time-consuming when detecting weak passwords in Windows systems.

Method used

By receiving weak password detection instructions, the system obtains the target user's username and NTLM hash value using the SAM file, searches for the NTLM hash value in the shared password dictionary, and combines this with the SQLite file to determine whether the SAM file has been modified, thus optimizing the detection process.

Benefits of technology

It reduces the speed of weak password detection to the second level, decreases dependence on the network and resource waste, and improves detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114448614B_ABST
    Figure CN114448614B_ABST
Patent Text Reader

Abstract

The present invention discloses a weak password detection method, device, system and storage medium, the method comprising: receiving a weak password detection instruction; if it is determined that the weak password detection instruction passes legal verification, obtaining the user name and the corresponding NTLM hash value of the target user through a SAM file; retrieving the NTLM hash value in a shared password dictionary, the shared password dictionary is used to store the weak password encrypted by the NTLM hash method; determining a first detection result according to the retrieval result, and outputting the first detection result; wherein, if the retrieval result is that the NTLM hash value is retrieved, the first detection result is that the password of the target user is a weak password; if the retrieval result is that the NTLM hash value is not retrieved, the first detection result is that the password of the target user is not a weak password. Therefore, the present invention improves the weak password detection speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer network security technology, and in particular to a weak password detection method, device, system and storage medium. Background Art

[0002] Weak passwords are generally considered to be passwords that are easily guessed by others or cracked by cracking tools.

[0003] There are two current methods for detecting weak passwords in Windows systems: one is to install a specific weak password scanning tool on the user's host. When the user executes the scanning command, the cracking tool reads the username and login password information required for login from the username dictionary and password dictionary in turn, and uses the exhaustive method to simulate login attempts on the Windows system to be detected; the other is to deploy a weak password detection tool on the server side, and remotely simulate login to the Windows system to be detected through remote login.

[0004] However, the number of weak passwords in a general password dictionary ranges from tens of thousands to hundreds of thousands or even millions. For just one username, all the weak passwords in the password dictionary must be tried. If the username dictionary is also relatively large, trying all possible situations will take several hours or even longer. Summary of the invention

[0005] In view of this, embodiments of the present invention provide a weak password detection method, device, system and storage medium to solve the problem of slow weak password detection speed.

[0006] According to a first aspect, an embodiment of the present invention provides a weak password detection method, comprising:

[0007] Receive weak password detection instructions;

[0008] If it is determined that the weak password detection instruction passes the legal verification, the user name of the target user and the corresponding password verification NTLM hash value are obtained through the security account manager SAM file;

[0009] Retrieving the NTLM hash value in a shared password dictionary, where the shared password dictionary is used to store weak passwords encrypted by NTLM hashing;

[0010] Determine a first detection result according to the search result, and output the first detection result;

[0011] Among them, if the search result is that the NTLM hash value is retrieved, the first detection result is that the password of the target user is a weak password; if the search result is that the NTLM hash value is not retrieved, the first detection result is that the password of the target user is not a weak password.

[0012] In an implementation manner of the present application, after receiving a weak password detection instruction, the user name and the corresponding NTLM hash value of the target user can be obtained through the SAM file, the NTLM hash value can be retrieved in the shared password dictionary, the first detection result is determined based on the retrieval result, and the first detection result is output. In this way, weak password detection is performed through the NTLM hash value, and the weak password detection speed is shortened to seconds, thereby improving the weak password detection speed.

[0013] In combination with the first aspect, in a second implementation of the first aspect, obtaining the user name and the corresponding NTLM hash value of the target user through the SAM file includes:

[0014] Get the local database SQLite file;

[0015] Determine whether the SAM file has changed according to the SQLite file;

[0016] If it is determined that the SAM file has changed, the detection result information stored in the SQLite file is cleared, the changed SAM file is re-read and parsed, and the user name of the target user and the corresponding NTLM hash value are obtained from the SAM in the changed SAM file.

[0017] In the implementation mode of the present application, it is possible to determine whether the SAM file has changed based on the SQLite file. When it is determined that the SAM file has changed, the detection result information saved in the SQLite file can be cleared, the changed SAM file can be re-read and parsed, the user name of the target user and the corresponding NTLM hash value can be obtained, and then the NTLM hash value can be retrieved in the shared password dictionary. This minimizes the dependence on the network and avoids the situation where the detection efficiency is affected due to network anomalies.

[0018] In combination with the second implementation of the first aspect, in the third implementation of the first aspect, further comprising:

[0019] If it is determined that the SAM file has not been changed and the SQLite file does not store the second detection result indicating whether the password of the target user is a weak password, the SAM file is read and parsed to obtain the user name of the target user and the corresponding NTLM hash value.

[0020] In the implementation mode of the present application, when it is determined that the SAM file has not been changed and the second detection result indicating whether the password of the target user is a weak password is not saved in the SQLite file, the SAM file is read and parsed to obtain the user name of the target user and the corresponding NTLM hash value. This also minimizes the dependence on the network and avoids the situation where the detection efficiency is affected by network anomalies.

[0021] In combination with the second embodiment of the first aspect or the third embodiment of the first aspect, in the fourth embodiment of the first aspect, further comprising:

[0022] The first detection result is saved in the SQLite file.

[0023] In an implementation manner of the present application, after determining that the password of the target user is a weak password, the first detection result of this weak password detection can be saved in a SQLite file. If the SAM file has not changed during the next weak password detection, the first detection result can be directly output, thereby further improving the efficiency of weak password detection.

[0024] In combination with the second implementation of the first aspect, in the fifth implementation of the first aspect, further comprising:

[0025] If it is determined that the SAM file has not been changed, and the SQLite file stores a second detection result indicating whether the password of the target user is a weak password, the second detection result is output.

[0026] In an implementation manner of the present application, when it is determined that the SAM file has not been changed and the SQLite file contains a second detection result indicating whether the target user's password is a weak password, the second detection result can be used directly. This improves the efficiency of weak password detection while avoiding waste of resources.

[0027] In combination with the second implementation of the first aspect or the third implementation of the first aspect or the second implementation of the fifth aspect, in a sixth implementation of the first aspect, determining whether the SAM file is changed according to the SQLite file includes:

[0028] Determine whether the message digest algorithm MD5 value and the secure hash algorithm SHA256 value of the SAM file have changed according to the SQLite file;

[0029] If the MD5 value and / or the SHA256 value changes, it is determined that the SAM file changes;

[0030] If neither the MD5 value nor the SHA256 value has changed, it is determined that the SAM file has not changed.

[0031] In the implementation manner of the present application, whether the SAM file has changed can be determined by whether MD5 and SHA256 have changed, which can improve the efficiency of determining whether the SAM file has changed.

[0032] In combination with the first aspect, in the first aspect, the device implementation further includes:

[0033] If it is determined that the weak password detection instruction has not passed the legal verification, the weak password detection instruction is discarded.

[0034] In the implementation manner of the present application, when it is determined that the weak password detection instruction has not passed the legal verification, the weak password detection instruction can be discarded, which avoids resource waste and improves resource utilization.

[0035] According to the second aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the weak password detection method described in the first aspect or any one of the embodiments of the first aspect by executing the computer instructions.

[0036] According to a third aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the weak password detection method described in the first aspect or any one embodiment of the first aspect.

[0037] According to a fourth aspect, an embodiment of the present invention provides a weak password detection system, the system comprising: an electronic device, a shared password dictionary module, a unified management platform, an information processing module and a socket module;

[0038] The electronic device is used to execute the weak password detection method described in the first aspect or any one of the implementations of the first aspect;

[0039] The shared password dictionary module is used to store weak passwords encrypted by NTLM hashing;

[0040] The unified management platform is used to receive weak password detection instructions, display weak password detection results, and update the password dictionary;

[0041] The socket module is used for forwarding instructions between the unified management platform and the electronic device;

[0042] The information processing module is used to summarize and process the weak password detection results and then send them to the unified management platform. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:

[0044] Figure 1 A method flow chart of a weak password detection method is shown.

[0045] Figure 2 A schematic diagram of the architecture of a weak password detection system is shown.

[0046] Figure 3 Another method flow chart of a weak password detection method is shown.

[0047] Figure 4 A structural schematic diagram of an electronic device is shown.

[0048] Figure 5 Another structural schematic diagram of an electronic device is shown. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0050] Figure 1 The flowchart of a weak password detection method is shown. The weak password detection method can be used on electronic devices for weak password detection, such as Windows hosts. Another example is: weak password detection of large-scale Windows system cloud hosts in public clouds and private clouds, which is conducive to reducing security issues caused by weak passwords on cloud hosts. Figure 1 As shown, the weak password detection method includes:

[0051] Step 101: Receive a weak password detection instruction.

[0052] Step 102: If it is determined that the weak password detection instruction passes the legal verification, the user name of the target user and the corresponding password verification (New Technologies Local area network Manager, NTLM) hash value are obtained through the Security Account Manager (Security Account Manager, SAM) file.

[0053] Specifically, after receiving the weak password detection instruction, it will first determine whether the weak password detection instruction is legal. If it is illegal, it will be discarded and the next instruction will be waited for in a loop. If it is legal, the detection task will be executed.

[0054] When executing a detection task, the detection task will be performed on the target user. The target user can be all users saved on the Windows host. The number of target users may be 1 or more. For any target user, the user name and the corresponding NTLM hash value of the target user can be obtained through the SAM file, and then the NTLM hash value can be retrieved in the shared password dictionary. The weak password detection result corresponding to each target user is determined based on the retrieval result.

[0055] Step 103: Retrieve the NTLM hash value in the shared password dictionary, where the shared password dictionary is used to store the weak password encrypted by the NTLM hash method.

[0056] Specifically, the shared password dictionary is not stored in text form, but in a database form. The database is deployed in a relational database management system (MySQL) master-master mode plus a keepalive mechanism. The information stored in MySQL is a weak password encrypted using NTLM hashing, and the shared password dictionary is shared by all Windows cloud hosts in the same resource pool.

[0057] The NTLM hash value is retrieved in the shared password dictionary. If the NTLM hash value is retrieved, it indicates that the target user's password is a weak password; if the NTLM hash value is not retrieved, it indicates that the target user's password is not a weak password. In this way, weak password detection is performed through the NTLM hash value, and the weak password detection speed is shortened to seconds, thereby improving the weak password detection speed.

[0058] It is worth pointing out that the shared password dictionary is shared by all Windows cloud hosts in the same resource pool, that is, a resource pool deploys a set of MySQL master-master mode plus keepalive for sharing by all hosts in the resource pool. This ensures the high availability of the shared password dictionary and simplifies the maintenance of the shared password dictionary.

[0059] Weak passwords in the shared password dictionary can be set by users. For example, when a user logs in to the unified management platform, enters the password dictionary update function area, drags the plain text password file to the specified area by dragging the file, and the password file content is transferred to the shared password dictionary module, encrypted by NTLM hashing, and stored in the MySQL cluster of the shared password dictionary module.

[0060] Step 104: Determine a first detection result based on the search result, and output the first detection result. If the search result is that the NTLM hash value is retrieved, the first detection result is that the password of the target user is a weak password; if the search result is that the NTLM hash value is not retrieved, the first detection result is that the password of the target user is not a weak password.

[0061] In an embodiment of the present application, after receiving a weak password detection instruction, the user name and the corresponding NTLM hash value of the target user can be obtained through the SAM file, and the NTLM hash value can be retrieved in the shared password dictionary. If the NTLM hash value is retrieved, it is determined that the password of the target user is a weak password, and a first detection result indicating that the password of the target user is a weak password is output. In this way, weak password detection is performed through the NTLM hash value, and the weak password detection speed is shortened to seconds, thereby improving the weak password detection speed.

[0062] In an optional embodiment, when obtaining the user name and the corresponding NTLM hash value of the target user through the SAM file in step 102, the following implementation methods may be adopted, but are not limited to:

[0063] 1-1. Get the local database (SQLite) file;

[0064] 1-2. Determine whether the SAM file has changed based on the SQLite file;

[0065] 1-3. If it is determined that the SAM file has been changed, the detection result information saved in the SQLite file is cleared, the changed SAM file is re-read and parsed, and the user name and corresponding NTLM hash value of the target user are obtained from the changed SAM file.

[0066] Specifically, when executing 1-2 above, the following three situations may occur:

[0067] Scenario 1: The SAM file changes.

[0068] Scenario 2: The SAM file is not changed, and the SQLite file does not store the second detection result indicating whether the target user's password is a weak password.

[0069] Scenario 3: It is determined that the SAM file has not been changed, and the SQLite file stores a second detection result indicating whether the password of the target user is a weak password.

[0070] For the above situation 1, you can clear the detection result information saved in the SQLite file, re-read and parse the changed SAM file, obtain the target user's username and the corresponding NTLM hash value, and then retrieve the NTLM hash value in the shared password dictionary.

[0071] Among them, SQLite is a lightweight database. SQLite is used to store the detection result information of weak password detection and the message digest algorithm (Message-Digest Algorithm, MD5) value and secure hash algorithm (Secure Hash Algorithm, SHA) 256 value corresponding to the SAM file.

[0072] Whether the SAM file has changed refers to whether the SAM file required for this weak password detection is the same as the SAM file used in the last weak password detection recorded in the SQLite file. If they are the same, there is no change; if they are different, there is a change.

[0073] Among them, the MD5 value and SHA256 value corresponding to the SAM file can be used to determine whether the SAM file has changed (that is, whether it has been updated).

[0074] It is worth noting that the MD5 algorithm is a cryptographic hash function that can generate a 128-bit (16-byte) hash value to ensure that information transmission is complete and consistent. The hash value length used by the SHA256 algorithm is 256 bits.

[0075] In an embodiment of the present application, it is possible to determine whether the SAM file has changed based on the SQLite file. When it is determined that the SAM file has changed, the detection result information saved in the SQLite file can be cleared, the changed SAM file can be re-read and parsed, the user name of the target user and the corresponding NTLM hash value can be obtained, and then the NTLM hash value can be retrieved in the shared password dictionary. This minimizes the dependence on the network and avoids the situation where the detection efficiency is affected due to network anomalies.

[0076] In an optional embodiment, the weak password detection method may further include:

[0077] If it is determined that the SAM file has not been changed and the SQLite file does not store the second detection result indicating whether the password of the target user is a weak password, the SAM file is read and parsed to obtain the user name of the target user and the corresponding NTLM hash value.

[0078] Specifically, when executing 1-2 above, the following three situations may occur:

[0079] Scenario 1: The SAM file changes.

[0080] Scenario 2: The SAM file is not changed, and the SQLite file does not store the second detection result indicating whether the target user's password is a weak password.

[0081] Scenario 3: It is determined that the SAM file has not been changed, and the SQLite file stores a second detection result indicating whether the password of the target user is a weak password.

[0082] For the above scenario 2, it is also necessary to read and parse the SAM file to obtain the target user's username and the corresponding NTLM hash value, and then retrieve the NTLM hash value in the shared password dictionary.

[0083] In an embodiment of the present application, when it is determined that the SAM file has not been changed and the SQLite file does not store the second detection result indicating whether the password of the target user is a weak password, the SAM file is read and parsed to obtain the user name of the target user and the corresponding NTLM hash value. This also minimizes the dependence on the network and avoids the situation where the detection efficiency is affected due to network anomalies.

[0084] In an optional embodiment, for the above situation 1 and situation 2, the weak password detection method may further include:

[0085] The first detection result is saved in a SQLite file.

[0086] Specifically, in addition to saving the first detection result to the SQLite file, the MD5 value and SHA256 value corresponding to the SAM file used for this weak password detection can also be saved to the SQLite file, which is used to determine whether the SAM file has changed (i.e., whether it has been updated) during the next weak password detection.

[0087] In an embodiment of the present application, after determining that the password of the target user is a weak password, the first detection result of this weak password detection can be saved in a SQLite file. If the SAM file has not changed during the next weak password detection, the first detection result can be directly output, thereby further improving the efficiency of weak password detection.

[0088] In an optional embodiment, the weak password detection method may further include:

[0089] If it is determined that the SAM file has not been changed, and the SQLite file stores a second detection result indicating whether the password of the target user is a weak password, the second detection result is output.

[0090] Specifically, when executing 1-2 above, the following three situations may occur:

[0091] Scenario 1: The SAM file changes.

[0092] Scenario 2: The SAM file is not changed, and the SQLite file does not store the second detection result indicating whether the target user's password is a weak password.

[0093] Scenario 3: It is determined that the SAM file has not been changed, and the SQLite file stores a second detection result indicating whether the password of the target user is a weak password.

[0094] For the above scenario three, a second detection result indicating whether the password of the target user is a weak password may be directly output.

[0095] In an embodiment of the present application, when it is determined that the SAM file has not been changed and the SQLite file contains a second detection result indicating whether the target user's password is a weak password, the second detection result can be used directly. This improves the efficiency of weak password detection while avoiding waste of resources.

[0096] In an optional embodiment, when performing the above 1-2, the following implementation methods may be adopted but are not limited to:

[0097] Determine whether the MD5 value and SHA256 value of the SAM file have changed based on the SQLite file;

[0098] If the MD5 value and / or SHA256 value changes, it is determined that the SAM file has changed;

[0099] If the MD5 value and the SHA256 value have not changed, it is determined that the SAM file has not been changed.

[0100] Specifically, each time a weak password is detected, the MD5 value and SHA256 value corresponding to the SAM file to be used will be recorded in the SQLite file. The next time a weak password is detected, the MD5 value and SHA256 value corresponding to the SAM file to be used will be recalculated. In this way, by comparing whether the MD5 and SHA256 values ​​before and after have changed, it can be determined whether the SAM has changed.

[0101] If at least one of the two MD5 and SHA256 changes, it is determined that the SAM has changed; if both the two MD5 and SHA256 do not change, it is determined that the SAM has not changed.

[0102] In the embodiment of the present application, whether the SAM file has changed can be determined by whether MD5 and SHA256 have changed, which can improve the efficiency of determining whether the SAM file has changed.

[0103] In an optional embodiment, after executing step 101, the following steps may also be included:

[0104] If it is determined that the weak password detection instruction has not passed the legal verification, the weak password detection instruction is discarded.

[0105] Specifically, there are many ways to legally verify the weak password detection instruction, and the present invention does not limit this method.

[0106] In the embodiment of the present application, when it is determined that the weak password detection instruction has not passed the legal verification, the weak password detection instruction can be discarded, which avoids resource waste and improves resource utilization.

[0107] The following two specific examples illustrate the specific implementation process of the above weak password detection.

[0108] Example 1: A weak password detection system for Windows based on cloud services, such as Figure 2 The system includes: an agent detection module, a password dictionary module, a unified management platform, an information processing module, a socket module and the like.

[0109] 1) Agent detection module

[0110] The agent detection module is installed in the tenant's Windows system host to read and parse the SAM file in the Windows system and obtain the system user name and NTLM hash value from the SAM file. After obtaining all user information in the system, access the shared password dictionary module one by one. If the current NTLM hash value can be retrieved in the shared password dictionary, it means that the user password is a weak password. After retrieving the NTLM hash values ​​corresponding to all users, the final detection results and the MD5 and SHA256 corresponding to the SAM file are recorded in the local SQLite file. When the detection task is executed again, if the MD5 and SHA256 values ​​of the SAM file have not changed and there are detection results, the detection results are returned directly without repeating the detection task.

[0111] 2) Shared password dictionary module

[0112] The password dictionary module provides a password dictionary sharing service in the same resource pool. This module is built using the MySQL master-master mode plus a keepalive mechanism. It provides a unified Internet Protocol (IP) address and port for external access, and stores weak passwords encrypted by NTLM hashing in MySQL.

[0113] 3) Unified management platform

[0114] The unified management platform is used to visually manage the cloud hosts under the tenant's name, and provides detection command issuance, result display, and password dictionary library update operations.

[0115] 4) Information processing module

[0116] The detection information of the cloud hosts in the resource pool is aggregated and processed, and the processed information is stored in the database so that the unified management platform can obtain relevant data when displaying the detection information to users on the WEB side.

[0117] 5) Socket module

[0118] The socket module is a command forwarding module. Users manage the cloud hosts under their accounts in a unified manner through a unified management platform. When weak password detection is required for one or more cloud hosts, the socket module is responsible for forwarding the corresponding instructions to the corresponding cloud hosts.

[0119] Example 2: Weak password detection process for Windows system based on cloud service, such as Figure 3 shown.

[0120] 1) The user logs in to the unified management platform, enters the password dictionary update function area, drags the plain text password file to the specified area by dragging the file, and the password file content is transferred to the shared password dictionary module, encrypted by NTLM hash (Hash) method and stored in the MySQL cluster.

[0121] 2) After the user updates the password dictionary, specify one or more Windows hosts to perform system weak password detection.

[0122] 3) After the agent in the Windows host receives the weak password detection instruction, it first determines whether the weak password detection instruction is legal. If it is illegal, it will be discarded and looped to wait for the next instruction. If it is legal, it will start to execute the detection task.

[0123] 4) When executing the test, first read the local SQLite file. If the MD5 and SHA256 of the system SAM file have not changed and there is a test result, it means that the system user information has not changed, then directly read and send the last test result.

[0124] 5) If the SAM file is changed, clear the detection results recorded in the local SQLite file, reset the MD5 and SHA256 values ​​of the SAM file, re-read and parse the SAM file, obtain all users and their corresponding NTLM hash values, and search them one by one in the shared password dictionary to check whether the current user's NTLM-Hash value is included in the password dictionary. If it is included, it means that the current user's password is a weak password.

[0125] 6) After all users are tested, the test results are stored in a local SQLite file and sent to the information processing module.

[0126] 7) The information processing module processes the received test results and stores them in a database. The unified management platform interface obtains information from the database and displays it to the user on the unified management platform interface.

[0127] It can be seen from the above embodiments that the advantages and beneficial effects of the present invention are:

[0128] a. Less CPU resources are used: The Windows system weak password detection method provided by the present invention does not need to adopt an enumeration method. It performs repeated simulated login attempts on the detected host according to the user name dictionary and the password dictionary. Only simple file information extraction and database retrieval operations are required to complete the weak password detection, which greatly reduces the long-term occupation of CPU resources due to the traditional weak password detection method.

[0129] b. Fast detection speed: The method provided by the present invention does not try all combinations in the user dictionary and password dictionary one by one, but reads and parses the Windows system SAM file, extracts the user name information and the corresponding NTLM hash value from it, and then determines whether the current user has set a weak password by searching for the NTLM hash value in the shared password dictionary library. In this way, the traditional detection time, which takes tens of minutes or even hours, is shortened to seconds.

[0130] c. No reliance on the network: Since the Windows weak password detection method provided by the present invention parses the Windows system SAM file in the detected host, and after the parsing is completed, the current NTLM hash value is retrieved by accessing the shared password dictionary library, which greatly reduces the impact on detection efficiency caused by network anomalies.

[0131] d. Password dictionary sharing: In the method provided by the present invention, the plain text password is encrypted by NTLM hash value and stored in the MySQL cluster. A resource pool deploys a set of MySQL master-master mode plus keepalive for sharing by all hosts in the resource pool, which ensures the high availability of the password dictionary database and simplifies the maintenance of the password dictionary.

[0132] Figure 4 The schematic diagram of the structure of an electronic device is shown. The electronic device can be a device for weak password detection. For example: Windows host. Another example: weak password detection of large-scale Windows system cloud hosts in public clouds and private clouds is conducive to reducing security issues caused by weak passwords on cloud hosts. Figure 4 As shown, the electronic device may include:

[0133] A receiving module 41, used for receiving a weak password detection instruction;

[0134] The acquisition module 42 is used to obtain the user name of the target user and the corresponding password verification NTLM hash value through the security account manager SAM file if it is determined that the weak password detection instruction passes the legal verification;

[0135] A retrieval module 43, used for retrieving the NTLM hash value in a shared password dictionary, wherein the shared password dictionary is used for storing weak passwords encrypted by NTLM hashing;

[0136] The first output module 44 is used to determine a first detection result based on the retrieval result and output the first detection result; wherein, if the retrieval result is that the NTLM hash value is retrieved, the first detection result is that the password of the target user is a weak password; if the retrieval result is that the NTLM hash value is not retrieved, the first detection result is that the password of the target user is not a weak password.

[0137] In a possible implementation, the acquisition module 42 includes:

[0138] The first acquisition submodule is used to obtain the local database SQLite file;

[0139] A judgment submodule, used for judging whether the SAM file has been changed according to the SQLite file;

[0140] The second acquisition submodule is used to clear the detection result information stored in the SQLite file if it is determined that the SAM file has changed, re-read and parse the changed SAM file, and obtain the user name and corresponding NTLM hash value of the target user from the SAM in the changed SAM file.

[0141] In a possible implementation, the acquisition module 42 further includes:

[0142] The third acquisition submodule is used to read and parse the SAM file to obtain the user name and corresponding NTLM hash value of the target user if it is determined that the SAM file has not changed and the SQLite file does not store the second detection result indicating whether the password of the target user is a weak password.

[0143] In a possible implementation, the method further includes:

[0144] A saving module is used to save the first detection result into the SQLite file.

[0145] In a possible implementation, the method further includes:

[0146] The second output module is used to output the second detection result if it is determined that the SAM file has not been changed and the SQLite file stores a second detection result indicating whether the password of the target user is a weak password.

[0147] In a possible implementation, the determination submodule is specifically used for:

[0148] Determine whether the message digest algorithm MD5 value and the secure hash algorithm SHA256 value of the SAM file have changed according to the SQLite file;

[0149] If the MD5 value and / or the SHA256 value changes, it is determined that the SAM file changes;

[0150] If neither the MD5 value nor the SHA256 value has changed, it is determined that the SAM file has not changed.

[0151] In a possible implementation, the method further includes:

[0152] The discarding module is used to discard the weak password detection instruction if it is determined that the weak password detection instruction fails to pass the legal verification.

[0153] It should be noted here that the electronic device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those in the method embodiment will not be described in detail here.

[0154] Figure 5 Another structural schematic diagram of an electronic device is shown. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the weak password detection method, which includes:

[0155] Receive weak password detection instructions;

[0156] If it is determined that the weak password detection instruction passes the legal verification, the user name of the target user and the corresponding password verification NTLM hash value are obtained through the security account manager SAM file;

[0157] Retrieving the NTLM hash value in a shared password dictionary, where the shared password dictionary is used to store weak passwords encrypted by NTLM hashing;

[0158] Determine a first detection result according to the search result, and output the first detection result;

[0159] Among them, if the search result is that the NTLM hash value is retrieved, the first detection result is that the password of the target user is a weak password; if the search result is that the NTLM hash value is not retrieved, the first detection result is that the password of the target user is not a weak password.

[0160] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the 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 for 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 invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0161] It should be noted here that the electronic device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those in the method embodiment will not be described in detail here.

[0162] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer can execute the weak password detection method provided by the above methods, the method comprising:

[0163] Receive weak password detection instructions;

[0164] If it is determined that the weak password detection instruction passes the legal verification, the user name of the target user and the corresponding password verification NTLM hash value are obtained through the security account manager SAM file;

[0165] Retrieving the NTLM hash value in a shared password dictionary, where the shared password dictionary is used to store weak passwords encrypted by NTLM hashing;

[0166] Determine a first detection result according to the search result, and output the first detection result;

[0167] Among them, if the search result is that the NTLM hash value is retrieved, the first detection result is that the password of the target user is a weak password; if the search result is that the NTLM hash value is not retrieved, the first detection result is that the password of the target user is not a weak password.

[0168] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the weak password detection method provided above, the method comprising:

[0169] Receive weak password detection instructions;

[0170] If it is determined that the weak password detection instruction passes the legal verification, the user name of the target user and the corresponding password verification NTLM hash value are obtained through the security account manager SAM file;

[0171] Retrieving the NTLM hash value in a shared password dictionary, where the shared password dictionary is used to store weak passwords encrypted by NTLM hashing;

[0172] Determine a first detection result according to the search result, and output the first detection result;

[0173] Among them, if the search result is that the NTLM hash value is retrieved, the first detection result is that the password of the target user is a weak password; if the search result is that the NTLM hash value is not retrieved, the first detection result is that the password of the target user is not a weak password.

[0174] In another aspect, the present invention further provides a weak password detection system, the system comprising: an electronic device (such as Figure 2 Cloud hosts in ), shared password dictionary modules (such as Figure 2 Shared password dictionary module in ), unified management platform (such as Figure 2 unified management platform in the Figure 2 The information processing module in ) and the socket module (such as Figure 2 Socket module in );

[0175] Wherein, the electronic device is used to execute the weak password detection method in the above embodiment;

[0176] The shared password dictionary module is used to store weak passwords encrypted by NTLM hashing;

[0177] The unified management platform is used to receive weak password detection instructions, display weak password detection results, and update the password dictionary;

[0178] The socket module is used for forwarding instructions between the unified management platform and the electronic device;

[0179] The information processing module is used to summarize and process the weak password detection results and then send them to the unified management platform.

[0180] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0181] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0182] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A weak password detection method, characterized in that: include: Receive weak password detection instructions; If it is determined that the weak password detection instruction passes the legal verification, the user name of the target user and the corresponding password verification NTLM hash value are obtained through the security account manager SAM file; Retrieving the NTLM hash value in a shared password dictionary, the shared password dictionary is used to store weak passwords encrypted by NTLM hashing, the shared password dictionary is stored in a database form and is shared by all Windows cloud hosts in the same resource pool, and the database is deployed in a master-master mode of a relational database management system plus a survival detection mechanism; Determine a first detection result according to the search result, and output the first detection result; Wherein, if the search result is that the NTLM hash value is retrieved, the first detection result is that the password of the target user is a weak password; if the search result is that the NTLM hash value is not retrieved, the first detection result is that the password of the target user is not a weak password; The method of obtaining the user name and the corresponding NTLM hash value of the target user through the SAM file includes: Get the local database SQLite file; Determine whether the SAM file has changed according to the SQLite file; If it is determined that the SAM file has been changed, clear the detection result information stored in the SQLite file, re-read and parse the changed SAM file, and obtain the user name and corresponding NTLM hash value of the target user from the SAM file after the change; If it is determined that the SAM file has not been changed and the SQLite file does not store the second detection result indicating whether the password of the target user is a weak password, the SAM file is read and parsed to obtain the user name of the target user and the corresponding NTLM hash value.

2. The method according to claim 1, characterized in that Also includes: The first detection result is saved in the SQLite file.

3. The method according to claim 1, characterized in that: Also includes: If it is determined that the SAM file has not been changed, and the SQLite file stores a second detection result indicating whether the password of the target user is a weak password, the second detection result is output.

4. The method according to claim 1 or 3, characterized in that: The determining, according to the SQLite file, whether the SAM file has changed comprises: Determine whether the message digest algorithm MD5 value and the secure hash algorithm SHA256 value of the SAM file have changed according to the SQLite file; If the MD5 value and / or the SHA256 value changes, it is determined that the SAM file changes; If neither the MD5 value nor the SHA256 value has changed, it is determined that the SAM file has not changed.

5. The method according to claim 1, characterized in that: Also includes: If it is determined that the weak password detection instruction has not passed the legal verification, the weak password detection instruction is discarded.

6. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the weak password detection method according to any one of claims 1 to 5 by executing the computer instructions.

7. A weak password detection system, characterized in that: The system comprises: an electronic device, a shared password dictionary module, a unified management platform, an information processing module and a socket module; Wherein, the electronic device is used to execute the weak password detection method described in any one of claims 1 to 5; The shared password dictionary module is used to store weak passwords encrypted by NTLM hashing. The shared password dictionary is stored in the form of a database and is shared by all Windows cloud hosts in the same resource pool. The database is deployed in a master-master mode of a relational database management system plus a survival detection mechanism. The unified management platform is used to receive weak password detection instructions, display weak password detection results, and update the password dictionary; The socket module is used for forwarding instructions between the unified management platform and the electronic device; The information processing module is used to summarize and process the weak password detection results and then send them to the unified management platform.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the weak password detection method according to any one of claims 1 to 5.