使用 Scapy 提取 TCP 数据

问题描述

我目前正在尝试使用 Scapy 提取 TCP 数据包(只是一个字母)的有效负载,但在处理前两个数据包后,它一直给我一个 NoneType 异常。

<androidx.appcompat.widget.Toolbar
                android:id="@+id/nearby_toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@null"
                android:minHeight="?attr/actionBarSize"
                android:paddingTop="10dp"
                android:paddingBottom="10dp"
                app:contentInsetLeft="0dp"
                app:contentInsetStart="0dp"
                app:contentInsetStartWithNavigation="0dp"
                app:elevation="0dp"
                app:navigationIcon="@drawable/nav_menu">

例外:

from scapy.all import *
import base64

capture = rdpcap('Data.pcapng') # pcap file

output = open('output.bin','wb') # save dumped data to output.bin

for packet in capture:
    # if packet is ICMP and type is 8 (echo request)
    if packet[TCP].src == '172.16.139.128': 
        output.write(packet[TCP].payload) # write packet data to output.bin

有人知道这是什么原因吗?它应该输出更多。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)