Hotspot control method and system, program product, equipment and storage medium
By detecting and responding to attacks in Wi-Fi devices, enabling the protected management frame function, and re-establishing the connection using a more advanced encryption protocol, the problem of WPA2 protocol security vulnerability is solved and the security of Wi-Fi network is improved.
Patent Information
- Application Number
- CN202410494363.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-04-23
AI Technical Summary
There are security vulnerabilities in the WPA2 protocol. Attackers can easily invade Wi-Fi networks by canceling authentication attacks and other methods, resulting in insufficient network security.
After receiving the associated uninstallation frame, the electronic device determines whether it is attacked and enables the protected management frame function when an attack is detected. Re-establishing a wireless connection through more advanced encryption protocols such as WPA2/WPA3 to ensure the encrypted transmission of the managed frame , prevent attacks.
On the premise of ensuring network compatibility, the security of Wi-Fi network is improved, deauthentication attacks and other management frame attacks are prevented, and the network's protection capabilities are enhanced.
Smart Images

Figure CN119255231A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a hotspot control method, system, program product, device and storage medium. Background Art
[0002] The WPA (Wi-Fi Protected Access) protocol is a Wi-Fi network security protocol. WPA2 is the second-generation Wi-Fi encryption protocol (or encryption mode) that can prevent wireless access points and terminal station devices from being hacked. It is a widely used security protection mechanism in the process of network communication.
[0003] Currently, the security protocol supported or used by most Wi-Fi devices is WPA2. However, WPA2 has multiple vulnerabilities. With these vulnerabilities, attackers can easily implement deauthentication attacks or other attacks, which means that WPA2 has security issues. Summary of the invention
[0004] Various aspects of the present application provide a hotspot control method, system, program product, device and storage medium to improve the security of Wi-Fi networks while ensuring networking compatibility.
[0005] In a first aspect, a hotspot control method is provided, which is applied to an electronic device for providing a Wi-Fi hotspot; the method comprises:
[0006] receiving a disassociation frame; when the electronic device receives the disassociation frame, the protected management frame function of the electronic device is not enabled, and a wireless connection is established between the Wi-Fi hotspot and the terminal device; the disassociation frame is a management frame for disconnecting the wireless connection;
[0007] After receiving the disassociation frame, determining whether the electronic device is under attack;
[0008] When it is determined that the electronic device is under attack, enabling a protected management frame function of the electronic device and notifying the terminal device that the protected management frame function of the electronic device has been enabled;
[0009] After the electronic device turns on the protected management frame function, the Wi-Fi hotspot establishes a target wireless connection with the terminal device;
[0010] Wherein, the management frame transmitted on the target wireless connection is in an encrypted state.
[0011] In the embodiment of the present application, when the electronic device is not attacked by a management frame (such as a deauthentication attack), the protected management frame function of the electronic device is in a disabled state, which can improve compatibility, that is, to ensure that devices that are not compatible with the protected management frame function can also connect to the Wi-Fi hotspot provided by the electronic device; the electronic device will only start the protected management frame function when a management frame attack is detected to improve the security of the Wi-Fi network. It can be seen that the technical solution provided by the embodiment of the present application can improve the security of the Wi-Fi network while ensuring the compatibility of the network.
[0012] In an implementation manner provided by the first aspect, when it is determined that the electronic device is under attack, enabling a protected management frame function of the electronic device and notifying the terminal device that the electronic device has enabled the protected management frame function, includes:
[0013] When it is determined that the electronic device is under attack, enabling a protected management frame function of the electronic device;
[0014] After the protected management frame function of the electronic device is enabled, a beacon frame is broadcasted;
[0015] The beacon frame carries field information of a first field; the field information of the first field is used to indicate that the electronic device has enabled a protected management frame function.
[0016] Exemplarily, the protected management frame PMF field of the electronic device can be directly set to 1, so that the protected management frame function can be dynamically enabled without restarting the hotspot.
[0017] That is to say, when the electronic device identifies an attack, it turns on the protected management frame function and prompts the terminal device to use the protected management frame function by broadcasting a beacon frame. In this way, after the terminal device re-establishes a connection with the Wi-Fi hotspot provided by the electronic device, the security of the Wi-Fi network is improved by encrypting the management frames to be transmitted.
[0018] In an implementation manner provided by the first aspect, when it is determined that the electronic device is under attack, enabling a protected management frame function includes:
[0019] When it is determined that the electronic device is under attack, the Wi-Fi encryption protocol currently used by the electronic device is set to Wi-Fi encryption protocol WPA2 / WPA3 or Wi-Fi encryption protocol WPA3 and the Wi-Fi hotspot is restarted to enable the protected management frame function of the electronic device.
[0020] In an embodiment of the present application, the protected management frame function can be enabled by setting the Wi-Fi encryption protocol currently used by the electronic device to WPA2 / WPA3 or WPA3 that can support the protected management frame function and restarting the Wi-Fi hotspot.
[0021] Optionally, when the Wi-Fi encryption protocol currently used by the electronic device is set to the Wi-Fi encryption protocol WPA3, the beacon frame also carries field information of a second field; the field information of the second field is used to indicate that the other end is required to use a protected management frame function.
[0022] In an implementation manner provided by the first aspect, after receiving the association release frame, determining whether the electronic device is under attack includes:
[0023] After receiving the disassociation frame, it is determined whether the electronic device is under attack based on whether the number of disassociation frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold.
[0024] That is, attack behavior is identified based on the frequency of receiving the disassociation frame.
[0025] In an implementation manner provided by the first aspect, the duration of the first preset time period is a set duration; and the starting time of the first preset time period is the reception time of the association release frame.
[0026] The set duration can be set according to actual needs, and the embodiment of the present application does not make any specific limitation on this.
[0027] Exemplarily, the first preset time period includes the starting time.
[0028] In an implementation manner provided by the first aspect, after receiving the association release frame, determining whether the electronic device is under attack based on whether the number of association release frames received by the electronic device within a preset time period is greater than or equal to a preset number threshold includes:
[0029] After receiving the association release frame, when the number of association release frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold, it is determined that the electronic device is under attack.
[0030] That is, when the electronic device frequently receives the disassociation frames, it is determined that the electronic device is under attack.
[0031] In an implementation manner provided in the first aspect, after receiving the association release frame, determining whether the electronic device is under attack based on whether the number of association release frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold includes:
[0032] After receiving the association release frame, when the number of association release frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold, and the difference between the received signal strength indication of the association establishment frame and the received signal strength indication of the association release frame is not within a first preset range, it is determined that the electronic device is under attack;
[0033] The association establishment frame is received by the electronic device before or after receiving the association release frame; the association establishment frame is a management frame used to establish a wireless connection between the terminal device and the Wi-Fi hotspot.
[0034] That is, when the electronic device frequently receives the disassociation frame and the difference between the received signal strength indication of the received association establishment frame and the received signal strength indication of the received disassociation frame is large, it is determined that the electronic device is under attack.
[0035] In an implementation manner provided in the first aspect, after receiving the association release frame, determining whether the electronic device is under attack based on whether the number of association release frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold includes:
[0036] After receiving the disassociation frame, when the number of disassociation frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold, and the frame sequence number of a management frame received later among multiple management frames received by the electronic device is less than or equal to the frame sequence number of a management frame received earlier, it is determined that the electronic device is under attack.
[0037] That is, when the electronic device frequently receives disassociation frames and the frame sequence number of the management frame received later is less than or equal to the frame sequence number of the management frame received earlier, it is determined that the electronic device is under attack.
[0038] In an implementation manner provided in the first aspect, after receiving the association release frame, determining whether the electronic device is under attack based on whether the number of association release frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold includes:
[0039] After receiving the disassociation frame, when the number of disassociation frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold, and the difference between the frame sequence numbers of two adjacent management frames received by the electronic device is not within a second preset range, it is determined that the electronic device is under attack.
[0040] That is, when the electronic device frequently receives the disassociation frames and there is a large difference between the frame sequence numbers of two adjacent received management frames, it is determined that the electronic device is under attack.
[0041] In an implementation manner provided by the first aspect, after receiving the association release frame, determining whether the electronic device is under attack includes:
[0042] After receiving the disassociation frame, obtaining source device information carried in the disassociation frame;
[0043] Determining whether the source device information matches the device information of the terminal device; the device information of the terminal device is acquired by the electronic device in the process of establishing the wireless connection with the terminal device;
[0044] When the source device information does not match the device information of the terminal device, it is determined that the electronic device is attacked.
[0045] The source device information refers to the device information of the source device, such as an organization unique identifier.
[0046] That is, when the source device information carried in the disassociation frame is different from the source device information previously acquired during the interaction process of establishing the wireless connection, it is determined that the electronic device is under attack.
[0047] In an implementation manner provided by the first aspect, after receiving the association release frame, determining whether the electronic device is under attack includes:
[0048] After receiving the disassociation frame, obtaining the source address carried in the disassociation frame;
[0049] When the source address is the network address of the electronic device, it is determined that the electronic device is under attack.
[0050] In the embodiment of the present application, the electronic device can receive a disassociation frame whose source address is its own network address, indicating that there is a third-party device that pretends to be itself and sends a disassociation frame to the terminal device. Therefore, it can be directly determined that the terminal device connected to itself is attacked. After receiving the disassociation frame, the terminal device will disconnect from the electronic device, which is equivalent to the electronic device being attacked.
[0051] In one implementation manner provided in the first aspect, the method further includes:
[0052] After the Wi-Fi hotspot establishes a target wireless connection with the terminal device, when an unencrypted association release frame is received, the unencrypted association release frame is ignored.
[0053] Since the Wi-Fi hotspot and the terminal device have established the above-mentioned target wireless connection based on the protected management frame, the management frame sent by the terminal device must be encrypted. Therefore, when the electronic device receives the unencrypted association release frame, it can be determined that the association release frame is sent by the attacking device, and therefore, it is ignored, that is, the disconnection operation is not performed, thereby improving the security of the Wi-Fi network.
[0054] In a second aspect, a hotspot control system is provided, comprising: an electronic device for providing a Wi-Fi hotspot and a terminal device to be connected to the Wi-Fi hotspot; wherein:
[0055] The electronic device is used to implement any of the above methods.
[0056] In a second aspect, a computer program product is provided, including a computer program. When the computer program is executed by an electronic device that provides a Wi-Fi hotspot, any of the above methods is implemented.
[0057] In a second aspect, an electronic device is provided, comprising: a memory, a processor, and a display screen, wherein:
[0058] The memory is used to store programs;
[0059] The processor is coupled to the memory and the display screen, and is used to execute the program stored in the memory to implement any of the above methods.
[0060] In a second aspect, a computer-readable storage medium storing a computer program is provided, and when the computer program is executed by a computer, any of the methods described above can be implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] 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:
[0062] Figure 1 A schematic diagram of the internal framework of an electronic device provided by an exemplary embodiment of the present application;
[0063] Figure 2 A schematic diagram of a software and hardware layered architecture provided for an exemplary embodiment of the present application;
[0064] Figure 3 An interactive signaling diagram for connecting a terminal station device to a wireless access point provided by an exemplary embodiment of the present application;
[0065] Figure 4An interactive signaling diagram of a deauthentication attack provided by an exemplary embodiment of the present application;
[0066] Figure 5 Interactive signaling of a hotspot control method provided by an exemplary embodiment of the present application Figure 1 ;
[0067] Figure 6 Interactive signaling of a hotspot control method provided by another exemplary embodiment of the present application Figure 2 . DETAILED DESCRIPTION
[0068] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0069] In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.
[0070] The words "if" or "when" as used herein may be construed as "at" or "when" or "in response to" depending on the context.
[0071] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0072] First, the vocabulary involved in the embodiments of the present application is explained. It can be understood that this explanation is for a clearer understanding of the embodiments of the present application, and does not necessarily constitute a limitation on the embodiments of the present application.
[0073] AP: is the abbreviation of Access Point, which is a wireless access point. It is the central node of a wireless network and can be regarded as a server. As a central node of a network, it provides wireless access services. Other wireless devices are allowed to access this node. All wireless signal data of devices accessing this node must pass through it to exchange and access each other. General wireless routers, gateways, and hotspots work in AP mode, and AP nodes are allowed to connect to each other.
[0074] Soft AP: Soft-AP, its hardware part is a standard wireless network card, but it provides the same signal switching, routing and other functions as AP through the driver. Exemplarily, the AP in the following embodiments of this application can be a soft AP.
[0075] STA: It is the abbreviation of Station. It is a terminal station device in a wireless network and can be regarded as a client. Generally speaking, a device in STA mode does not accept wireless access itself. The device connects to the AP node for network access. Communication between devices in STA mode can be forwarded through AP.
[0076] PMF: It is the abbreviation of Protected Management Frames. PMF is a technology used to improve the security of Wi-Fi networks, especially for the protection of management frames. PMF introduces encryption and integrity protection in management frames to prevent some possible attacks, such as replay attacks and tampering attacks.
[0077] WPA3 (Wi-Fi Protected Access 3) is the third generation of Wi-Fi encryption protocol or encryption mode, and is the successor to WPA2 technology. It should be noted that WPA3 requires the use of PMF.
[0078] WPA2 / WPA3, that is, the mixed encryption mode of WPA2 and WPA3, can support both WPA2 and WPA3 encryption methods at the same time.
[0079] An embodiment of the present application provides a hotspot control method, which is applied to an electronic device that can provide a Wi-Fi hotspot (hereinafter referred to as a hotspot). Exemplarily, the electronic device provides a hotspot by converting a wired signal into a wireless signal (e.g., a Wi-Fi signal). Exemplarily, the electronic device provides a hotspot by converting a received mobile network signal (e.g., 3G, 4G, 5G, etc.) into a wireless signal (e.g., a Wi-Fi signal). It should be noted that an electronic device that can provide a hotspot may be referred to as an AP, and an electronic device that accesses the network by connecting to an AP (or a device that accesses the network by connecting to a hotspot provided by an AP) is referred to as a STA.
[0080] The electronic device that can provide a hotspot can be a wireless router, a mobile phone, a tablet computer, an augmented reality (AR) device, a virtual reality (VR) device, a car computer, a wearable device, a smart home device, or any other device that can provide a Wi-Fi hotspot. The embodiments of the present application do not specifically limit the specific form of the electronic device.
[0081] Figure 1 A schematic structural diagram of an electronic device 100 is shown.
[0082] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0083] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0084] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor, a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0085] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0086] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0087] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0088] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0089] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0090] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0091] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0092] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0093] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and the terminal device through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0094] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0095] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0096] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0097] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0098] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0099] The software and hardware system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.
[0100] Figure 2 It is a block diagram of the software and hardware structure of the electronic device 100 according to an embodiment of the present invention.
[0101] The layered architecture divides the software and hardware into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the kernel layer, and the hardware layer. It should be noted that the software and hardware system may include more or fewer layers, and the embodiments of the present application do not specifically limit this.
[0102] The application layer can include a series of application packages.
[0103] like Figure 2 As shown, the application package may include: an application package for setting applications. In addition, the application package may also include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0104] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0105] like Figure 2 As shown, the application framework layer may include a hotspot framework (or hotspot management service). In addition, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
[0106] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0107] The kernel layer is the layer between the hardware layer and the application framework layer. Figure 2 As shown, the kernel layer includes a hotspot driver. In addition, the kernel layer may also include a display driver, a camera driver, an audio driver, a sensor driver, and the like.
[0108] like Figure 2 As shown, the hardware layer may include: hotspot firmware. The hotspot firmware is located in the Wi-Fi chip. In addition, the hardware layer may also include: cellular network card, camera, display screen, sensor, etc.
[0109] The following will be combined Figure 3The interactive process of STA connecting to AP under WAP2 security protocol is introduced. AP is the electronic device mentioned above, and STA is the terminal device mentioned above.
[0110] 301. AP periodically broadcasts beacon frames.
[0111] Beacon frames are frames that APs send periodically, that is, they send out a beacon frame to the outside world every once in a while to announce the existence of their Wi-Fi (802.11) network. Beacon frames contain basic information about the AP, such as the AP's SSID (Service Set Identifier), management frame protection (MFPC) field, management frame protection required (MFPR) field, channel, frequency, signal strength, country code, and other information.
[0112] Among them, SSID is the name used to uniquely identify the wireless LAN, which allows users to find and connect to the required network in the wireless LAN.
[0113] The Support Management Frame Protection field is used to indicate whether the AP supports PMF (that is, whether the AP has PMF enabled). If it is set to true or 1, it means that the AP supports PMF. If it is set to false or 0, it means that the AP does not support PMF. The Require Management Frame Protection field is used to indicate whether the peer must use PMF. If it is set to true or 1, it means that the peer must use PMF to connect. If it is set to false or 0, it means that the peer is not forced to use PMF.
[0114] For example, when the Wi-Fi encryption protocol currently used by the AP is WPA2, the supported management frame protection field is 0, and the required management frame protection field is 0. When the Wi-Fi encryption protocol currently used by the AP is WPA2 / WPA3, the supported management frame protection field is 1, and the required management frame protection field is 0. When the Wi-Fi encryption protocol currently used by the AP is WPA3, the supported management frame protection field is 1, and the required management frame protection field is 1.
[0115] In this embodiment, the Wi-Fi encryption protocol adopted by the AP is WPA2, so the supported management frame protection field and the required management frame protection field carried in the beacon frame are 0.
[0116] After the STA passively receives the beacon frame, it does not need to execute the following steps 302 and 303, and can directly execute step 304.
[0117] 302. STA broadcasts a probe request frame.
[0118] STA broadcasts a probe request frame to detect surrounding wireless networks.
[0119] After the AP receives the probe request frame, step 303 is executed.
[0120] 303. The AP sends a probe response frame to the STA.
[0121] The probe response frame may include basic information of the AP.
[0122] After receiving the probe response frame, the STA may execute the following step 304 .
[0123] 304. The STA sends an authentication request frame to the AP.
[0124] After receiving the authentication request frame, the AP authenticates the STA. If the authentication is successful, the process goes to step 305; otherwise, the process ends. The purpose of sending the authentication request is to allow the STA and the AP to authenticate each other whether the other party is an 802.11 device and for the AP to perform link authentication on the STA to confirm its legitimacy.
[0125] 305. The AP sends an Authentication Response frame to the STA.
[0126] After receiving the authentication response message, the STA executes step 303 .
[0127] 306. The STA sends an Association Request frame to the AP.
[0128] It should be noted that association is always initiated by the STA. In fact, the association process is the negotiation process for establishing a wireless connection between the STA and the AP. After the AP receives the association request message from the STA, step 304 is executed.
[0129] 307. The AP sends an Association Response frame to the STA.
[0130] When the STA receives the association response frame, it indicates that a wireless connection has been established between the STA and the AP (ie, the connection is successful).
[0131] 308. The AP and the STA generate a key for encrypting wireless data (ie, data to be transmitted, or data frame) through a four-way handshake (ie, four information exchanges).
[0132] The specific implementation process of the four-way handshake can be found in the prior art and will not be described in detail here.
[0133] In the WiFi protocol, there are three types of frames: management frames, control frames, and data frames. The frame type consists of a type field and a subtype field. The type field is used to indicate which of the three types the frame belongs to. Taking the management frame as an example, it includes but is not limited to the following subtypes of frames: authentication request frame, authentication response frame, association request frame, association response frame, deauthentication frame, and deassociation frame. The main function of the management frame is to be responsible for the access and exit functions of STA in the wireless network.
[0134] Management frames may include, but are not limited to: frame type, source address, destination address, frame sequence number (hereinafter referred to as Seq) and OUI (Organizationally Unique Identifier). When APs and STAs receive any management frame, they will also detect / measure the received signal strength indicator (RSSI) of the received management frame.
[0135] Exemplarily, in a management frame sent from a STA to an AP, the source address is the network address of the STA, and the destination address is the network address of the AP. In a management frame sent from an AP to a STA, the source address is the network address of the AP, and the destination address is the network address of the STA. Specifically, the network address may be a MAC (Media Access Control) address.
[0136] The sequence number of a frame is used to indicate the count of transmitted frames and to filter duplicate frames. If it is a retransmitted frame, the Seq of the frame remains unchanged, that is, the Seq of the retransmitted frame is still the Seq of the original frame. For example, if frame A needs to be retransmitted, the Seq of the retransmitted frame of frame A is still the sequence number of frame A. Each time a STA sends a frame, the Seq of the frame increases by 1. It should be added that management frames and data frames are counted separately. That is, the Seq of a management frame is used to indicate the count of transmitted management frames, and the Seq of a data frame is used to indicate the count of transmitted data frames.
[0137] It should be noted that the wireless connection between the AP and the STA in each embodiment of the present application is also the wireless connection between the Wi-Fi hotspot provided by the AP and the STA.
[0138] In actual applications, after the AP and STA complete the above authentication or establish a wireless connection, the AP or STA may face a deauthentication attack, also known as a Deauth attack. A deauthentication attack is a denial of service attack against a wireless local area network. This attack disconnects the target device from the wireless network by sending forged deauthentication frames (De-authentication, abbreviated as De-auth) and disassociation frames (Disassociation, abbreviated as Disassoc) to the target device (AP or STA). Among them, deauthentication frames and disassociation frames are both called disassociation frames. Optionally, the disassociation frame mentioned in the embodiment of the present application is a unicast management frame. An attacker exploits the vulnerability that the WiFi management frame is not encrypted and can forge a management frame, thereby sending a deauthentication frame to forcibly cut off the connection between the AP and the STA. This attack does not require cracking the network password, but only requires obtaining the network addresses of the AP and the STA to implement.
[0139] The following will be combined Figure 3 This section describes the process of being attacked by a third-party device (the attacker's device) after the AP and STA establish a wireless connection:
[0140] 309. The AP receives a disassociation frame sent by the third-party device.
[0141] When a third-party device pretends to be a STA and sends a disassociation frame to the AP, the source address in the disassociation frame is forged as the network address of the STA, and the destination address is forged as the network address of the AP.
[0142] When a third-party device pretends to be an AP and sends a disassociation frame to a STA, the source address in the disassociation frame is forged as the network address of the AP, and the destination address is forged as the network address of the STA.
[0143] The sequence number and OUI of the frame in the disassociation frame are both forged.
[0144] It should be noted that the disassociation frames in the above two cases will be received by the AP and the STA.
[0145] 310. After receiving the disassociation frame, the AP disassociates from the STA.
[0146] When the AP receives a disassociation frame whose source address is the network address of the STA and whose destination address is the network address of the AP, the AP disassociates from the STA, that is, disconnects the wireless connection between the AP and the STA.
[0147] Disassociating the AP from the STA may specifically include: the AP deletes the STA from the locally maintained association list and / or clears (or resets) the locally maintained state machine of the STA. Among them, the association list records at least one STA to which the AP is currently associated. The STA's state machine is used to record the current state of the STA (for example, authenticated state, associated state, etc.). It should be noted that when the AP receives the above-mentioned association release frame after establishing a wireless connection with the STA, the STA is deleted from the locally maintained association list and the locally maintained state machine of the STA needs to be cleared. When the AP receives the above-mentioned association release frame after completing authentication with the STA and before establishing a wireless connection, it only needs to clear the locally maintained state machine of the STA.
[0148] It should be noted that when the AP receives a disassociation frame with the source address being the AP's network address and the destination address being the STA's network address, it will ignore it, that is, it will not actively disassociate with the STA. It should be additionally noted that the AP can receive a disassociation frame with the source address being the AP's network address and the destination address being the STA's network address, which means that the STA will also receive a disassociation frame with the source address being the AP's network address and the destination address being the STA's network address. After receiving the disassociation frame, the STA will disassociate with the AP, that is, disconnect the wireless connection with the AP.
[0149] 311. The STA receives a disassociation frame sent by a third-party device.
[0150] 312. After receiving the disassociation frame, the STA disassociates from the AP.
[0151] Disassociating from an AP means disconnecting the wireless connection with the AP.
[0152] When the STA receives a disassociation frame with the source address being the network address of the AP and the destination address being the network address of the STA, it disconnects the wireless connection with the AP. The specific operation of the STA disassociating from the AP can refer to the above-mentioned content related to the AP disassociating from the STA, which will not be described in detail here.
[0153] Generally speaking, third-party devices frequently send disassociation frames to APs and STAs, such as Figure 4 shown.
[0154] The following will be combined Figure 5 This chapter introduces the control methods of hot spots. Figure 5 As shown, the AP includes: a hotspot framework, a hotspot driver, and a hotspot firmware. Exemplarily, the hotspot firmware is located in the Wi-Fi chip of the AP.
[0155] 501. The hotspot firmware establishes a wireless connection with the STA.
[0156] The process of establishing a wireless connection between the hotspot firmware and the STA is also the process of establishing a wireless connection between the AP and the STA. For details, please refer to the corresponding contents in the above embodiments, which will not be repeated here. It should be noted that the hotspot driver will also participate in the process of establishing a wireless connection.
[0157] 502. The hotspot firmware receives a disassociation frame sent by a third-party device.
[0158] 503. Abnormal behavior detection.
[0159] When the hotspot firmware determines that the source address in the received disassociation frame is the network address of the AP, it can be determined that abnormal behavior (ie, attack behavior) currently exists.
[0160] The hotspot firmware can receive the disassociation frame whose source address is its own network address because the third-party device pretends to be an AP and sends the disassociation frame to the STA. When the third-party device pretends to be an AP and sends the disassociation frame to the STA, the disassociation frame will be received not only by the STA but also by the AP. When the AP receives the disassociation frame whose source address is its own network address, it means that the STA that has established a wireless connection with the AP is being attacked by a third-party device. Therefore, it can be determined that there is abnormal behavior at present.
[0161] It should be noted that after receiving the disassociation frame with its own network address as the source address, the hotspot firmware will not actively disassociate with the STA. However, after receiving the disassociation frame, the STA will actively disassociate with the STA.
[0162] When the hotspot firmware determines that the source address in the received disassociation frame is the network address of the STA, the following steps S11 and S12 may be performed simultaneously or successively.
[0163] S11. The hotspot firmware disassociates from the STA.
[0164] When the hotspot firmware terminates the association with the STA, it can also notify the hotspot driver to terminate the association with the STA. The specific operations of the hotspot driver terminating the association with the STA and the hotspot firmware terminating the association with the STA can refer to the relevant content of the AP terminating the association with the STA in the above embodiments. It should be noted that the hotspot firmware and the hotspot driver respectively maintain the above-mentioned association list and the state machine of the STA.
[0165] S12. The hotspot firmware determines whether the OUI in the disassociation frame matches the OUI of the STA.
[0166] If the hotspot firmware determines that the OUI in the disassociation frame does not match the OUI of the STA, it means that the disassociation frame is not sent by the STA but by a third-party device, and it is determined that there is abnormal behavior. The OUI of the STA is obtained by the AP through interaction during the process of establishing the above wireless connection with the STA.
[0167] If the hotspot firmware determines that the OUI in the disassociation frame matches the OUI of the STA, the following step S13 may be continued.
[0168] S13: Determine whether the number of disassociation frames received by the AP within a set time (ie, a first preset time period) is greater than or equal to a preset number threshold.
[0169] The duration of the first preset time period is the set duration; the starting time of the first preset time period is the receiving time of the association release frame.
[0170] If the preset number threshold is not exceeded, it is determined that there is no abnormal behavior at present.
[0171] If the preset number threshold is exceeded, the following steps S14, S15 and S16 are continued to be executed.
[0172] S14: Determine whether a difference between the received signal strength indicator of the association establishment frame and the received signal strength indicator of the association release frame is within a first preset range.
[0173] The association establishment frame may include: an authentication request frame and an association request frame; the association establishment frame is received by the AP before or after receiving the association release frame. It should be noted that after the AP is disconnected from the STA, since the STA is forced to disconnect, the STA will continue to send association establishment frames to the AP to request to establish a wireless connection between the AP and the STA.
[0174] In actual applications, the distance between the AP and the STA is relatively stable, so the received signal strength indication of each frame sent by the STA received by the AP is stable within a certain interval. When the difference between the received signal strength indication of the association release frame and the received signal strength indication of the association establishment frame is not within the first preset range, it can be determined that the association release frame is sent by a third-party device, that is, there is abnormal behavior.
[0175] S15. Determine whether, among the multiple management frames received by the AP, there is a management frame whose frame sequence number is less than or equal to the frame sequence number of the management frame received earlier.
[0176] Exemplarily, the multiple management frames may be received by the AP within a second preset time period. The second preset time period may include: the first preset time period. Exemplarily, the second preset time period includes: the first preset time period and a third preset time period located before the first preset time period.
[0177] When the frame sequence number of the management frame received later is less than or equal to the frame sequence number of the management frame received earlier, it can be determined that the disassociation frame is sent by the third-party device, that is, abnormal behavior exists.
[0178] S16: Determine whether, among the multiple management frames received by the AP, there are any management frames whose difference between frame sequence numbers of two adjacent management frames received is not within a second preset range.
[0179] When the difference between the frame sequence numbers of two consecutively received management frames is not within the second preset range, it can be determined that the disassociation frame is sent by a third-party device, that is, abnormal behavior exists.
[0180] In actual applications, if multiple management frames are sent by STA, then the Seq sequence of multiple management frames should follow the following rule: the latter Seq of any two adjacent Seqs in the Seq sequence is greater than the former Seq and the difference between any two adjacent Seqs is within the second preset range. When the latter Seq of two adjacent Seqs in the Seq sequence is less than or equal to the former Seq, or the difference between two adjacent Seqs in the Seq sequence is not within the second preset range, it can be determined that the disassociation frame is sent by a third-party device, that is, there is abnormal behavior. Among them, the Seq sequence is obtained by sorting the Seqs of multiple management frames according to the order of frame reception. In the Seq sequence, the Seq of the frame received first is before the Seq of the frame received later.
[0181] The first preset range may be less than or equal to the first preset value. The size of the first preset value may be set according to actual needs, and the embodiment of the present application does not specifically limit this. The second preset range may be greater than or equal to the first negative number and less than or equal to the second positive number.
[0182] Exemplarily, when the difference between the received signal strength indication of the association establishment frame and the received signal strength indication of the association release frame among the multiple management frames received by the AP is within the first preset range, there is no frame sequence number of the later received management frame among the multiple management frames received by the AP that is less than or equal to the frame sequence number of the first received management frame, and there is no difference between the frame sequence numbers of two adjacent management frames received by the AP that is not within the second preset range, it is determined that there is no abnormal behavior at present.
[0183] After the hotspot firmware detects abnormal behavior, step 504 is executed.
[0184] 504. The hotspot firmware notifies the hotspot driver of an exception.
[0185] 505. The hotspot driver enables PMF.
[0186] That is, the hotspot driver turns on the PMF function.
[0187] Exemplarily, the hotspot driver sets the PMF field to 1.
[0188] 506. The hotspot driver notifies the hotspot firmware to set MFPC to 1.
[0189] 507. The hotspot firmware broadcasts a beacon frame.
[0190] It should be noted that in step 507, the MFPC (ie, the first field mentioned above) in the beacon frame broadcast by the hotspot firmware is 1, and the MFPR (ie, the second field mentioned above) is 0.
[0191] In addition, after the above step 506, when the hotspot firmware receives a probe request frame sent by the STA, the hotspot firmware returns a probe response frame in which MFPC is 1 and MFPR is 0 to the STA.
[0192] 508. The hotspot firmware establishes a wireless connection with the STA.
[0193] That is, the hotspot firmware and the STA re-establish a wireless connection. The process of re-establishing a wireless connection can refer to the process of establishing a connection between an AP and a STA under the WPA2 / WPA 3 hybrid encryption protocol in the prior art.
[0194] It should be noted that after the STA receives the beacon frame broadcast by the hotspot firmware or the detection response frame returned by the hotspot firmware, it can be determined that the AP supports / has turned on PMF based on the MFPC being 1 and the MFPR being 0 in the beacon frame or the detection response frame, but the use of PMF is not mandatory; when the STA has the PMF function, the STA and the AP establish a wireless connection based on the WPA3 protocol and perform key negotiation; subsequently, the STA and the AP will encrypt the management frames and data frames to be sent to the other end according to the negotiated keys.
[0195] 509. The third-party device sends a disassociation frame to the hotspot firmware.
[0196] 510. The hotspot firmware determines whether the disassociation frame is encrypted.
[0197] If the judgment result is no, then execute step 511; if the judgment result is yes, then execute step 512.
[0198] The specific method for determining whether the association release frame is encrypted can be selected according to actual needs. In an optional embodiment, whether the association release frame is encrypted can be determined based on the protection flag field in the association release frame. If the protection flag is 1, the association release frame is determined to be encrypted; otherwise, it is determined to be not encrypted.
[0199] 511. Ignore.
[0200] That is, the disconnection operation is not performed.
[0201] 512. The hotspot firmware determines whether the decryption is successful.
[0202] The hotspot firmware uses the negotiated key to decrypt the association release frame; if the decryption fails, it means that the key release frame is sent by a third-party device, and step 511 is executed, that is, it is ignored.
[0203] It should be noted that if the decryption is successful, it means that the association release frame is sent by the STA, and then the operation of releasing the association with the STA is performed.
[0204] It should be added that, in actual applications, it can be determined whether there is abnormal behavior at present by judging whether the source address in the disassociation frame is the network address of the AP, whether the OUI in the disassociation frame matches the OUI of the STA, whether the number of disassociation frames received by the AP within a set time exceeds the set number threshold, whether the difference between the received signal strength indication of the association establishment frame and the received signal strength indication of the association disassociation frame is within the first preset range, whether the frame sequence number of the management frame received later is less than or equal to the frame sequence number of the management frame received earlier among the multiple management frames received by the AP, and whether the difference between the frame sequence numbers of two adjacent management frames received by the AP is not within the second preset range. The multiple items listed here can be used alone for abnormal behavior detection, or two or more items can be combined for abnormal behavior detection, and the embodiments of the present application do not make any specific restrictions on this. When two or more items are combined for abnormal behavior detection, the judgment order of the two or more items can be designed according to actual needs, and the embodiments of the present application do not make any specific restrictions on this.
[0205] The following will be combined Figure 6 This chapter introduces the control methods of hot spots. Figure 6 As shown, the method includes:
[0206] 601. The hotspot firmware establishes a wireless connection with the STA.
[0207] 602. The hotspot firmware receives a disassociation frame sent by a third-party device.
[0208] 603. Abnormal behavior detection.
[0209] After the hotspot firmware detects abnormal behavior, step 604 is executed.
[0210] 604. The hotspot firmware notifies the hotspot driver of an exception.
[0211] 605. The hotspot driver notifies the hotspot framework to set the Wi-Fi encryption protocol to WPA3.
[0212] 606. The hotspot framework sets the Wi-Fi encryption protocol to WPA3.
[0213] 607. Restart the hotspot.
[0214] Specifically, the hotspot framework may first turn off the hotspot and then turn on the hotspot.
[0215] 608. The hotspot framework notifies the hotspot driver that the current Wi-Fi encryption protocol is WPA3.
[0216] 609 . The hotspot driver notifies the hotspot firmware that MFPR is set to 1 and MFPC is set to 1.
[0217] It should be noted that the hotspot driver may also set the PMF field to 1 after step 608 .
[0218] 610. The hotspot firmware broadcasts a beacon frame.
[0219] After step 609, the MFPR is 1 and the MFPC is 1 in the beacon frame broadcast by the hotspot firmware.
[0220] After step 609 , the AP receives the probe request frame sent by the STA and returns a probe response frame to the STA in response to the probe request frame, in which the MFPR is 1 and the MFPC is 1.
[0221] 611. The hotspot firmware establishes a wireless connection with the STA.
[0222] That is, the hotspot firmware and the STA re-establish the wireless connection.
[0223] The process of re-establishing the wireless connection may refer to the process of establishing a connection between an AP and a STA under the WPA 3 encryption protocol in the prior art.
[0224] It should be noted that after the STA receives the beacon frame broadcast by the hotspot firmware or the detection response frame returned by the hotspot firmware, it can be determined that the AP supports / has turned on PMF and forced to use PMF according to the MFPC being 1 and the MFPR being 1 in the beacon frame or the detection response frame; if the STA can support the PMF function, the STA and the AP will establish a wireless connection based on the WPA3 protocol and perform key negotiation; subsequently, the STA and the AP will encrypt the management frames and data frames to be sent to the other end according to the negotiated keys; if the STA cannot support PMF, the STA cannot establish a wireless connection with the AP.
[0225] 612. The third-party device sends a disassociation frame to the hotspot firmware.
[0226] 613. The hotspot firmware determines whether the disassociation frame is encrypted.
[0227] If the judgment result is no, execute step 614; if the judgment result is yes, execute step 615.
[0228] 614. Ignore.
[0229] That is, the disconnection operation is not performed.
[0230] 615. The hotspot firmware determines whether the decryption is successful.
[0231] The hotspot firmware uses the negotiated key to decrypt the association release frame; if the decryption fails, it means that the key release frame is sent by a third-party device, and step 614 is executed, that is, it is ignored.
[0232] It should be noted that if the decryption is successful, it means that the association release frame is sent by the STA, and then the operation of releasing the association with the STA is performed.
[0233] Optionally, in Figure 6In the illustrated embodiment, the hotspot driver may notify the hotspot framework to set the Wi-Fi encryption protocol to WPA2 / WPA3; after the hotspot framework sets the Wi-Fi encryption protocol to WPA2 / WPA3 and restarts the hotspot, it notifies the hotspot driver that the current Wi-Fi encryption protocol is WPA2 / WPA3. In this way, the hotspot driver notifies the hotspot firmware to set MFPR to 0 and MFPC to 1. Subsequently, after the STA receives the beacon frame or the probe response frame sent by the hotspot firmware, it can determine that the Wi-Fi encryption protocol currently adopted by the AP is WPA2 / WPA3 based on the MFPR being 0 and the MFPC being 1 in the beacon frame or the probe response frame, and then decide the access method according to its own situation. For example: when the STA supports WPA3, the STA and the AP establish a wireless connection based on the WPA3 protocol and perform key negotiation; subsequently, the STA and the AP will encrypt the management frames and data frames to be sent to the other end according to the negotiated key. When the STA does not support WPA3, the STA and the AP establish a wireless connection based on the WPA2 protocol. It should be noted that after the STA and AP establish a wireless connection based on the WPA2 protocol, they may still be attacked by a third party because the management frame is not protected.
[0234] For steps not described in detail in the embodiments of the present application, reference can be made to the corresponding contents in the above embodiments and will not be repeated here.
[0235] In the above Figure 5 and Figure 6 In the embodiments, the abnormal behavior detection is performed by the hotspot firmware. Optionally, the abnormal behavior detection behavior can also be performed by the hotspot driver. Exemplarily, after receiving the association release frame, the hotspot firmware sends the association release frame to the hotspot driver, and the hotspot driver performs the above abnormal behavior detection process.
[0236] In each embodiment of the present application, the AP disables PMF by default, which can maximize compatibility (some devices are currently incompatible with PMF, which will cause connection problems). The AP will only enable the PMF function when abnormal behavior is detected to avoid third-party attacks.
[0237] It should be noted that the execution subject of each step executed by the hotspot framework, hotspot driver and hotspot firmware in this article is essentially AP.
[0238] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations appearing in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel, and the sequence numbers of the operations, such as 401, 402, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel.
[0239] An embodiment of the present application also provides an electronic device, including: a memory and a processor, wherein the memory is used to store a program; the processor is coupled to the memory and is used to execute the program stored in the memory to implement the methods in the above embodiments.
[0240] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a computer, can implement one or more steps of the method in any of the above embodiments.
[0241] The computer-readable storage medium may be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0242] Another embodiment of the present application further provides a computer program product including a computer program. When the computer program is executed by a computer, one or more steps in any of the above method embodiments can be implemented.
[0243] Among them, the electronic device, computer-readable storage medium, and computer program product provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0244] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, 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 devices or units, which can be electrical, mechanical or other forms.
[0245] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0246] 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.
[0247] 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 readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially 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, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0248] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A hotspot control method, characterized in that: Applicable to an electronic device for providing a Wi-Fi hotspot; the method comprises: receiving a disassociation frame; when the electronic device receives the disassociation frame, the protected management frame function of the electronic device is not enabled, and a wireless connection is established between the Wi-Fi hotspot and the terminal device; the disassociation frame is a management frame for disconnecting the wireless connection; After receiving the disassociation frame, determining whether the electronic device is under attack; When it is determined that the electronic device is under attack, enabling a protected management frame function of the electronic device and notifying the terminal device that the protected management frame function of the electronic device has been enabled; After the electronic device turns on the protected management frame function, the Wi-Fi hotspot establishes a target wireless connection with the terminal device; Wherein, the management frame transmitted on the target wireless connection is in an encrypted state.
2. The method according to claim 1, characterized in that When it is determined that the electronic device is under attack, enabling the protected management frame function of the electronic device and notifying the terminal device that the protected management frame function of the electronic device has been enabled, including: When it is determined that the electronic device is under attack, enabling a protected management frame function of the electronic device; After the protected management frame function of the electronic device is enabled, a beacon frame is broadcasted; The beacon frame carries field information of a first field; the field information of the first field is used to indicate that the electronic device has enabled a protected management frame function.
3. The method according to claim 2, characterized in that When it is determined that the electronic device is under attack, enabling a protected management frame function of the electronic device includes: When it is determined that the electronic device is under attack, the Wi-Fi encryption protocol currently used by the electronic device is set to Wi-Fi encryption protocol WPA2 / WPA3 or Wi-Fi encryption protocol WPA3 and the Wi-Fi hotspot is restarted to enable the protected management frame function of the electronic device.
4. The method according to claim 1, characterized in that After receiving the disassociation frame, determining whether the electronic device is under attack includes: After receiving the disassociation frame, it is determined whether the electronic device is under attack based on whether the number of disassociation frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold.
5. The method according to claim 4, characterized in that The duration of the first preset time period is the set duration; the starting time of the first preset time period is the receiving time of the association release frame.
6. The method according to claim 4, characterized in that After receiving the association release frame, determining whether the electronic device is under attack based on whether the number of association release frames received by the electronic device within a preset time period is greater than or equal to a preset number threshold includes: After receiving the disassociation frame, when the number of disassociation frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold, it is determined that the electronic device is under attack.
7. The method according to claim 4, characterized in that After receiving the disassociation frame, determining whether the electronic device is under attack based on whether the number of disassociation frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold includes: After receiving the association release frame, when the number of association release frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold, and the difference between the received signal strength indication of the association establishment frame and the received signal strength indication of the association release frame is not within a first preset range, it is determined that the electronic device is under attack; The association establishment frame is received by the electronic device before or after receiving the association release frame; the association establishment frame is a management frame used to establish a wireless connection between the terminal device and the Wi-Fi hotspot.
8. The method according to claim 4, characterized in that After receiving the disassociation frame, determining whether the electronic device is under attack based on whether the number of disassociation frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold includes: After receiving the disassociation frame, when the number of disassociation frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold, and the frame sequence number of a management frame received later among multiple management frames received by the electronic device is less than or equal to the frame sequence number of a management frame received earlier, it is determined that the electronic device is under attack.
9. The method according to claim 4, characterized in that After receiving the disassociation frame, determining whether the electronic device is under attack based on whether the number of disassociation frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold includes: After receiving the disassociation frame, when the number of disassociation frames received by the electronic device within a first preset time period is greater than or equal to a preset number threshold, and the difference between the frame sequence numbers of two adjacent management frames received by the electronic device is not within a second preset range, it is determined that the electronic device is under attack.
10. The method according to claim 1, characterized in that After receiving the disassociation frame, determining whether the electronic device is under attack includes: After receiving the disassociation frame, obtaining source device information carried in the disassociation frame; Determining whether the source device information matches the device information of the terminal device; the device information of the terminal device is acquired by the electronic device in the process of establishing the wireless connection with the terminal device; When the source device information does not match the device information of the terminal device, it is determined that the electronic device is attacked.
11. The method according to claim 1, characterized in that After receiving the disassociation frame, determining whether the electronic device is under attack includes: After receiving the disassociation frame, obtaining the source address carried in the disassociation frame; When the source address is the network address of the electronic device, it is determined that the electronic device is under attack.
12. The method according to claim 1, characterized in that Also includes: After the Wi-Fi hotspot establishes a target wireless connection with the terminal device, when an unencrypted association release frame is received, the unencrypted association release frame is ignored.
13. A hot spot control system, characterized in that: include: An electronic device for providing a Wi-Fi hotspot and a terminal device to be connected to the Wi-Fi hotspot; wherein, The electronic device is used to implement the method described in any one of claims 1 to 12.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by an electronic device that provides a Wi-Fi hotspot, the method according to any one of claims 1 to 12 is implemented.
15. An electronic device, characterized in that: include: Memory, processor and display screen, wherein: The memory is used to store programs; The processor is coupled to the memory and the display screen, and is used to execute the program stored in the memory to implement the method described in any one of claims 1 to 12.
16. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a computer, the method according to any one of claims 1 to 12 can be implemented.
Citation Information
Patent Citations
Security parameters for negotiation protecting management frames in wireless networks
CN101208981A
Method and device for checking management frames in wireless local area networks
CN101616412A
Wireless LAN access point device and unauthorized management frame detection method
CN101895887A
Beacon frame transmitting method and device
CN104219662A
Management frame encryption and decryption
CN110650476A
