#!/usr/bin/env python
try:
    from scapy.all import *
except:
    sys.exit("Instale a biblioteca scapy : pip install scapy")

if len(sys.argv) != 2:
    sys.exit("De um argumento ao menos. Sendo ele o ip")

ip = sys.argv[1]
dst_port = 80
headers = IP(dst=ip)/TCP(dport=dst_port, flags="S")
answers,unanswers=sr(headers,timeout=5)

for a in answers:
    print(a[1][1].flags)