Attacks and Exploits
In Scapy, a tester builds pkt = IP(dst="10.0.0.5")/TCP(dport=80, flags="S") and needs the first reply returned to a variable so its flags can be inspected. Which function should be used?
Show the answer
Correct answerB. sr1(pkt)
AWhy not this: Only captures traffic; it never transmits the crafted SYN.
BWhy this is right: Sends at layer 3 and returns the first reply packet for inspection.
CWhy not this: Transmits at layer 3 but does not wait for or return replies.
DWhy not this: Works at layer 2, needs an Ether header, and returns no reply.
sr1() sends a layer 3 packet and returns the first answer. send() transmits at layer 3 but returns no reply, so the response is never available to inspect.