2020
11-06
11-06
基于python模拟TCP3次握手连接及发送数据
源码如下fromscapy.allimport*importlogginglogging.getLogger('scapy.runtime').setLevel(logging.ERROR)target_ip='192.168.1.1'target_port=80data='GET/HTTP/1.0\r\n\r\n'defstart_tcp(target_ip,target_port):globalsport,s_seq,d_seq#主要是用于TCP3此握手建立连接后继续发送数据try:#第一次握手,发送SYN包ans=sr1(IP(dst=target_ip)/TCP(dport=target_port,sport=RandShort(),se...
继续阅读 >