exam questions

Exam PT0-002 All Questions

View all questions & answers for the PT0-002 exam

Exam PT0-002 topic 1 question 6 discussion

Actual exam question from CompTIA's PT0-002
Question #: 6
Topic #: 1
[All PT0-002 Questions]

A penetration tester discovered a vulnerability that provides the ability to upload to a path via discovery traversal. Some of the files that were discovered through this vulnerability are:

Which of the following is the BEST method to help an attacker gain internal access to the affected machine?

  • A. Edit the discovered file with one line of code for remote callback.
  • B. Download .pl files and look for usernames and passwords.
  • C. Edit the smb.conf file and upload it to the server.
  • D. Download the smb.conf file and look at configurations.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Neolot
Highly Voted 2 years, 6 months ago
Selected Answer: A
Answer is A because the SMB.conf file won't give you internal access to the system, it would only be effective for Remote File Inclusion (RFI) which has already been achieved.
upvoted 14 times
yeahnodontthinkso
4 days, 19 hours ago
What annoys me about this question is that the penetration tester discovered "files" plural, but the supposed answer is "edit THE file" as if they've singled one out when they haven't. Thanks, CompTIA.
upvoted 1 times
...
...
RRabbit_111
Highly Voted 7 months, 1 week ago
Selected Answer: C
C. Edit the smb.conf file and upload it to the server. The URLs discovered by the penetration tester shows that the vulnerability allows an attacker to upload files to the path by using directory traversal. By editing the smb.conf file (smb is short for Server Message Block, a protocol for sharing files, printers, serial ports, and communications abstractions such as named pipes and mail slots between computers) and uploading it to the server, an attacker can modify the configurations of the SMB service and potentially gain internal access to the affected machine. Option A is not the best method because it would only allow the attacker to remotely callback and it doesn't provide internal access. Option B is not the best method because the files are scripts and they are unlikely to contain usernames and passwords. Option D is not the best method because it would only allow the attacker to see the configurations of the SMB service, it doesn't provide internal access.
upvoted 11 times
...
kinny4000
Most Recent 3 months, 2 weeks ago
Selected Answer: D
Modifying the SMB.conf file could result in total control over the system. The amount of options is quite high to the pentester, for example, he could create a public share mounted at the /root/.ssh/ directory and upload his public key into it, allow him full SSH root access into the device by writing the following - [ssh_backdoor] path = /root/.ssh writable = yes browsable = no guest ok = yes He could also simply change the guest login to default to a root user account by writing this - [global] guest account = root map to guest = Bad User ChatGPT is l33t h4x3r
upvoted 1 times
...
The_F00L
7 months, 1 week ago
Selected Answer: C
I had initially answered C. Option A just enables remote callback, not internal access, whereas misconfigured SMB can totally be used to get into a system. Because the ratio on this question seemed wrong I also asked ChatGPT to verify my suspicion: "editing the smb.conf file and uploading it to the server, is the BEST method to help an attacker gain internal access to the affected machine, as it allows the attacker to modify the server's configuration and potentially gain access to sensitive information or execute arbitrary code. The other options are not as effective, as downloading or editing the discovered .pl files may not lead to a significant security breach" Which is pretty much what I thought, so yeah. It's C
upvoted 3 times
...
cy_analyst
7 months, 1 week ago
Selected Answer: C
To carry out this attack, an attacker could follow these general steps: Use the vulnerability to traverse to the directory where the smb.conf file is located, which has been discovered in the given scenario. Download a copy of the smb.conf file to the attacker's machine. Modify the smb.conf file to include a backdoor user account, which will allow the attacker to remotely log into the system. Upload the modified smb.conf file back to the server, replacing the original file. Restart the Samba service to apply the changes. Use the backdoor user account to remotely log into the affected machine and gain internal access.
upvoted 3 times
...
solutionz
7 months, 1 week ago
Selected Answer: C
The question is presenting a scenario in which a vulnerability has been discovered that allows for directory traversal, and various files have been discovered as a result of this vulnerability. Among the files listed, one stands out as particularly interesting from a penetration testing perspective: the smb.conf file. The smb.conf file is used to configure Samba, a service that provides file and print services to SMB/CIFS clients. By either editing or examining this file, an attacker could potentially gain more information or access to the system. Among the options presented, option C, "Edit the smb.conf file and upload it to the server," would provide the best method for an attacker to potentially gain internal access to the affected machine. By modifying the smb.conf file, an attacker might be able to alter how Samba behaves, possibly opening up more vulnerabilities or providing direct access to internal resources. So the correct answer to this question would be: C. Edit the smb.conf file and upload it to the server.
upvoted 1 times
...
Rube210
7 months, 3 weeks ago
Selected Answer: D
smb.conf file: This file is crucial for managing Samba configurations, including access control, authentication, and file sharing. Downloading and analyzing it can reveal misconfigurations that could be exploited, making it a high-value target for attackers.
upvoted 2 times
...
fuzzyguzzy
8 months, 1 week ago
Selected Answer: A
A. Key phrase being "gain internal access". C would grant access to credentials and be able to change credentials, but if this would only be helpful with internal access.
upvoted 3 times
...
MeisAdriano
9 months ago
Selected Answer: A
not C: smb.conf it is in use by the daemon so you can’t overwrite it and you can’t upload in specific path. If you ignore you can’t overwrite it (or overwrite it and wait maybe a month when the service will be rebooted) and upload it in the specific canonical path, you could upload smb.conf in the canonical path, you could allow guest users to a specific directory… but too many limitations. Not D: To download smb.conf could be useful in information gathering but not in a specific attack for gain the access Not B: no one of the listed files seems contain usernames and passwords It is A: because I can change an existing file including a shell, a RAT, an exploit, to gain access of the machine and with discovery traversal I can execute this file.
upvoted 2 times
...
Etc_Shadow28000
10 months ago
Selected Answer: A
The BEST method for an attacker to gain internal access to the affected machine, given the vulnerability that allows path traversal and the files discovered, would be: A. Edit the discovered file with one line of code for remote callback. By editing one of the `.pl` (Perl) script files to include a remote callback, the attacker can execute arbitrary code on the server. This can provide the attacker with a foothold into the internal network, from which further attacks can be launched.
upvoted 2 times
...
lifehacker0777
2 years, 1 month ago
Selected Answer: A
Option A (edit the discovered file with one line of code for remote callback) may allow the tester to execute arbitrary code on the server if successful. However, this option may not provide long-term access to the machine and may be detected and blocked by security controls. Option C (edit the smb.conf file and upload it to the server) may allow the tester to modify the configuration of the machine to gain access. This option may be more effective in gaining long-term access and may be less likely to be detected by security controls.
upvoted 2 times
...
KingIT_ENG
2 years, 1 month ago
C is the correct answer
upvoted 1 times
...
KingIT_ENG
2 years, 1 month ago
D is correct
upvoted 1 times
...
kgboi
2 years, 1 month ago
Selected Answer: C
Answer is C.
upvoted 3 times
...
nickwen007
2 years, 1 month ago
The smb.conf file is a configuration file used by the Samba software packages. It is used to configure settings related to network access and sharing, and it is located in the folder "/etc/samba". Samba is a suite of open source software that allows Windows, Linux, and Mac systems to communicate and share files with each other. It uses the SMB protocol and is commonly used to access file shares on a network.
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago