I have three Linux in VMware. One victim, one attacker and one in the middle as a router.
The router is for detecting attacks.
In the router, using the Python socket, the packets sent from the attacker to the victim can be analyzed to see if it is an attack or not.
conn = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.ntohs(3))
while True:
raw_data, addr = conn.recvfrom(65535)
# get packet length or size
packet_length = len(raw_data)
Some of parameters must be obtained from the packets. Some are easily obtained, such as: Destination Port and…
But i cant calculate this parameters :
-Minimum size of packet in backward direction
-Standard deviation size of packet in backward direction
-Total bytes used for headers in the backward direction
-Average size of packet
Please help