PT0-003 · Question #295
PT0-003 Question #295: Real Exam Question with Answer & Explanation
The correct answer is B: Insert the following line before line 6: target = target.split(" ")[0]. f.readlines() returns each line including trailing newline and any extra fields (labels). Given targets.txt lines contain URL followed by a label separated by whitespace, target will contain Splitting the line on whitespace and taking the first element (target.split(" ")[0] or be
Question
During an engagement, a penetration tester receives a list of target systems and wants to enumerate them for possible vulnerabilities. The tester finds the following script on the internet: After running the script, the tester runs the following command: Which of the following should the tester do next?
Options
- AReplace line 4 with the following: api = "/api/v2/getToken/data/id/None"
- BInsert the following line before line 6: target = target.split(" ")[0]
- DReplace line 7 with the following: response = requests.post(url, api)
Explanation
f.readlines() returns each line including trailing newline and any extra fields (labels). Given targets.txt lines contain URL followed by a label separated by whitespace, target will contain Splitting the line on whitespace and taking the first element (target.split(" ")[0] or better removes the descriptive label and newline so the resulting url is valid.
Topics
Community Discussion
No community discussion yet for this question.