tcpkiller.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:pina-colada 作者: ecthros 项目源码 文件源码
def build_packet(self, src_mac, dst_mac, src_ip, dst_ip, src_port, dst_port, seq, proto):
        eth = Ether(src=src_mac, dst=dst_mac, type=0x800)
        if proto == IP:
            ip = IP(src=src_ip, dst=dst_ip)
        elif proto == IPv6:
            ip = IPv6(src=src_ip, dst=dst_ip)
        else:
            return str(eth) #if unknown L2 protocol, send back dud ether packet
        tcp = TCP(sport=src_port, dport=dst_port, seq=seq, flags="R")
        return str(eth/ip/tcp)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号