ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 252 - PT0-002 discussion

Report
Export

A penetration tester opened a reverse shell on a Linux web server and successfully escalated privileges to root. During the engagement, the tester noticed that another user logged in frequently as root to perform work tasks. To avoid disrupting this user's work, which of the following is the BEST option for the penetration tester to maintain root-level persistence on this server during the test?

A.
Add a web shell to the root of the website.
Answers
A.
Add a web shell to the root of the website.
B.
Upgrade the reverse shell to a true TTY terminal.
Answers
B.
Upgrade the reverse shell to a true TTY terminal.
C.
Add a new user with ID 0 to the /etc/passwd file.
Answers
C.
Add a new user with ID 0 to the /etc/passwd file.
D.
Change the password of the root user and revert after the test.
Answers
D.
Change the password of the root user and revert after the test.
Suggested answer: C

Explanation:

The best option for the penetration tester to maintain root-level persistence on this server during the test is to add a new user with ID 0 to the /etc/passwd file. This will allow the penetration tester to use the same user account as the other user, but with root privileges, meaning that it won't disrupt the other user's work. This can be done by adding a new line with the username and the numerical user ID 0 to the /etc/passwd file. For example, if the username for the other user is "johndoe", the line to add would be "johndoe:x:0:0:John Doe:/root:/bin/bash". After the user is added, the penetration tester can use the "su" command to switch to the new user and gain root privileges.

asked 02/10/2024
BISWARUP KUNDU
41 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first