这是我的代码是SCAPY
#! /usr/bin/env python
from scapy.all import *
source_port = 25000
dest_port = 23
ip = IP(src="192.168.21.146",dst="192.168.21.168")
num_seq=10
SYN=TCP(sport=source_port,dport=dest_port,flags="S",seq=num_seq)
SYNACK=sr1(ip/SYN)
payload1="/etc/passwd"
num_ack=SYNACK.seq + 1
num_seq=num_seq=1
ACK=TCP(sport=source_port,dport=dest_port,flags="A",ack=num_ack,seq=num_seq)
send(ip/ACK)
PUSH = TCP(sport=source_port,dport=dest_port,flags="PA",ack=num_ack)
PUSH.seq=num_seq
first=fragment(ip/PUSH/payload1,fragsize=24)
send(first)
如您所见,我正在尝试启动3路握手,然后发送/ etc / passwd(碎片)。但是,在检查wireshark时,一切正常,直到3路,当我发送有效载荷/ etc / passwd时,数据包显示如下
1 0.000000000 192.168.21.146 → 192.168.21.168 TCP 54 25000 → 23 [SYN] Seq=10 Win=8192 Len=0
2 0.000282483 192.168.21.168 → 192.168.21.146 TCP 60 23 → 25000 [SYN, ACK] Seq=2859111682 Ack=11 Win=29200 Len=0 MSS=1460
3 0.074613619 192.168.21.146 → 192.168.21.168 TCP 54 25000 → 23 [ACK] Seq=1 Ack=2859111683 Win=8192 Len=0
4 0.166245933 192.168.21.146 → 192.168.21.168 IPv4 58 Fragmented IP protocol (proto=IPv6 Hop-by-Hop Option 0, off=0, ID=0001)
5 0.167909879 192.168.21.146 → 192.168.21.168 IPv4 41 IPv6 Hop-by-Hop Option (0)
因此,如果您在此处看到数据包4和5,我不确定逐跳和原型ipv6来自哪里。 Proto应该是TCP。有人可以帮我这里。非常感谢任何帮助。