
In this case, the attached .pcap file contains data showing that the TCP window size has been manually adjusted for each request.
- In TCP (Transmission Control Protocol), window size is a critical concept in controlling data flow between two devices in a network. The window size specifies the maximum amount of data (in bytes) that can be sent without receiving an acknowledgment from the receiving device. This mechanism is essential to ensure reliable and efficient data transmission.

We can use pyshark to write a program that manually extracts the window size from each request and reconstruct it to ASCII.
from scapy.all import *
import string
# Define the range of printable ASCII characters
ascii_range = range(32, 127)
# Initialize an empty string to store the reconstructed message
reconstructed_message = ""
# Load the pcapng file
packets = rdpcap("exfil.pcapng")
# Iterate through each packet
for packet in packets:
# Check if the packet has a TCP layer
if packet.haslayer(TCP):
# Extract the TCP window size
window_size = packet[TCP].window
# Check if the window size falls within the ASCII printable range
if window_size in ascii_range:
# Convert the window size to the corresponding ASCII character
reconstructed_message += chr(window_size)
# Print the reconstructed message
print("Reconstructed Message:", reconstructed_message)