- A
Use Wireshark on the limited shell to capture SSH traffic and extract credentials
Why wrong: Wireshark requires root privileges and a GUI, which are unlikely available on the limited shell.
- B
Perform a port knocking sequence to open SSH access to the target server
Why wrong: There is no evidence of port knocking in the scenario.
- C
Craft an HTTP request to the web portal's authentication script with a path traversal payload to read the password file
If the script is vulnerable to path traversal, you can read the password file and crack hashes.
- D
Use Hydra to brute-force SSH credentials from the limited shell because it is on the same VLAN
Why wrong: SSH only allows connections from the management subnet, so brute-forcing from a different subnet will be blocked.
Quick Answer
The correct action is to craft an HTTP request to the web portal’s authentication script with a path traversal payload to read the password file. This works because a path traversal exploit allows an attacker to manipulate file paths in the application’s input, such as using “../” sequences to escape the intended directory and read arbitrary files like /etc/passwd or the flat file database storing hashed credentials. On the CompTIA PenTest+ PT0-002 exam, this scenario tests your ability to identify web application vulnerabilities in a network context, often disguised by SSH restrictions or limited shell access—a common trap is to focus on network-level attacks like brute-forcing when the real vector is application-layer. Remember the key insight: if you can reach the web portal, you can exploit its input validation flaws regardless of SSH restrictions. A useful memory tip is “Traverse the path, not the network”—path traversal bypasses access controls by manipulating file paths, not ports.
PT0-002 Tools and Code Analysis Practice Question
This PT0-002 practice question tests your understanding of tools and code analysis. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
During a penetration test of a corporate network, you discover a Linux server running a custom Python application that handles authentication for a web portal. The server is configured to allow SSH access only from a specific management subnet. You have obtained a limited shell on a different host within the same VLAN as the target server. From your limited shell, you can reach the target server on TCP port 22, but you do not have valid credentials. The Python authentication script uses a flat file database to store user credentials in the format 'username:hashed_password'. You suspect the script has a vulnerability that allows reading arbitrary files, such as the password file. Which of the following actions should you take to exploit this vulnerability?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
Craft an HTTP request to the web portal's authentication script with a path traversal payload to read the password file
Option C is correct because a path traversal vulnerability in the authentication script can be used to read arbitrary files, including the password file, allowing you to extract hashes. Option A is wrong because brute-forcing SSH without knowing the management subnet source is unlikely to succeed and may be blocked. Option B is wrong because port knocking is not indicated in the scenario. Option D is wrong because Wireshark is not available from the limited shell and would require local privilege escalation.
Key principle: Authentication proves identity; authorization controls what that identity can do after login. Both must work for full privileged access.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use Wireshark on the limited shell to capture SSH traffic and extract credentials
Why it's wrong here
Wireshark requires root privileges and a GUI, which are unlikely available on the limited shell.
- ✗
Perform a port knocking sequence to open SSH access to the target server
Why it's wrong here
There is no evidence of port knocking in the scenario.
- ✓
Craft an HTTP request to the web portal's authentication script with a path traversal payload to read the password file
Why this is correct
If the script is vulnerable to path traversal, you can read the password file and crack hashes.
Related concept
Authentication checks who the user is.
- ✗
Use Hydra to brute-force SSH credentials from the limited shell because it is on the same VLAN
Why it's wrong here
SSH only allows connections from the management subnet, so brute-forcing from a different subnet will be blocked.
Common exam traps
Common exam trap: authentication is not authorization
Logging in proves the user can authenticate. It does not automatically mean the user is allowed to enter privileged or configuration mode. Watch for AAA authorization, privilege level and command authorization details.
Trap categories for this question
Scenario analysis trap
There is no evidence of port knocking in the scenario.
Detailed technical explanation
How to think about this question
This kind of question is testing the difference between identity and permission. A user may successfully log in to a router because authentication is working, but still fail to enter configuration mode because authorization is missing, misconfigured or mapped to a lower privilege level.
KKey Concepts to Remember
- Authentication checks who the user is.
- Authorization controls what the user is allowed to do after login.
- Privilege levels affect access to EXEC and configuration commands.
- AAA, TACACS+ and RADIUS can separate login success from command access.
TExam Day Tips
- Do not assume successful login means full administrative access.
- Look for words such as cannot enter configuration mode, privilege level, authorization or command access.
- Separate login problems from permission problems before choosing the answer.
Key takeaway
Authentication proves identity; authorization controls what that identity can do after login. Both must work for full privileged access.
Real-world example
How this comes up in practice
A developer is choosing between AES-256 (symmetric) and RSA-2048 (asymmetric) for encrypting a large file that will be sent to a partner. Symmetric encryption is fast but requires key exchange; asymmetric is slower but solves the key distribution problem. A hybrid approach — encrypt the file with AES, encrypt the AES key with RSA — is standard. Questions like this test whether you understand when each approach applies.
What to study next
Got this wrong? Here's your next step.
Review Cisco AAA concepts — authentication, authorization, and accounting. Study privilege levels (0–15), command authorization under TACACS+, and how RADIUS differs. Then practise related PT0-002 questions on access control and AAA configuration.
- →
Tools and Code Analysis — study guide chapter
Learn the concepts, then practise the questions
- →
Tools and Code Analysis practice questions
Targeted practice on this topic area only
- →
All PT0-002 questions
509 questions across all exam domains
- →
CompTIA PenTest+ PT0-002 study guide
Full concept coverage aligned to exam objectives
- →
PT0-002 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related PT0-002 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Planning and Scoping practice questions
Practise PT0-002 questions linked to Planning and Scoping.
Information Gathering and Vulnerability Scanning practice questions
Practise PT0-002 questions linked to Information Gathering and Vulnerability Scanning.
Attacks and Exploits practice questions
Practise PT0-002 questions linked to Attacks and Exploits.
Reporting and Communication practice questions
Practise PT0-002 questions linked to Reporting and Communication.
Tools and Code Analysis practice questions
Practise PT0-002 questions linked to Tools and Code Analysis.
PT0-002 fundamentals practice questions
Practise PT0-002 questions linked to PT0-002 fundamentals.
PT0-002 scenario practice questions
Practise PT0-002 questions linked to PT0-002 scenario.
PT0-002 troubleshooting practice questions
Practise PT0-002 questions linked to PT0-002 troubleshooting.
Practice this exam
Start a free PT0-002 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this PT0-002 question test?
Tools and Code Analysis — This question tests Tools and Code Analysis — Authentication checks who the user is..
What is the correct answer to this question?
The correct answer is: Craft an HTTP request to the web portal's authentication script with a path traversal payload to read the password file — Option C is correct because a path traversal vulnerability in the authentication script can be used to read arbitrary files, including the password file, allowing you to extract hashes. Option A is wrong because brute-forcing SSH without knowing the management subnet source is unlikely to succeed and may be blocked. Option B is wrong because port knocking is not indicated in the scenario. Option D is wrong because Wireshark is not available from the limited shell and would require local privilege escalation.
What should I do if I get this PT0-002 question wrong?
Review Cisco AAA concepts — authentication, authorization, and accounting. Study privilege levels (0–15), command authorization under TACACS+, and how RADIUS differs. Then practise related PT0-002 questions on access control and AAA configuration.
What is the key concept behind this question?
Authentication checks who the user is.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 23, 2026
This PT0-002 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PT0-002 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.