How to grab a bag by mobile phone

Source: Internet
Author: User

1 Introduction to ADB tools

ADB is a client-server program where the client is the computer you use to operate, and the server side is the Android device. Installation method: The client needs to be installed on the computer, the client is included in the SDK (in the Tools directory of the Android SDK), or the ADB is installed separately, the device does not need to be installed, Only need to open the option settings-applications-development-usbdebugging (USB debug mode) on the phone. Commonly used ADB commands:

1) Viewing the device

ADB devices view the currently connected device, the Android device connected to the computer, or the emulator will list the display

2) Install the software

ADB install installs the specified APK file on the device

3) Uninstalling the Software

ADB uninstall < software name >

ADB uninstall-k < software name > If you add the-K parameter to uninstall the software but retain the configuration and cache files

4) Login Device shell

The ADB shell will log into the device's shell, followed by a direct run of the device command, equivalent to executing a remote command

5) Send files from the computer to the device

ADB Push < Local path > < remote path > Use the push command to copy files or folders on your computer to your device

6) Download files from the device to the computer

ADB pull < Remote path > < local path > Use the Send command to copy files or folders on the device (phone) to the native

7) Start and stop ADB services

ADB start-server start ADB service process

ADB kill-server terminates ADB service process

8) Display the Help information to see all the commands supported by ADB

ADB Help

2 Android Grab Bag method

The toolkit contents are as follows:

adb--Google offers remote debugging tools for Android. (For PC Connect phone and enter command)

An open Source Network Protocol analysis tool commonly used in the Tcpdump--linux system. (Put inside the phone to grab the bag)

Wireshark--window the Capture tool under the system. (View analyzed crawled packets)

Catch Package Condition: The phone needs to get root permission

How to use:

1, put the ADB tool in any directory of the PC, and then go to cmd Switch to the tool directory, such as:

2. Connect the phone to the PC via USB cable and turn on the USB debug mode of the phone

3. CMD input: ADB devices This command is to view the devices that are currently connected, such as

4. Copy the Tcpdump tool to the phone, cmd input: adb push < Local path > < remote path >, such as:

5, give tcpdump Execute permission, enter adb shell-and Su->chmod respectively 6755/data/local/tcpdump

6. Start grasping bag, enter:/data/local/tcpdump–p–s 0–w/sdcard/test.pcap

Crtl+c ends the grab bag, so that a test.pcap file is saved in the/sdcard directory of the phone.

7. Copy the captured message from the phone to the computer, enter: ADB pull < remote path > < local path >, such as:

You can then use Wireshark to open the contents of the message.

You can see the message sent to 10.0.0.172, which is the message sent by the mobile network.

China Mobile Gateway: 10.0.0.172 HTTP port: 80 and 8080 WAP port: 9201

China Unicom Gateway: 10.0.0.172 HTTP port: 80 and 8080 WAP port: 9201

China Telecom Gateway: 10.0.0.200 HTTP port: 80

3 Using the Fiddler tool to grasp the Package 3.1 Fiddler tool introduction

Fiddler is one of the powerful and useful Web debugging tools that can record HTTP and HTTPS requests from clients and servers, allow you to monitor, set breakpoints, and even modify input and output data, Fiddler contains a powerful event-based scripting subsystem, And can be extended using the. NET language, which is often used in conjunction with Firebug in web development and tuning.

The operating mechanism of the Fiddler is actually the HTTP proxy that listens on the 8888 (default) port on this machine. For PC-side fiddler startup, the default IE proxy is set to 127.0.0.1:8888, while other browsers need to be set manually, so if you need to listen to a PC-side chrome or other app's network packet, change its proxy to 127.0.0.1 : 8888 can listen to the data, the phone side according to the following settings can complete the entire system HTTP proxy.

The advantage of using Tcpdump+wireshark with the ADB is that:

1) No need to get root access to the phone

2) Same for Android and iphone

3) Easy and convenient operation (first installation configuration, only need to set up the agent for the second time)

4) can take advantage of the powerful features of fiddler to perform various operations on the packet

5) can view HTTPS request (Fiddler provides decryption)

Note: Only the mobile phone is connected to the Internet, and the fiddler is located in the same LAN, the mobile phone can be accessed through the Fiddler agent online to use this method to grab packets.

3.2 How to use fiddler for mobile phone capture

1, PC-side installation Fiddler,fiddler as a proxy server mode

2, configuration fiddler allow monitoring HTTPS

Open the Fiddler menu item Tools->fiddler Options, select decrypt HTTPS traffic and ignore server certificate errors two items, such as:

For the first time, you will be prompted to trust the fiddler certificate and Security reminder, select Yes, and then manage it in the system's certificate management.

3. Configure Fiddler to allow remote connection

In the menu, click Connections, select Allow remote computers to connect, the default listener port is 8888, if it is used can also be set, configured to restart the Fiddler for the configuration to take effect, such as:

4. Configure the mobile phone side

Open your phone to connect to the same LAN WiFi, and modify the WiFi network details (long press WiFi selection, modify network), display advanced options, select Manual proxy Settings, hostname fill fiddler machine IP (with the same LAN IP phone), Port fill fiddler port, default 8888, such as:

At this point, the network access on the phone can be viewed in fiddler:

How to grab a bag by mobile phone

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.