May 2018
Beginner
230 pages
4h 49m
English
In this section, we will look at how to give a fake reply at the TCP layer. The program will give fake replies to open ports. For this code, we are going to use the scapy library because the TCP header is very complicated to make. The program name is tcp_trap.py:
import socket import struct import binascii import Queue from scapy.all import * import threading
my_socket = socket.socket(socket.PF_PACKET, socket.SOCK_RAW, 8) Q = Queue.Queue()
Read now
Unlock full access