nerdexam
GIAC

GPEN · Question #485

What will the following scapy commands do?

The correct answer is D. Perform a SYN-ACK scan against TCP ports 80 and 8080 for all hosts on the192.16S.1.0/24. The scapy commands send SYN-ACK flagged TCP packets to ports 80 and 8080 across all hosts in a /24 subnet.

Vulnerability Discovery & Scanning

Question

What will the following scapy commands do?

Options

  • APerform a SYN-ACK scan against TCP ports 80 and 3080 on host 192.168.1.24.
  • BPerform a SYN scan against ports 80 through 8080 for all hosts on the192.168.1.0/24
  • CCombine the answered and unanswered results of a previous scan into the sr(packet)variable.
  • DPerform a SYN-ACK scan against TCP ports 80 and 8080 for all hosts on the192.16S.1.0/24

How the community answered

(39 responses)
  • A
    10% (4)
  • B
    3% (1)
  • C
    5% (2)
  • D
    82% (32)

Why each option

The scapy commands send SYN-ACK flagged TCP packets to ports 80 and 8080 across all hosts in a /24 subnet.

APerform a SYN-ACK scan against TCP ports 80 and 3080 on host 192.168.1.24.

Port 3080 does not appear in the command - the targeted ports are 80 and 8080, so this choice has an incorrect port number.

BPerform a SYN scan against ports 80 through 8080 for all hosts on the192.168.1.0/24

The flags='SA' parameter specifies SYN-ACK packets, not SYN-only packets, and the port list [80, 8080] is a discrete set, not a contiguous range from 80 through 8080.

CCombine the answered and unanswered results of a previous scan into the sr(packet)variable.

The sr() function actively sends packets and returns a tuple of answered and unanswered results from that transmission - it does not merge or combine results from a previously executed scan.

DPerform a SYN-ACK scan against TCP ports 80 and 8080 for all hosts on the192.16S.1.0/24Correct

The command uses IP(dst='192.168.1.0/24') to iterate over all hosts in the subnet and TCP(dport=[80,8080], flags='SA') to send SYN-ACK probes to exactly two discrete ports. The 'SA' flag combination specifies SYN-ACK, distinguishing this from a standard SYN scan. Ports 80 and 8080 are listed individually, not as a sequential range, confirming that only those two specific ports are targeted.

Concept tested: Scapy SYN-ACK subnet scan with discrete port targeting

Source: https://scapy.readthedocs.io/en/latest/usage.html#sending-and-receiving-packets

Topics

#Scapy#SYN scan#Python scripting#network scanning

Community Discussion

No community discussion yet for this question.

Full GPEN Practice