Capture network packages with Android tcpdump in Linux

Source: Internet
Author: User

Capture the Network Package of your mobile phone.ProgramMany times. But the path to packet capture is not that smooth.

Mobile Network Packet Capture requires three tools:

1. ADB: Generally obtained from the android SDK

2. Root tool: psneuter. We can send attachments from many places as we are honest people. /Files/taofh/psneuter.zip

3. tcpdump: network packet capture tool. You can download the attachment (download and remove the suffix .txt. The problem is that only files with a specific suffix can be uploaded here, so I have to add a suffix ". txt"):/files/taofh/tcpdump.txt

 

To capture packets, follow these steps.

1. Get the root permission:

Use psneuter. Actually, there are four steps.

Step 1: Decompress psneuter.zip

Step 2: copy the extracted psneuter to your mobile phone. Generally, use/data/local/tmp. Of course, it can also be sdcard, depending on your needs.

Step 3: add operation permissions for psneuter. It is easy to use chmod 777. If you want to know the specific chmod authorization method, you can view the Linux manual. 777 is the maximum permission and the least security permission, but it doesn't matter.

Step 4: Run psneuter to obtain the root permission

The following is an exampleCode:

ADB push <locally decompressed psneuter>/data/local/tmp/
ADB Shell

$ Chmod777/Data/local/tmp/psneuter
$/Data/local/tmp/psneuter
$ Exit

ADB Shell
#

2. Packet Capture: it is easier to capture packets.

Step 1: Copy tcpdump to your mobile phone

Step 2: authorize chmod 777 to tcpdump <file path/tcpdump>

Step 3: Use tcpdump to capture packets and view the package content

The following is the sample code:

ADB push <tcpdump>/data/local/tmp
ADB Shell
# Chmod 777 /Data/local/tmp/tcpdump
#/Data/local/tmp/tcpdump-a-n-s 1024

 

 

OK. We can analyze the captured package.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.