Ext: Android-developed network grab bag

Source: Internet
Author: User

The way is to install tcpdump on the Android machine, and then through the-w parameter to the capture packet to local, and then the caught. cap file to the PC with Wireshark to analyze. There are a lot of steps here, and the efficiency is very low when the background is linked.

Can you start the grab on Android and see the real-time capture results directly on the PC?

With the ADB debug Bridge, we can do so conveniently.

First, the Preparation tool:

1、android 系统root2、android上安装tcpdump3、android上安装netcat,可以直接使用busybox的版本4、pc的wireshark的安装目录下需要有nc客户端5、把android手机和pc通过usb调试连接上

Second, the Order:

1, Android first execution:

0 -w - | nc -l -p 11234

* 11234 is an example, the port can be set by itself

2. Start adb forward on PC:

adb forward tcp:11234 tcp:11234 && nc64 127.0.0.1 11234 | wireshark -k -S -i -

* Here's 11234 to be and the front to enable 11234 to remain consistent

3, if the clutch success, then the PC-side Wireshark is automatically started, and can see the network packet

Three, the realization principle:

The key logic in ADB forward this command, which implements the function of port mapping:

Go: Android-developed network capture

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.