from scapy.all import * packet = IP(dst="www.google.com")/TCP(dport=80)
from scapy.all import * send_packet = IP(dst="www.google.com")/TCP(dport=80) response_packet = sr1(send_packet)
from scapy.all import * packet = IP(dst="www.google.com")/TCP(dport=80) response_packet = sr1(packet) flags = response_packet[TCP].flags print(flags)In this example, we're sending a TCP packet and receiving the response as before. However, we're then extracting the TCP flags from the response packet and printing them to the console. Overall, these examples demonstrate the power and flexibility of Scapy's TCP module.