class="hljs-ln-code"> class="hljs-ln-line">chmod 777  /data/local/tmp/tcpdump
  • class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="3"> class="hljs-ln-code"> class="hljs-ln-line">/data/local/tmp/tcpdump -p -vv -s0 -w /sdcard/capture.pcap
  • class="hljs-button signin active" data-title="登录复制" data-report-click="{"spm":"1001.2101.3001.4334"}" onclick="hljs.signin(event)">

    截取指定端口  port 8939   port 8940

    /data/local/tmp/tcpdump -p -vv -s0 -w /sdcard/capture.pcap port 8939 or port 8940 class="hljs-button signin active" data-title="登录复制" data-report-click="{"spm":"1001.2101.3001.4334"}" onclick="hljs.signin(event)">

     

    然后抓取的/sdcard/capture.pcap 

    adb pull /sdcard/capture.pcap

    用wireshark打开capture.pcap就可以分析了

    动态抓取:
    比如我们指定2024为端口通道,将截包数据发送到netcat监听的2024端口,并通过adb将2024端口再映射到pc上,再在pc上执行netcat将数据转发到wireshark中,这个更方便,另外ncat需要自己下载拷贝到wireshark文件夹中。

    1. class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="1"> class="hljs-ln-code"> class="hljs-ln-line">
    2. class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="2"> class="hljs-ln-code"> class="hljs-ln-line">执行命令
    3. class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="3"> class="hljs-ln-code"> class="hljs-ln-line">adb shell中执行:
    4. class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="4"> class="hljs-ln-code"> class="hljs-ln-line">tcpdump -n -s 0 -w - | nc -l -p 2024
    5. class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="5"> class="hljs-ln-code"> class="hljs-ln-line">如果指定端口执行:
    6. class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="6"> class="hljs-ln-code"> class="hljs-ln-line">tcpdump -n -s 0 -w - port 8939 or port 8940 | nc -l -p 2024
    7. class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="7"> class="hljs-ln-code"> class="hljs-ln-line">pc端执行:
    8. class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="8"> class="hljs-ln-code"> class="hljs-ln-line">adb forward tcp:2024 tcp:2024
    9. class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="9"> class="hljs-ln-code"> class="hljs-ln-line">然后在wireshark安装目录下cmd执行:
    10. class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="10"> class="hljs-ln-code"> class="hljs-ln-line">ncat 127.0.0.1 2024 | wireshark -k -S -i -
    class="hljs-button signin active" data-title="登录复制" data-report-click="{"spm":"1001.2101.3001.4334"}" onclick="hljs.signin(event)">

    >>
    注:本文转载自blog.csdn.net的babytiger的文章"https://blog.csdn.net/babytiger/article/details/135938904"。版权归原作者所有,此博客不拥有其著作权,亦不承担相应法律责任。如有侵权,请联系我们删除。
    复制链接

    评论记录:

    未查询到任何数据!