TCPDump on rooted android devices

4.1k views Asked by At

I would like to do TCPDump on rooted android devices.

I would like to create a ".pcap" file for later analysis that will capture upload / download packets. Is there a good library for this? How should I begin ?

1

There are 1 answers

5
siva On

First you should get tcpdump.dat file and push it to the phone by following steps.

adb root

adb remount

adb push local_path_to_tcpdumpt.dat /system/xbin/

adb shell chmod 777 system/xbin/tcpdump

Run the below command at the adb prompt to start capturing the log

adb shell tcpdump -i any -s 0 -w /sdcard/capture.pcap

After capturing tcp logs. Pull the pcap file

adb pull /sdcard/capture.pcap capture.pcap