A method for security maintenance and debugging of embedded terminal equipment
By automatically closing the telnetd and sshd services on embedded devices, and adopting multi-layer verification mechanisms and encrypted communication connections, the problems of password fixation and continuous daemon operation in remote debugging of the device are solved, improving the security and stability of the device.
Patent Information
- Application Number
- CN202411303058.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-09-19
AI Technical Summary
The existing remote debugging methods of embedded devices have problems such as password fixation and continuous daemon operation, resulting in security risks and stability impacts.
By automatically closing the telnetd and sshd services, a multi-layer verification mechanism is adopted, and the debugging user password is randomly generated after the authentication is passed, and debugging is carried out through an encrypted communication connection. The service is automatically closed after the debugging is completed.
Improves the security and stability of the device, prevents unauthorized access and cracking, and ensures that only authorized debuggers can access it.
Smart Images

Figure CN118820118B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of electronic digital data processing, and in particular relates to a debugging method for embedded terminal equipment. Background Art
[0002] With the widespread use of embedded devices in the market, various problems may occur during the use of devices due to human or environmental factors after they are sold. In order to solve these problems, embedded device manufacturers usually use remote debugging, that is, using protocols such as telnet or ssh through the network port on the device to log in to the device with a predetermined username and password to troubleshoot and solve problems. However, this remote debugging method has certain security risks:
[0003] 1. Fixed user name and password: User name and password are preset before the device leaves the factory and cannot be changed after leaving the factory. This makes it easy for passwords to be leaked during development or after-sales technical debugging. Once leaked, anyone can log in to the device at will to modify or operate it, thus threatening the security of the device and possibly causing the leakage of information stored in the device.
[0004] 2. Continuous operation of daemons: In order to achieve remote login, the device needs to continuously run daemons such as telnetd or sshd to respond to client connection requests at any time. Even if there is no password leakage, this continuous operation state also brings security risks. Hackers may exploit security vulnerabilities in these daemons to attack the device and affect the stability of the device.
[0005] Therefore, the existing remote debugging methods for embedded devices have obvious deficiencies in security, and a more secure and reliable remote debugging method is needed to protect the security and stable operation of the device. Summary of the invention
[0006] The invention proposes a method for security maintenance and debugging of embedded terminal equipment, the purpose of which is to solve the risk problems caused by fixed passwords and resident telnetd / sshd services and to improve the security of equipment operation.
[0007] The technical solution of the present invention is as follows:
[0008] A method for security maintenance and debugging of embedded terminal equipment, comprising the following steps:
[0009] Step 1: When the device is running, the telnetd service and sshd service are automatically set to closed state, and the debugging connection port is opened;
[0010] Step 2: The debugging personnel establish a communication connection with the debugging connection port of the device through the client software on the PC side. Then the client software encrypts the authentication information corresponding to the device agreed in advance to obtain the authentication information ciphertext, and then sends the authentication information ciphertext to the device;
[0011] Step 3: The device decrypts the received authentication information ciphertext to obtain the authentication information plaintext, and then verifies whether the authentication information plaintext is consistent with the authentication information previously stored in the device. If they are consistent, step 4 is executed; otherwise, it is determined that the client software has no operation authority;
[0012] Step 4: The device randomly generates an access password, sets the access password to the password of the device's debugging user, encrypts the access password to obtain access password ciphertext, and then sends the access password ciphertext to the client software. The device then starts the telnetd service and / or sshd service. The debugging user refers to a user with the required permissions for debugging operations.
[0013] Step 5: The client software decrypts the received access password ciphertext to obtain the access password plaintext, and then uses the access password plaintext as the debugging user to log in to the device through the telnetd service and / or sshd service for debugging;
[0014] Step 6: After the debugging operation is completed, the client software sends a debugging end instruction to the device. After receiving the debugging end instruction, the device shuts down the telnetd service and the sshd service.
[0015] As a further improvement of the embedded terminal device security maintenance and debugging method: the communication connection between the client software and the debugging connection port is an encrypted communication connection.
[0016] As a further improvement of the embedded terminal device security maintenance and debugging method: the port number of the debugging connection port is kept confidential and encapsulated inside the client software.
[0017] As a further improvement of the embedded terminal device security maintenance and debugging method: when the client software is closed, a clearing operation is automatically triggered to render the client software invalid.
[0018] As a further improvement of the embedded terminal device security maintenance and debugging method: the clearing operation refers to modifying or deleting some or all files of the client software so that the client software cannot run again.
[0019] As a further improvement of the embedded terminal device security maintenance and debugging method: when the client software is closed, it automatically sends a debugging end instruction to the device.
[0020] As a further improvement of the embedded terminal device security maintenance and debugging method: when the administrator sends the client software to the debugger, the valid time range is encapsulated inside the client software; when the client software is started, it is first verified whether the current time is within the valid time range. If so, it runs normally, otherwise it cannot run.
[0021] As a further improvement of the embedded terminal device security maintenance and debugging method: the debugging user is a root user;
[0022] In step 4, setting the access password to the password of the debugging user of the device means: encrypting the access password according to the encryption method of the root user password in the device system and updating the access password to the storage area storing the ciphertext of the root user password.
[0023] Compared with the prior art, the present invention has the following positive effects:
[0024] 1. The present invention adopts a multi-layer verification mechanism. Only when the operator has the client software and masters the authentication information provided by the manufacturer, can he pass the authentication and start the telnetd / sshd service of the device. After the debugging is completed, the telnetd and sshd services are automatically closed, and others cannot access or crack them by brute force through loopholes, thereby ensuring that only authorized debuggers can access.
[0025] 2. The debugging user password of the device is randomly generated after authentication. Even if the password is leaked, the original password cannot be used to access the device the next time the telnetd / sshd service is started.
[0026] 3. When the client software is closed, it will automatically trigger a cleanup operation to render the client software invalid, thereby cutting off the client's spread and further improving the security of the device. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a flow chart of interaction between the client software and the embedded device of the present invention. DETAILED DESCRIPTION
[0028] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments.
[0029] like Figure 1 , a method for security maintenance and debugging of embedded terminal equipment, the steps comprising:
[0030] Step 1: When the embedded device is running, the telnetd service and the sshd service are automatically set to the closed state, and a network TCP daemon is started. When the daemon is started, a debugging connection port is opened to wait for the connection of the client software through the debugging connection port.
[0031] Step 2: The debugging personnel perform a network port scan on the PC through the client software. After finding the debugging connection port of the device to be debugged, a communication connection (preferably an encrypted communication connection) is established with the debugging connection port of the device.
[0032] It should be noted that the port number of the debugging connection port is confidential and not disclosed to the public, but is encapsulated inside the client software. The client software interface can only see the IP address of the scanned device, but not the port number of the debugging connection port. The operator only needs to click the IP address of the target device, and the client software will automatically connect according to the internally encapsulated port number.
[0033] Then, the client software encrypts the authentication information corresponding to the device agreed in advance to obtain the authentication information ciphertext, and then sends the authentication information ciphertext to the device.
[0034] The authentication information needs to be obtained from the equipment manufacturer before debugging begins, and then entered into the client software. The encryption method can be the national encryption SM4 or a custom encryption method.
[0035] Step 3: The device decrypts the received authentication information ciphertext to obtain the authentication information plaintext through the corresponding decryption method, and then verifies whether the authentication information plaintext is consistent with the authentication information previously stored in the device. If they are consistent, execute step 4; otherwise, determine that the client software has no operation authority.
[0036] Step 4: Generate a random 8-digit access password in the device, and then set the access password to the debugging user password of the device.
[0037] The debugging user refers to a user with the required permissions for debugging operations. Generally, the root user can be directly used as the debugging user. After the access password is generated, the access password is encrypted according to the encryption method of the root user password in the device system and updated to the storage area storing the root user password ciphertext, so that the new password takes effect.
[0038] After the access password is generated, the access password must be encrypted to obtain the access password ciphertext, and then the access password ciphertext is sent to the client software.
[0039] After authentication is passed, the device will start the telnetd service and / or sshd service as needed.
[0040] Step 5. The client software decrypts the received access password ciphertext to obtain the access password plaintext, and then uses the access password plaintext to log in to the device through the enabled telnetd service and / or sshd service as a debugging user, and then performs related debugging operations.
[0041] It should be noted that the access password will not be displayed in the client software interface.
[0042] Step 6: After the debugging operation is completed, the client software sends a debugging end instruction to the device, and the device closes the telnetd service and the sshd service after receiving the debugging end instruction. Preferably, the debugging end instruction is automatically sent when the client software is closed, rather than manually sent, to ensure that the device closes the telnetd service and the sshd service in time to prevent others from accessing or attacking again.
[0043] Furthermore, when the client software is closed, a clearing operation will be automatically triggered to invalidate the client software, thereby reducing the spread of the client software. In this embodiment, the clearing operation refers to modifying or deleting some or all files of the client software so that the client software cannot be run again. The clearing operation may also be other mechanisms for modifying, destroying or starting verification of the client software.
[0044] As an optional implementation, when the administrator sends the client software to the debugger, the valid time range can be encapsulated in the client software. When the client software is started, it first verifies whether the current time is within the valid time range. If it is within the valid time range, it runs normally, otherwise it cannot run, which can also reduce the spread of client software.
[0045] Since the telnetd service and sshd service are closed, if others want to access the device, they must obtain the client software and authentication information at the same time, and can proceed further after passing the authentication. The client software and authentication information are not public. Only when the device has a problem will the manufacturer send the client software and authentication information to the debugger. In addition, the client software will become invalid after running once, so only debuggers authorized by the manufacturer can access the device.
[0046] At the same time, the root password in the device will be randomly updated after each authentication. Even if others obtain it through cracking, they will not be able to access it after debugging because the telnetd service and sshd service are shut down again. When the telnetd service and sshd service are started again, the new password has replaced the original leaked password, and the original password cannot be used for normal access.
[0047] It should be noted that it is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. The scope of the present invention is defined by the claims rather than the above description.
Claims
1. A method for security maintenance and debugging of embedded terminal equipment, characterized in that the steps include: Step 1: When the device is running, the telnetd service and sshd service are automatically set to closed state, and the debugging connection port is opened; Step 2: The debugging personnel establish a communication connection with the debugging connection port of the device through the client software on the PC side. Then the client software encrypts the authentication information corresponding to the device agreed in advance to obtain the authentication information ciphertext, and then sends the authentication information ciphertext to the device; Step 3: The device decrypts the received authentication information ciphertext to obtain the authentication information plaintext, and then verifies whether the authentication information plaintext is consistent with the authentication information previously stored in the device. If they are consistent, step 4 is executed; otherwise, it is determined that the client software has no operation authority; Step 4: The device randomly generates an access password, sets the access password to the password of the device's debugging user, encrypts the access password to obtain access password ciphertext, and then sends the access password ciphertext to the client software. The device then starts the telnetd service and / or sshd service. The debugging user refers to a user with the required permissions for debugging operations. Step 5: The client software decrypts the received access password ciphertext to obtain the access password plaintext, and then uses the access password plaintext as the debugging user to log in to the device through the telnetd service and / or sshd service for debugging; Step 6: After the debugging operation is completed, the client software sends a debugging end instruction to the device. After receiving the debugging end instruction, the device shuts down the telnetd service and the sshd service.
2. The method for secure maintenance and debugging of an embedded terminal device according to claim 1, characterized in that: The communication connection between the client software and the debugging connection port is an encrypted communication connection.
3. The method for secure maintenance and debugging of an embedded terminal device according to claim 1, characterized in that: The port number of the debugging connection port is kept confidential and encapsulated inside the client software.
4. The method for secure maintenance and debugging of an embedded terminal device according to claim 1, characterized in that: When the client software is closed, a clearing operation is automatically triggered to render the client software invalid.
5. The method for secure maintenance and debugging of an embedded terminal device according to claim 4, characterized in that: The clearing operation refers to modifying or deleting some or all files of the client software so that the client software cannot run again.
6. The method for secure maintenance and debugging of an embedded terminal device according to claim 1, characterized in that: When the client software is closed, it automatically sends a debugging end instruction to the device.
7. The method for secure maintenance and debugging of an embedded terminal device according to claim 1, characterized in that: When the administrator sends the client software to the debugger, the effective time range is encapsulated in the client software; When the client software is started, it first verifies whether the current time is within the valid time range. If so, it runs normally, otherwise it cannot run.
8. The method for secure maintenance and debugging of an embedded terminal device according to any one of claims 1 to 7, characterized in that: The debugging user is the root user; In step 4, setting the access password to the password of the debugging user of the device means: encrypting the access password according to the encryption method of the root user password in the device system and updating the access password to the storage area storing the ciphertext of the root user password.
Citation Information
Patent Citations
Safety login method based on domestic cryptographic algorithm
CN105162808A
Method for starting equipment remote service, server and storage medium
CN111131287A