CN110336712B - Method and device for capturing empty packet by mobile terminal, storage medium and mobile terminal - Google Patents
Method and device for capturing empty packet by mobile terminal, storage medium and mobile terminal Download PDFInfo
- Publication number
- CN110336712B CN110336712B CN201910586141.9A CN201910586141A CN110336712B CN 110336712 B CN110336712 B CN 110336712B CN 201910586141 A CN201910586141 A CN 201910586141A CN 110336712 B CN110336712 B CN 110336712B
- Authority
- CN
- China
- Prior art keywords
- wireless network
- network interface
- setting parameters
- setting
- empty packet
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/02—Capturing of monitoring data
- H04L43/022—Capturing of monitoring data by sampling
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W24/00—Supervisory, monitoring or testing arrangements
- H04W24/02—Arrangements for optimising operational condition
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W24/00—Supervisory, monitoring or testing arrangements
- H04W24/08—Testing, supervising or monitoring using real traffic
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The disclosure provides a method and a device for a mobile terminal to grab an empty packet, a storage medium and the mobile terminal, and belongs to the technical field of wireless communication. The method comprises the following steps: acquiring a setting parameter related to grabbing the empty packet; transmitting the setting parameters to a preset service; calling a wireless network interface through the preset service so as to set the wireless network interface according to the setting parameters; and monitoring data flowing through the wireless network interface to grab the empty packet. According to the method, the empty packet can be captured on the mobile terminal without other equipment, and the method is simple and convenient for user operation and has high applicability.
Description
Technical Field
The present disclosure relates to the field of wireless communications technologies, and in particular, to a method for a mobile terminal to capture an empty packet, an apparatus for the mobile terminal to capture an empty packet, a computer-readable storage medium, and a mobile terminal.
Background
The communication interaction of the wireless network is carried out by taking air as a medium. The air packet capturing is a technology for capturing and monitoring wireless data in the air, and has important significance for monitoring communication conditions, checking network safety and the like.
Mobile terminals such as mobile phones and tablet computers are common devices requiring access to a wireless network, and if empty packages can be captured on the mobile terminals, the wireless network can be conveniently monitored and checked. However, no mature implementation method exists at present how to capture empty packets by using a mobile terminal.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The disclosure provides a method for grabbing an empty packet by a mobile terminal, a device for grabbing an empty packet by a mobile terminal, a computer readable storage medium and a mobile terminal, so that the problem that the empty packet cannot be grabbed on the mobile terminal in the prior art is at least improved to a certain extent.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, a method for grabbing an empty packet by a mobile terminal is provided, which includes: acquiring a setting parameter related to grabbing an empty packet; transmitting the setting parameters to a preset service; calling a wireless network interface through the preset service so as to set the wireless network interface according to the setting parameters; and monitoring the data flowing through the wireless network interface to grab the empty packet.
Optionally, the obtaining of the setting parameter for grabbing the empty packet includes: and presenting a User Interface (UI), and acquiring the setting parameters related to the grabbing of the empty packet through the UI.
Optionally, the transmitting the setting parameter to a preset service includes: transmitting the setting parameters to an activity manager associated with the user interface; and distributing the setting parameters from the activity manager to the preset service through a Binder.
Optionally, the method further includes: and if an operation instruction of canceling the packet grabbing is received, restoring the setting of the wireless network interface.
Optionally, the monitoring data flowing through the wireless network interface includes: and monitoring data flowing through the wireless network interface by the preset service call TCPDump.
Optionally, when the wireless network interface is set, the wireless network interface is further set to be in a Monitor Mode or a Promiscuous Mode.
Optionally, the setting parameters include: channel and bandwidth, or Service Set Identifier (SSID).
According to a second aspect of the present disclosure, there is provided an apparatus for grabbing an empty packet by a mobile terminal, including: the parameter acquisition module is used for acquiring setting parameters related to grabbing the empty packet; the data transmission module is used for transmitting the setting parameters to a preset service; the wireless setting module is used for calling a wireless network interface through the preset service so as to set the wireless network interface according to the setting parameters; and the data monitoring module is used for monitoring the data flowing through the wireless network interface so as to capture the empty packet.
Optionally, the parameter obtaining module is configured to present a user interface, and obtain the setting parameter related to the grabbing of the empty packet through the user interface.
Optionally, the data transmission module is configured to transmit the setting parameter to an activity manager associated with the user interface; and distributing the setting parameters from the activity manager to the preset service through a Binder.
Optionally, the wireless setting module is further configured to restore the setting of the wireless network interface if an operation instruction for cancelling the packet capturing is received.
Optionally, the data monitoring module is configured to monitor data flowing through the wireless network interface through the preset service call TCPDump.
Optionally, the wireless setting module is further configured to set the wireless network interface to a monitoring mode or a promiscuous mode when the wireless network interface is set.
Optionally, the setting parameters include: channel and bandwidth, or service set identification.
According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, implements any one of the above-mentioned methods of grabbing empty packets.
According to a fourth aspect of the present disclosure, there is provided a mobile terminal comprising: a processor; a memory for storing executable instructions of the processor; and a wireless network interface; wherein the processor is configured to perform any one of the above methods of grabbing empty packets via execution of the executable instructions.
The present disclosure has the following beneficial effects:
after the mobile terminal obtains the setting parameters of the captured empty packet, the wireless network interface is called through the preset service to set so as to monitor the data flowing through the wireless network interface, and therefore the empty packet is captured. On one hand, the method for grabbing the empty packet on the mobile terminal such as the mobile phone and the tablet personal computer is provided, the empty packet can be conveniently grabbed without the help of equipment such as a PC (personal computer) by using the convenience of connecting the mobile terminal with a wireless network. On the other hand, through deploying the preset service and the association of the preset service and the upper application, the user can capture the empty packet by inputting the setting parameters, the operation is simple and convenient, the learning cost of the user is low, and the method has high applicability.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure. It should be apparent that the drawings in the following description are merely some embodiments of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without inventive effort.
Fig. 1 is a schematic diagram illustrating a method for grabbing an empty packet in the related art;
fig. 2 is a flowchart illustrating a method for grabbing an empty packet by a mobile terminal in the exemplary embodiment;
fig. 3 is a schematic diagram illustrating an architecture of grabbing an empty packet by a mobile terminal in the present exemplary embodiment;
FIG. 4 illustrates an interactive flow diagram to begin grabbing an empty package in the exemplary embodiment;
FIG. 5 illustrates an interaction flow diagram for stopping grabbing an empty packet in the exemplary embodiment;
fig. 6 is a block diagram illustrating a structure of an apparatus for a mobile terminal to grab an empty packet in the exemplary embodiment;
FIG. 7 illustrates a computer-readable storage medium for implementing the above-described method in the present exemplary embodiment;
fig. 8 illustrates a mobile terminal for implementing the above method in the present exemplary embodiment;
fig. 9 illustrates another mobile terminal for implementing the above method in the present exemplary embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
In one of the related art schemes, a PC (Personal Computer) equipped with a wireless network card is required to capture an empty packet. As shown in fig. 1, the Wireless device is connected to the internet through a Wifi (Wireless Fidelity) signal of the Wireless router, sets a Wireless network card of the PC to a promiscuous mode, and is placed in a Wifi environment of the Wireless router, so as to monitor a specific channel and capture an empty packet transmitted between the Wireless router and the Wireless device. However, this solution requires additional PC and wireless network card, which is inconvenient to use and increases the cost.
In view of the foregoing various problems, exemplary embodiments of the present disclosure provide a method for a mobile terminal to grab an empty packet. Fig. 2 shows a flow of the method, which may include steps S210 to S240:
in step S210, the setting parameters for grabbing the empty packet are obtained.
The setting parameter refers to a parameter set according to a requirement on how to capture an empty packet, and may include, for example: channel and bandwidth, which means to capture the air packet in the channel within the bandwidth; or SSID, generally corresponding to the name of an AP (Access Point, wireless Access Point) such as a router, that represents an empty packet captured from the router; other types of parameters may also be included, such as time to grab, total number of packets grabbed, filter conditions for grabbing, and so forth.
In an optional implementation manner, the mobile terminal may present a user interface, which may be a system setting interface or a dedicated APP (Application program) interface, and includes a corresponding option box and the like for a setting interface for grabbing an empty package, and the user inputs setting parameters related to grabbing the empty package in the interface.
Step S220, transmitting the setting parameters to a preset service.
In the exemplary embodiment, a preset service may be deployed in advance in the system background and is responsible for capturing the empty packet, and when the user selects to start capturing the empty packet, the service is started to obtain the setting parameters from the user interface. In an optional implementation manner, the preset Service may be a Native Service (Native Service) of the Android system, and after the Native Service communicates with a foreground, tools and resources at the bottom layer of the system may be directly called, so that a communication process between different components is simplified; in an optional implementation manner, the preset service may be wifi service, the wifi service itself is responsible for a part of tasks of wireless network configuration and communication, and for the task content of uncovered grab-through packets, a new thread may be added in the wifi service in advance, so that the original component configuration of the system is utilized to the maximum extent, and resources are saved.
Fig. 3 shows an Android system-based architecture of the exemplary embodiment. As shown in fig. 3, an APP named as wifi interface is implemented, the upper component mainly includes Activity (Activity), an Activity Manager (Manager), and a tool class (FileUtils), the lower component mainly includes Service (i.e., preset Service), and each component further includes related variables, functions, methods, and the like. Wherein, the activity can load and activate the user interface, and after receiving various bottom layer instructions or data information, correspondingly update the user interface (UpdateUI); communication between the upper and lower layers is effected between the campaign manager and the service. Based on this, in an alternative embodiment, step S220 may be implemented by the following steps:
transmitting the setting parameters to an activity manager associated with the user interface;
the setup parameters are distributed (Dispatch) from the campaign manager to the provisioning service through Binder.
The data information of the user interface comprises setting parameters, the setting parameters reach the activity manager through activities, the activity manager and the services are communicated through a Binder, the activity manager transmits the data to the corresponding services in a distribution mode, and the setting parameters correspond to the preset services.
Step S230, a wireless network interface is called through the preset service, so as to set the wireless network interface according to the setting parameters.
The wireless network interface is responsible for digital communication between the wireless connection module and other system components, and in the exemplary embodiment, the wireless network interface may specifically refer to a wireless network card of the mobile terminal. The preset service calls the wireless network interface, and can directly change the relevant settings of the wireless connection, such as: setting a channel and a bandwidth of the wireless connection according to the setting parameters; setting up a connection to a particular router; setting connection duration; setting and filtering messages meeting specific conditions; the wireless network interface is set to be in a monitoring mode or a promiscuous mode, all wireless data in the environment can be received in the monitoring mode, all wireless data in connected Wifi can be received in the promiscuous mode, both the modes are suitable for air packet capture, and which mode is specifically adopted can be determined according to the type of the wireless network card, the supported modes and actual requirements, and the disclosure does not limit the mode.
As illustrated with reference to fig. 3 above, the service includes two variables: mChannel and mBandwidth, which represent channels and bandwidths, and after the service acquires the data transmitted from the activity manager, the service extracts the setting parameters from the data to assign values to the two variables and then sets the wireless network interface.
Step S240, monitoring data flowing through the wireless network interface to capture an empty packet.
After the setting is completed, the wireless network interface can receive the data of which the destination address is the terminal, and also can receive the data of which the destination address is not the terminal, namely, all the data in the set channel and the set bandwidth are monitored, so that the empty packet is captured.
In an alternative embodiment, if the parameter set in step S210 is an SSID (i.e., the name of an AP), the preset service may parse the wireless data or broadcast information of the SSID, determine the channel and bandwidth where the SSID is located, and convert the SSID into the setting parameters of the channel and bandwidth to set the wireless network interface. After the channel and the bandwidth corresponding to the SSID are analyzed, the channel and the bandwidth can be stored in a corresponding mapping table, so that the system can directly map the monitored SSID to obtain the information such as the channel, the bandwidth and the like at the next time without repeating the analysis process.
In an alternative embodiment, if the mobile terminal runs under the operating system of the Android or other Linux kernel, the default service may call the TCPDump to listen to data flowing through the wireless network interface. The TCPDump is a network data acquisition tool in the Linux system and can intercept and capture a data packet transmitted in a network, and the exemplary embodiment can encapsulate an instruction code of the TCPDump into a preset service, intercept and monitor data of a wireless network interface by setting a-i parameter of the TCPDump, and filter data of other ports.
Based on the above, in the exemplary embodiment, after the mobile terminal obtains the setting parameter related to capturing the empty packet, the wireless network interface is called through the preset service to perform setting, so as to monitor data flowing through the wireless network interface, thereby capturing the empty packet. On one hand, the method for grabbing the empty packet on the mobile terminal such as the mobile phone and the tablet personal computer is provided, the empty packet can be conveniently grabbed without the help of equipment such as a PC (personal computer) by utilizing the convenience of connecting the mobile terminal with a wireless network. On the other hand, through deploying the preset service and the association of the preset service and the upper application, the user can capture the empty packet by inputting the setting parameters, the operation is simple and convenient, the learning cost of the user is low, and the method has high applicability.
In an optional implementation manner, if the mobile terminal receives an operation instruction of canceling the packet grabbing, the mobile terminal may restore the setting of the wireless network interface. The operation instruction can be an instruction input by a user, for example, an option for canceling is selected in a user interface, or an instruction automatically triggered by the system, for example, after the time or data amount for grabbing the empty packet is set, a canceling instruction is automatically generated after the end time is reached or a certain amount of data is grabbed. After packet capture is cancelled, the setting of the wireless network interface may be restored to the state before packet capture is started, or may be restored to a default state configured in advance, for example: canceling the monitored setting parameters, recovering to a default connection mode, switching the mode of the wireless network card to a normal mode such as a unicast mode, and the like. Through the mode of automatic recovery, can make the user conveniently connect and snatch the mode of empty package and switch over by a key between, the switching process has realized that the user does not have the perception, has further improved the convenience of operation.
Fig. 4 shows an interaction flowchart for starting grabbing an empty packet in the present exemplary embodiment. Releasing a user interface by the activity, and inputting a parameter setting instruction and an instruction for starting grabbing the empty packet in the user interface by a user; after receiving the instruction, the activity calls a startSniffer () method; then the activity manager calls a startsnifferfMode () method; transmitting the instruction to the service through communication of the IBinder; the service sets a wireless network interface through the LoadDriver, changes the Connection Mode (Change _ Connection _ Mode) of the wireless network card, and starts to capture an empty packet at this time. After the above processes are successfully executed, the service feeds back information to the activity manager, and then feeds back the information to the activity, and updates the user interface according to the information, for example, information that the setting is successful and grabbing is started is displayed in the original user interface, or a monitoring interface for grabbing empty packages is activated.
Fig. 5 shows an interaction flowchart for stopping grabbing an empty packet in the present exemplary embodiment. The process is similar to the process of starting to grab the empty packet, in the activated user Interface, the user inputs an instruction for canceling the grabbing of the empty packet, after the activity receives the instruction, the activity calls a stopbuffer () method, then the activity manager calls the stopbuffer mode () method, the instruction is transmitted to the service through the communication of the IBinder, the service quits the monitoring (Teardown _ Wlan _ Interface) of the wireless network Interface, and the relevant settings of the wireless network Interface, such as parameters of the connection mode of the wireless network card, the connected channel, the bandwidth and the like, can be recovered. After the above processes are successfully executed, the service feeds back information to the activity manager, and then feeds back the information to the activity, and updates the user interface according to the information, for example, displaying the information of stopping capturing in the original user interface, or activating an interface of Wifi connection, and the like.
The test for grabbing the empty packages by adopting the exemplary embodiment shows that the number of the empty packages grabbed on the mobile phone in the same time length and the number of the empty packages grabbed on the notebook computer are in the same order of magnitude, so that the use requirement of daily test development can be met.
An exemplary embodiment of the present disclosure also provides an apparatus for a mobile terminal to grab an empty packet, as shown in fig. 6, the apparatus 600 may include: a parameter obtaining module 610, configured to obtain a setting parameter for grabbing an empty packet; a data transmission module 620, configured to transmit the setting parameter to a preset service; a wireless setting module 630, configured to call a wireless network interface through a preset service, so as to set the wireless network interface according to the setting parameters; and the data monitoring module 640 is configured to monitor data flowing through the wireless network interface to capture an empty packet.
In an alternative embodiment, the parameter obtaining module 610 may be configured to present a user interface, and obtain the setting parameter related to grabbing the empty packet through the user interface.
In an alternative embodiment, the data transmission module 620 may be configured to transmit the setting parameters to an activity manager associated with the user interface; and distributing the setting parameters from the activity manager to a preset service through the Binder.
In an optional implementation manner, the wireless setting module 630 may be further configured to restore the setting of the wireless network interface if an operation instruction to cancel the capture packet is received.
In an alternative embodiment, the data listening module 640 may be configured to listen to data flowing through the wireless network interface through the TCPDump service call.
In an alternative embodiment, the wireless setting module 630 may be further configured to set the wireless network interface to a listening mode or a promiscuous mode when setting the wireless network interface.
In an alternative embodiment, setting the parameters may include: channel and bandwidth, or service set identification.
The specific details of each module in the above apparatus have been described in detail in the method section, and details of an undisclosed scheme may refer to the method section, and thus are not described again.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
Exemplary embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the disclosure described in the above-mentioned "exemplary methods" section of this specification, when the program product is run on the terminal device.
Referring to fig. 7, a program product 700 for implementing the above method according to an exemplary embodiment of the present disclosure is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not so limited, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In situations involving remote computing devices, the remote computing devices may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to external computing devices (e.g., through the internet using an internet service provider).
The exemplary embodiments of the present disclosure also provide a mobile terminal capable of implementing the above method. As shown in fig. 8, the mobile terminal 800 may include: a processor 810; a memory 820 for storing executable instructions for processor 810; a wireless network interface 830. The wireless network interface 830 is used for transmitting wireless data, and the processor 810 is configured to execute any of the above methods for grabbing empty packets by executing the above executable instructions, in order to listen to necessary components of the wireless data.
In an alternative embodiment, as shown in FIG. 9, mobile terminal 900 may take the form of a general purpose computing device. Components of mobile terminal 900 may include, but are not limited to: the at least one processing unit 910, the at least one memory unit 920, a bus 930 connecting different system components (including the memory unit 920 and the processing unit 910), a display unit 940, and a wireless network interface 970.
The storage unit 920 stores program code, which may be executed by the processing unit 910, so that the processing unit 910 performs the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "exemplary method" section of this specification. For example, processing unit 910 may perform the method steps shown in fig. 2, and so on.
The storage unit 920 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM) 921 and/or a cache memory unit 922, and may further include a read only memory unit (ROM) 923.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the exemplary embodiments of the present disclosure.
Furthermore, the above-described figures are merely schematic illustrations of processes included in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit, according to exemplary embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is to be limited only by the terms of the appended claims.
Claims (9)
1. A method for grabbing an empty packet by a mobile terminal is characterized by comprising the following steps:
in an application program for grabbing an empty packet, loading and activating a user interface through the activity of the application program, and acquiring setting parameters related to grabbing the empty packet through the user interface;
transmitting the setting parameters to an activity manager of the application program, and distributing the setting parameters from the activity manager to preset services corresponding to the setting parameters through a Binder; the bottom layer component of the application program comprises the preset service;
calling a wireless network interface through the preset service so as to set the wireless network interface according to the setting parameters;
monitoring data flowing through the wireless network interface to capture an empty packet;
wherein the preset service includes two variables: mChannel and mBandwidth, wherein mChannel represents a channel and mBandwidth represents a bandwidth; the calling a wireless network interface through the preset service to set the wireless network interface according to the setting parameters includes:
and extracting the setting parameters from the data transmitted by the activity manager through the preset service, assigning values to the two variables according to the setting parameters, and setting the wireless network interface according to the two variables.
2. The method of claim 1, further comprising:
and after receiving a bottom layer instruction or data information through the activity, correspondingly updating the user interface.
3. The method of claim 1, further comprising:
and if an operation instruction of canceling the packet capturing is received, restoring the setting of the wireless network interface.
4. The method of claim 1, wherein the listening for data flowing through the wireless network interface comprises:
and monitoring data flowing through the wireless network interface by the preset service call TCPDump.
5. The method of claim 1, wherein the wireless network interface is further set to a listening mode or a promiscuous mode when the wireless network interface is set.
6. The method of claim 1, wherein setting the parameters comprises: channel and bandwidth, or service set identification.
7. The utility model provides a device that mobile terminal snatched empty package which characterized in that includes:
the parameter acquisition module is used for loading and activating a user interface through the activity of the application program in the application program for grabbing the empty packet, and acquiring the setting parameters related to grabbing the empty packet through the user interface;
the data transmission module is used for transmitting the setting parameters to an activity manager of the application program and distributing the setting parameters from the activity manager to preset services corresponding to the setting parameters through a Binder; the bottom layer component of the application program comprises the preset service;
the wireless setting module is used for calling a wireless network interface through the preset service so as to set the wireless network interface according to the setting parameters;
the data monitoring module is used for monitoring data flowing through the wireless network interface so as to capture an empty packet;
wherein the preset service includes two variables: mChannel and mBandwidth, wherein mChannel represents a channel and mBandwidth represents a bandwidth; the calling a wireless network interface through the preset service to set the wireless network interface according to the setting parameters includes:
and extracting the setting parameters from the data transmitted by the activity manager through the preset service, assigning values to the two variables according to the setting parameters, and setting the wireless network interface according to the two variables.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1-6.
9. A mobile terminal, comprising:
a processor;
a memory for storing executable instructions of the processor; and
a wireless network interface;
wherein the processor is configured to perform the method of any of claims 1-6 via execution of the executable instructions.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910586141.9A CN110336712B (en) | 2019-07-01 | 2019-07-01 | Method and device for capturing empty packet by mobile terminal, storage medium and mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910586141.9A CN110336712B (en) | 2019-07-01 | 2019-07-01 | Method and device for capturing empty packet by mobile terminal, storage medium and mobile terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110336712A CN110336712A (en) | 2019-10-15 |
CN110336712B true CN110336712B (en) | 2022-10-28 |
Family
ID=68142977
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910586141.9A Active CN110336712B (en) | 2019-07-01 | 2019-07-01 | Method and device for capturing empty packet by mobile terminal, storage medium and mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110336712B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111970678B (en) * | 2020-08-06 | 2023-04-28 | Oppo(重庆)智能科技有限公司 | Method and device for capturing air interface data packet, electronic equipment and storage medium |
CN115086961A (en) * | 2022-05-16 | 2022-09-20 | 芯原微电子(上海)股份有限公司 | Wireless packet capturing method, system, device and medium based on user-defined filtering |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101123641A (en) * | 2007-09-14 | 2008-02-13 | 东南大学 | Monitoring method for wireless network call monitoring device based on distributed architecture |
CN106572010A (en) * | 2015-10-12 | 2017-04-19 | 小米科技有限责任公司 | Data package grabbing method and device, and terminal |
CN107332848A (en) * | 2017-07-05 | 2017-11-07 | 重庆邮电大学 | A kind of exception of network traffic real-time monitoring system based on big data |
CN109308241A (en) * | 2018-09-05 | 2019-02-05 | 腾讯科技(深圳)有限公司 | Monitor application program launching flow and method, device, terminal device and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11838330B2 (en) * | 2017-12-20 | 2023-12-05 | King Fahd University Of Petroleum And Minerals | Selective information extraction from network traffic traces both encrypted and non-encrypted |
-
2019
- 2019-07-01 CN CN201910586141.9A patent/CN110336712B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101123641A (en) * | 2007-09-14 | 2008-02-13 | 东南大学 | Monitoring method for wireless network call monitoring device based on distributed architecture |
CN106572010A (en) * | 2015-10-12 | 2017-04-19 | 小米科技有限责任公司 | Data package grabbing method and device, and terminal |
CN107332848A (en) * | 2017-07-05 | 2017-11-07 | 重庆邮电大学 | A kind of exception of network traffic real-time monitoring system based on big data |
CN109308241A (en) * | 2018-09-05 | 2019-02-05 | 腾讯科技(深圳)有限公司 | Monitor application program launching flow and method, device, terminal device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110336712A (en) | 2019-10-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106445448B (en) | Audio device control method and system of terminal and mobile terminal | |
US8655336B1 (en) | Remote issue logging and reporting of mobile station issues and diagnostic information to manufacturer | |
US11134390B2 (en) | Spectrum sharing system for telecommunications network traffic | |
CN110888615B (en) | Multi-input equipment interaction method, device and medium for double-screen different display of Android system | |
CN108647088A (en) | Resource allocation method, device, terminal and storage medium | |
CN109766163B (en) | Synchronous display method and device, storage medium and electronic device | |
CN109446309B (en) | Question feedback method and device | |
US20170034036A1 (en) | Computing environment connectivity system | |
CN104133610A (en) | Screen-splitting interaction method of mobile terminal and mobile terminal | |
CN110336712B (en) | Method and device for capturing empty packet by mobile terminal, storage medium and mobile terminal | |
CN110493028A (en) | A kind of clustered deploy(ment) method, system, device and computer readable storage medium | |
CN113422794A (en) | Traffic recording and playback processing method and device and electronic equipment | |
CN107509051A (en) | Long-range control method, device, terminal and computer-readable recording medium | |
CN111930565B (en) | Process fault self-healing method, device and equipment for components in distributed management system | |
CN112181696B (en) | Abnormality information processing method, apparatus, and storage medium | |
CN112015654A (en) | Method and apparatus for testing | |
CN103731562A (en) | Method and device for adaptively matching bluetooth device with smart devices | |
CN111061448A (en) | Log information display method and device, electronic equipment and storage medium | |
CN112558968B (en) | Method, device, equipment and storage medium for generating resource tree view | |
CN113377664A (en) | Model testing method and device, electronic device and storage medium | |
CN110324432B (en) | Data processing method, device and medium applied to terminal and computing equipment | |
CN110619504B (en) | Service change processing method, device and system and electronic equipment | |
CN115543793A (en) | System deployment method and device of target server and operation and maintenance center station | |
CN106997291B (en) | Control method, master node and slave node | |
CN113934552A (en) | Method and device for determining function code, storage medium and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |