Security detection method and device, electronic equipment and storage medium
By establishing a relay network in the NFC device, obtaining and processing communication data between the NFC card and the card reader terminal, the security detection problem of NFC devices in the case of interference is solved, and the reasonable setting of communication security and time thresholds is ensured. .
Patent Information
- Application Number
- CN202310744658.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-21
- Publication Date
- 2024-12-24
AI Technical Summary
In the prior art, the time threshold of the NFC device is set artificially, and its security cannot be determined in the event of interference. It is necessary to ensure normal communication but not to set too long time threshold.
By establishing a relay network, the server acquires communication data between the NFC card and the card reading terminal, and processes the data. If the communication can continue, it is determined that it is unsafe, and the time threshold is adjusted.
Effectively check the security of NFC devices, avoid relay attacks, and ensure the accuracy and effectiveness of communication security detection.
Smart Images

Figure CN119183111A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication security technology, and specifically relates to a security detection method, device, electronic device and storage medium. Background Art
[0002] Near Field Communication (NFC) is a commonly used technology nowadays. Devices using NFC technology (such as mobile phones) can exchange data when they are close to each other. The distance constraint protocol is designed to prevent NFC from being attacked by relays. The distance constraint protocol is a protocol that calculates the distance between two devices by calculating the time taken for data interaction. In this way, a time threshold needs to be set in advance. Once the communication time exceeds the set threshold, it is considered that the NFC card and the NFC reader are not in direct contact, but are transmitting data through other media, that is, they are attacked by relays.
[0003] In the related art, the time threshold is set manually, but it is necessary to ensure normal communication in the presence of interference, but the time cannot be set too long to determine whether the NFC device is safe. Summary of the invention
[0004] The embodiments of the present application provide a security detection method, device, electronic device and storage medium, which can solve the problem in the related art that the time threshold is set manually, but it is necessary to ensure normal communication in the presence of interference, but the time cannot be set too long, and the security of the NFC device cannot be determined.
[0005] In a first aspect, an embodiment of the present application provides a security detection method, the method comprising:
[0006] Connecting both the first device and the second device to the server for communication to establish a relay network, wherein the first device is used to communicate with a near field communication NFC card, and the second device is used to communicate with a card reader terminal;
[0007] When the NFC card communicates with the card reader terminal and is in the relay network, acquiring communication data between the NFC card and the card reader terminal through the server;
[0008] Processing the communication data;
[0009] In a case where data between the NFC card and the card reading terminal is transmitted through the server, the NFC card maintains communication with the card reading terminal, and it is determined that the communication between the NFC card and the card reading terminal is not secure.
[0010] In a second aspect, an embodiment of the present application provides a security detection device, the device comprising:
[0011] An establishment module is used to establish a communication connection between the first device and the second device and the server to establish a relay network, wherein the first device is used to communicate with a near field communication NFC card, and the second device is used to communicate with a card reader terminal;
[0012] an acquisition module, configured to acquire, through the server, communication data between the NFC card and the card reader terminal when the NFC card and the card reader terminal are communicating and in the relay network;
[0013] A processing module, used for processing the communication data;
[0014] The detection module is used to determine that the communication between the NFC card and the card reader terminal is not secure when the NFC card and the card reader terminal maintain communication when data between the NFC card and the card reader terminal is transmitted through the server.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0016] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0017] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0018] In the embodiment of the present application, firstly, both the first device and the second device are connected to the server for communication, and a relay network is established. The first device can communicate with the NFC card, and the second device can communicate with the card reader terminal. Then, when the NFC card and the card reader terminal communicate and are in the above-mentioned relay network, the communication data between the NFC card and the card reader terminal is obtained through the server, and then the communication data is processed. Finally, when the data between the NFC card and the card reader terminal is transmitted through the server, the NFC card and the card reader terminal maintain communication, and it is determined that the communication between the NFC card and the card reader terminal is not safe. The embodiment of the present application constructs a relay environment, and uses the relay environment to relay the NFC device that has implemented the distance constraint protocol, thereby checking the security of the device. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1It is a flowchart of a safety detection method provided in an embodiment of the present application;
[0020] Figure 2 It is a structural block diagram of a relay network provided in an embodiment of the present application;
[0021] Figure 3 It is a structural schematic diagram of a safety detection device provided in an embodiment of the present application;
[0022] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0024] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0025] The security detection method, device, electronic device and storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.
[0026] Figure 1 A schematic diagram of a safety detection method provided in an embodiment of the present application is shown. Figure 1 The method may include the contents shown in steps 101 to 104.
[0027] In S101, the first device and the second device are both connected to the server for communication to establish a relay network.
[0028] The first device is used to communicate with a near field communication (NFC) card, and the second device is used to communicate with a card reader terminal.
[0029] That is to say, in order to detect the security of NFC devices that have implemented the distance constraint protocol, this application first needs to build a relay attack environment, that is, a relay network, and use the relay network to implement security detection between the NFC card and the card reader terminal. Figure 2 , which is a structural block diagram of a relay network provided in an embodiment of the present application.
[0030] It is worth noting that NFC devices may include NFC cards and card readers. Among them, NFC cards may be NFC devices set on terminals, such as mobile phone terminals, computer terminals, etc. Card readers are devices that read NFC cards, such as smart door locks, payment devices, etc.
[0031] In S102, when the NFC card communicates with the card reader terminal and is in a relay network, communication data between the NFC card and the card reader terminal is acquired through the server.
[0032] In an embodiment of the present application, during a relay attack, the server can completely record the communication data between the NFC card and the card reader terminal.
[0033] It is worth noting that the communication data can be divided into two parts according to whether the data can be obtained through repeated tests. One part is the first challenge data, which is basically fixed. After a large number of repeated tests, the correct response data of this part of the data can be analyzed. These data are listed as the first challenge data. For example: During the interaction of NFC devices, the card reader terminal will ask the NFC card whether it is a mobile device. If so, it will reply 0x60, and if not, it will reply 0x90. This kind of simple fixed answer data is generally the first challenge data.
[0034] The other part is the second challenge data, which is generally the result of calculation and encryption. In other words, if the developer's encryption algorithm cannot be determined, the server cannot correctly calculate the corresponding response data, and this part of the data is listed as the second challenge data. For example: during the identity authentication process, the card reader terminal will send a string of random numbers to the NFC card, and the NFC card will calculate the encrypted data according to the predetermined algorithm, and then reply the encrypted data to the card reader terminal. This kind of data that takes time to calculate is generally the second challenge data.
[0035] In S103, the communication data is processed.
[0036] In this embodiment, different processing is required for different data, which will be described in detail in the subsequent embodiments.
[0037] In S104, when data between the NFC card and the card reader terminal is transmitted through the server, the NFC card and the card reader terminal maintain communication, and it is determined that the communication between the NFC card and the card reader terminal is not secure.
[0038] In other words, if the NFC device can still maintain normal communication after being attacked by a relay, it means that the communication between the NFC card and the card reader terminal is not secure, that is, the query time is set unreasonably and a more reasonable time needs to be reset.
[0039] In the embodiment of the present application, firstly, both the first device and the second device are connected to the server for communication, and a relay network is established. The first device can communicate with the NFC card, and the second device can communicate with the card reader terminal. Then, when the NFC card and the card reader terminal communicate and are in the above-mentioned relay network, the communication data between the NFC card and the card reader terminal is obtained through the server, and then the communication data is processed. Finally, when the data between the NFC card and the card reader terminal is transmitted through the server, the NFC card and the card reader terminal maintain communication, and it is determined that the communication between the NFC card and the card reader terminal is not safe. The embodiment of the present application constructs a relay environment, and uses the relay environment to relay the NFC device that has implemented the distance constraint protocol, thereby checking the security of the device.
[0040] In a possible implementation of the present application, the first device and the second device are both communicatively connected to the server to establish a relay network, including: connecting the first device and the second device to the server through a wireless network; communicating with a card reader terminal through the second device to obtain first data from the card reader terminal; sending the first data to the server through the second device; sending the first data to the first device through the server; sending the first data to the NFC card through the first device; when the NFC card receives the first data, sending the second data to the card reader terminal through the first device, the server, and the second device to establish a relay network.
[0041] The wireless network may be Wi-Fi, Wireless Local Area Network (WLAN), etc.
[0042] In the embodiment of the present application, the first device and the second device are connected to the server through a wireless network, the second device is placed close to the card reader terminal as a simulated card, and the first device is placed close to the NFC card as a simulated card reader. When the card reader terminal contacts the second device, data will be sent to the second device to confirm its identity. The second device will send the data to the server, and the server will send the data to the first device. The first device will send the data to the NFC card. After the NFC card receives the data, it will send the correct response data to the first device, and then the first device will send the response data to the server, the server will send the response data to the second device, and the second device will send the response data to the card reader terminal. After completing the above process, a relay network is established, which can be used for subsequent relay attacks. The embodiment of the present application constructs a relay network to carry out relay attacks on NFC devices in order to determine the security of NFC devices.
[0043] In a possible implementation manner of the present application, the communication data includes: first challenge data and second challenge data.
[0044] Optionally, obtaining communication data between the NFC card and the card reader terminal through the server may include: obtaining first challenge data through the server and determining first response data, the first response data being response data to the first challenge data; obtaining second challenge data through the server, the second challenge data being data other than the first challenge data.
[0045] That is, the communication data between NFC devices obtained by the server includes two types of data, first challenge data and second challenge data.
[0046] Among them, the first challenge data is basically fixed. After a large number of repeated tests, the correct response data of this part of data can be analyzed, and these data are listed as the first challenge data. For example: during the interaction of NFC devices, the card reader terminal will ask the NFC card whether it is a mobile device. If so, it will reply 0x60, if not, it will reply 0x90. This kind of simple fixed answer data is generally the first challenge data.
[0047] The second challenge data is generally the result of calculation and encryption. In other words, if the developer's encryption algorithm cannot be determined, the server cannot correctly calculate the corresponding response data, and this part of the data is listed as the second challenge data. For example: during the identity authentication process, the card reader terminal will send a string of random numbers to the NFC card, and the NFC card will calculate the encrypted data according to the predetermined algorithm, and then reply the encrypted data to the card reader terminal. This kind of data that takes time to calculate is generally the second challenge data.
[0048] In a possible implementation of the present application, performing data processing on communication data may include: if the communication data is first challenge data, sending the first challenge data to the first device through the server, and sending the first response data to the second device, and the NFC card maintains communication with the card reader terminal; if the communication data is second challenge data, sending the second challenge data to the NFC card through the first device through the server; the NFC card sends second response data to the server through the first device, and the second response data is response data of the second challenge data; the server sends the second response data to the card reader terminal through the second device; if the communication between the NFC card and the card reader terminal is interrupted, determining that the communication security between the NFC card and the card reader terminal is determined.
[0049] In the embodiment of the present application, after the server collects data, it processes the data, and different processing methods are required for the first challenge data and the second challenge data.
[0050] For the first challenge data, the correct response data can be known or predicted in advance through a large number of tests, so that the card reader terminal can be directly replied. This type of data does not need to use a relay, but when the data is transmitted to the server, the server directly interacts with the NFC card and the card reader terminal. In other words, after the card reader terminal transmits the data to the server through the second device, the server directly replies with the correct response data to the second device and the card reader terminal while transmitting the data to the first device and the NFC card, so that the data transmission time can be reduced by about half.
[0051] After receiving the response data sent by the server, if the card reader terminal continues to inquire in the next step, it means that the response time is within the time threshold of the query response, which means that the query of the distance constraint protocol is bypassed, that is, the query time threshold is set unreasonably and a more reasonable time threshold needs to be set.
[0052] For the second challenge data, since its time threshold is relatively wide, it can be directly relayed. That is, the card reader terminal transmits the data to the server through the second device, and the server transmits the data to the NFC card through the first device. After the NFC card gives the correct response data, it replies the correct response data to the server through the first device, and the server replies the result to the card reader terminal through the second device.
[0053] After receiving the response data sent by the server, if the card reader terminal continues to inquire in the next step, it means that the response time is within the time threshold of the query response, which means that the query of the distance constraint protocol is bypassed, that is, the query time threshold is set unreasonably and a more reasonable time threshold needs to be set.
[0054] In an embodiment of the present application, if in a relay network environment, after the first challenge data and the response data corresponding to the second challenge data are sent to the card reader terminal, the next inquiry can be obtained, that is, the NFC card and the card reader terminal can continue to communicate, then it means that the distance constraint protocol can be completely bypassed and a relay attack can be implemented. In other words, the time threshold is set unreasonably, and a more reasonable time threshold needs to be set.
[0055] It should be noted that the execution subject of the security detection method provided in the embodiment of the present application can be a security detection device, or a control module in the security detection device for executing the security detection method. In the embodiment of the present application, the security detection device provided in the embodiment of the present application is described by taking the security detection device executing the security detection method as an example.
[0056] Figure 3 Schematic diagram of a safety detection device provided according to an embodiment of the present application. Figure 3 As shown, the device 300 includes: an establishment module 301, an acquisition module 302, a processing module 303 and a detection module 304.
[0057] Among them, the establishment module 301 is used to connect the first device and the second device to the server for communication and establish a relay network, wherein the first device is used to communicate with the near field communication NFC card, and the second device is used to communicate with the card reader terminal; the acquisition module 302 is used to obtain the communication data between the NFC card and the card reader terminal through the server when the NFC card and the card reader terminal communicate and are in the relay network; the processing module 303 is used to process the communication data; the detection module 304 is used to determine that the communication between the NFC card and the card reader terminal is not secure when the data between the NFC card and the card reader terminal is transmitted through the server and the NFC card and the card reader terminal maintain communication.
[0058] In the embodiment of the present application, firstly, the establishment module 301 connects the first device and the second device to the server for communication, establishes a relay network, the first device can communicate with the NFC card, and the second device can communicate with the card reader terminal, then the acquisition module 302 acquires the communication data between the NFC card and the card reader terminal through the server when the NFC card and the card reader terminal communicate and are in the above-mentioned relay network, and the processing module 303 processes the communication data, and finally the detection module 304 determines that the communication between the NFC card and the card reader terminal is unsafe when the data between the NFC card and the card reader terminal is transmitted through the server and the NFC card and the card reader terminal maintain communication. The embodiment of the present application constructs a relay environment, uses the relay environment to relay the NFC device that has implemented the distance constraint protocol, and then checks the security of the device.
[0059] In a possible implementation of the present application, a module 301 is established, which is used to: connect the first device and the second device to the server through a wireless network; communicate with the card reader terminal through the second device to obtain the first data of the card reader terminal; send the first data to the server through the second device; send the first data to the first device through the server; send the first data to the NFC card through the first device; when the NFC card receives the first data, send the second data to the card reader terminal through the first device, the server and the second device to establish a relay network.
[0060] In a possible implementation of the present application, the communication data includes: first query data and second query data; an acquisition module 302 is used to: acquire the first query data through a server and determine first response data, the first response data being response data of the first query data; acquire the second query data through a server, the second query data being data other than the first query data.
[0061] In a possible implementation of the present application, the processing module 303 is used to: if the communication data is the first challenge data, send the first challenge data to the first device through the server, and send the first response data to the second device, and the NFC card maintains communication with the card reader terminal; if the communication data is the second challenge data, send the second challenge data to the NFC card through the first device through the server; the NFC card sends the second response data to the server through the first device, and the second response data is the response data of the second challenge data; the server sends the second response data to the card reader terminal through the second device; if the communication between the NFC card and the card reader terminal is interrupted, determine that the communication security between the NFC card and the card reader terminal is determined.
[0062] The security detection device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device, and exemplary mobile electronic devices can be mobile phones, tablet computers, laptop computers, PDAs, vehicle-mounted electronic devices, wearable devices, ultra-mobile personal computers (ultra-mobile personal computers, UMPCs), netbooks or personal digital assistants (personal digital assistants, PDAs), etc. Non-mobile electronic devices can be personal computers (personal computers, PCs), televisions (televisions, TVs), teller machines or self-service machines, etc., and the embodiments of the present application are not specifically limited.
[0063] The security detection device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0064] The safety detection device provided in the embodiment of the present application can achieve Figure 1 to Figure 2 To avoid repetition, the various processes implemented in the method embodiment are not described here.
[0065] Based on the same technical concept, an embodiment of the present application further provides an electronic device, which is used to execute the above-mentioned security detection method. Figure 4 A schematic diagram of the structure of an electronic device for implementing various embodiments of the present application. The electronic device may have relatively large differences due to different configurations or performances, and may include a processor (processor) 401, a communication interface (Communications Interface) 402, a memory (memory) 403 and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404. The processor 401 may call a computer program stored in the memory 403 and executable on the processor 401 to perform the following steps:
[0066] Connecting the first device and the second device to the server for communication to establish a relay network, wherein the first device is used to communicate with a near field communication NFC card, and the second device is used to communicate with a card reader terminal;
[0067] When the NFC card communicates with the card reader terminal and is in a relay network, the communication data between the NFC card and the card reader terminal is obtained through the server;
[0068] Processing communication data;
[0069] In a case where data between the NFC card and the card reader terminal is transmitted through the server, the NFC card and the card reader terminal maintain communication, and it is determined that the communication between the NFC card and the card reader terminal is not secure.
[0070] In the embodiment of the present application, firstly, both the first device and the second device are connected to the server for communication, and a relay network is established. The first device can communicate with the NFC card, and the second device can communicate with the card reader terminal. Then, when the NFC card and the card reader terminal communicate and are in the above-mentioned relay network, the communication data between the NFC card and the card reader terminal is obtained through the server, and then the communication data is processed. Finally, when the data between the NFC card and the card reader terminal is transmitted through the server, the NFC card and the card reader terminal maintain communication, and it is determined that the communication between the NFC card and the card reader terminal is not safe. The embodiment of the present application constructs a relay environment, and uses the relay environment to relay the NFC device that has implemented the distance constraint protocol, thereby checking the security of the device.
[0071] The specific execution steps can refer to the various steps of the above-mentioned security detection method embodiment, and can achieve the same technical effect. To avoid repetition, they will not be repeated here.
[0072] It should be noted that the electronic device in the embodiments of the present application includes: a terminal or other devices except a terminal.
[0073] The above electronic device structure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the input unit may include a graphics processing unit (GPU) and a microphone, and the display unit may be configured with a display panel in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit includes a touch panel and at least one of other input devices. The touch panel is also called a touch screen. Other input devices may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0074] The memory can be used to store software programs and various data. The memory may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory may include a volatile memory or a non-volatile memory, or the memory may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM).
[0075] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor.
[0076] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned security detection method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0077] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0078] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned security detection method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0079] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0080] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises one..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be noted that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0081] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0082] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A safety detection method, characterized in that: include: Connecting both the first device and the second device to the server for communication to establish a relay network, wherein the first device is used to communicate with a near field communication NFC card, and the second device is used to communicate with a card reader terminal; When the NFC card communicates with the card reader terminal and is in the relay network, acquiring communication data between the NFC card and the card reader terminal through the server; Processing the communication data; In a case where data between the NFC card and the card reading terminal is transmitted through the server, the NFC card maintains communication with the card reading terminal, and it is determined that the communication between the NFC card and the card reading terminal is not secure.
2. The safety detection method according to claim 1, characterized in that: The step of establishing a relay network by connecting the first device and the second device to the server for communication includes: Connecting the first device and the second device to the server via a wireless network; Communicate with the card reading terminal through the second device to obtain first data of the card reading terminal; sending the first data to the server through the second device; sending the first data to the first device through the server; Sending the first data to the NFC card through the first device; When the NFC card receives the first data, the second data is sent to the card reading terminal through the first device, the server and the second device to establish a relay network.
3. The safety detection method according to claim 1, characterized in that: The communication data includes: first challenge data and second challenge data; The acquiring, through the server, communication data between the NFC card and the card reader terminal comprises: Acquire first challenge data through the server, and determine first response data, where the first response data is response data to the first challenge data; Second challenge data is obtained through the server, where the second challenge data is data other than the first challenge data.
4. The safety detection method according to claim 3, characterized in that: The processing of the communication data comprises: If the communication data is first challenge data, the server sends the first challenge data to the first device, and sends the first response data to the second device, and the NFC card maintains communication with the card reader terminal; If the communication data is second challenge data, sending the second challenge data to the NFC card through the first device by the server; The NFC card sends second response data to the server through the first device, where the second response data is response data of the second challenge data; The server sends the second response data to the card reading terminal through the second device; If the communication between the NFC card and the card reading terminal is interrupted, it is determined that the communication between the NFC card and the card reading terminal is secure.
5. A safety detection device, characterized in that: include: An establishment module is used to establish a communication connection between the first device and the second device and the server to establish a relay network, wherein the first device is used to communicate with a near field communication NFC card, and the second device is used to communicate with a card reader terminal; an acquisition module, configured to acquire, through the server, communication data between the NFC card and the card reader terminal when the NFC card and the card reader terminal are communicating and in the relay network; A processing module, used for processing the communication data; The detection module is used to determine that the communication between the NFC card and the card reader terminal is not secure when the NFC card and the card reader terminal maintain communication when data between the NFC card and the card reader terminal is transmitted through the server.
6. The safety detection device according to claim 5, characterized in that: The establishment module is used to: Connecting the first device and the second device to the server via a wireless network; Communicate with the card reading terminal through the second device to obtain first data of the card reading terminal; sending the first data to the server through the second device; sending the first data to the first device through the server; Sending the first data to the NFC card through the first device; When the NFC card receives the first data, the second data is sent to the card reading terminal through the first device, the server and the second device to establish a relay network.
7. The safety detection device according to claim 5, characterized in that: The communication data includes: first challenge data and second challenge data; The acquisition module is used to: Acquire first challenge data through the server, and determine first response data, where the first response data is response data to the first challenge data; Second challenge data is obtained through the server, where the second challenge data is data other than the first challenge data.
8. The safety detection device according to claim 7, characterized in that: The processing module is used to: If the communication data is first challenge data, the server sends the first challenge data to the first device, and sends the first response data to the second device, and the NFC card maintains communication with the card reader terminal; If the communication data is second challenge data, sending the second challenge data to the NFC card through the first device by the server; The NFC card sends second response data to the server through the first device, where the second response data is response data of the second challenge data; The server sends the second response data to the card reading terminal through the second device; If the communication between the NFC card and the card reading terminal is interrupted, it is determined that the communication between the NFC card and the card reading terminal is secure.
9. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the security detection method as described in any one of claims 1 to 4.
10. A readable storage medium, characterized in that: The readable storage medium stores programs or instructions, and when the programs or instructions are executed by the processor, the steps of the security detection method according to any one of claims 1 to 4 are implemented.
