Weekend Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmasmnth

During a security assessment, a penetration tester decides to implement a simple TCP port scanner...

During a security assessment, a penetration tester decides to implement a simple TCP port scanner to check the open ports from 1000 to 2000. Which of the following Python scripts would achieve this task?

A.

fori in range(1000, 2001): s = socket(AF_INET, SOCK_STREAM)

conn = s.connect_ex((host_IP, i))

if (conn == 0):

print(fPort {i} OPEN’)

B.

close ()

C.

fori in range(1001, 2000): s = socket(AF_INET, SOCK_STREAM) conn = s.connect—ex((host_IP, i)) if (conn == 0): print (f'Port {i} OPEN’) s.close ()

D.

fori in range(1000, 2001): s = socket(AF—INET, SOCK_DGRAM) conn = s.connect—ex((host_IP, i)) if (conn == 0): print(f’Port {i} OPEN’) s.close ()

E.

fori in range (1000, 2000): s = socket(SOCK_STREAM, AF_INET) conn = s.connect—ex((host—IP, i)) if (conn == 0): print (f'Port {i} OPEN') s.close()

CompTIA PT0-002 Summary

  • Vendor: CompTIA
  • Product: PT0-002
  • Update on: Sep 6, 2025
  • Questions: 464
Price: $52.5  $149.99
Buy Now PT0-002 PDF + Testing Engine Pack

Payments We Accept

Your purchase with ExamsVCE is safe and fast. Your products will be available for immediate download after your payment has been received.
The ExamsVCE website is protected by 256-bit SSL from McAfee, the leader in online security.

examsvce payment method