PT0-002 · Question #393
PT0-002 Question #393: Real Exam Question with Answer & Explanation
The correct answer is D: Port scan. {"question_number": 8, "question": "What task could be accomplished with the described script?", "correct_answer": "D. Port scan", "explanation": "A port scanning script typically uses socket programming to attempt TCP connections (or send probes) to a range of port numbers on a
Question
Given the following code: Which of the following tasks could be accomplished with the script?
Options
- AReverse shell
- BPing sweep
- CFile download
- DPort scan
Explanation
{"question_number": 8, "question": "What task could be accomplished with the described script?", "correct_answer": "D. Port scan", "explanation": "A port scanning script typically uses socket programming to attempt TCP connections (or send probes) to a range of port numbers on a target host. In Python, this commonly involves a loop over port numbers, creating a socket, calling connect() or connect_ex(), and checking whether the connection succeeds or fails. If it succeeds, the port is open; if it fails/times out, the port is closed or filtered. This is fundamentally different from a reverse shell (which opens a persistent connection and redirects stdin/stdout), a ping sweep (which uses ICMP across multiple hosts), or a file download (which uses HTTP/FTP protocols to retrieve data). The pattern of iterating ports and testing connectivity is the signature of a port scanner.", "generated_by": "claude-sonnet", "llm_judge_score": 4}
Topics
Community Discussion
No community discussion yet for this question.