Exam PT0-002 All QuestionsBrowse all questions from this exam
Question 110

A penetration tester finds a PHP script used by a web application in an unprotected internal source code repository. After reviewing the code, the tester identifies the following:

Which of the following combinations of tools would the penetration tester use to exploit this script?

    Correct Answer: B

    The given PHP script uses the shell_exec function to call a shell command with a parameter from user input without any sanitization. This presents an opportunity for command injection. To exploit this, cURL can be used to send HTTP POST requests with crafted payloads through the 'item' parameter. Netcat can be utilized to set up a listener to capture the output or establish a reverse shell. Hence, the correct tools to exploit this script are Netcat and cURL.

Discussion
ryanzouOption: B

B LOOKS LIKE correct

RRabbitOption: B

B. Netcat and cURL The penetration tester would use cURL to send a HTTP POST request to the script with a crafted parameter in the 'item' field, which would then be passed to the shell_exec function and executed on the server. Netcat could be used to listen for the response or output of the command execution. The other options listed (A, C, D) are not relevant to this specific script and exploit scenario.

2FishOption: B

B looks right. Check here for more context. https://www.examtopics.com/discussions/comptia/view/66651-exam-pt1-002-topic-1-question-51-discussion/

nickwen007Option: A

Hydra is a network security tool used for password cracking, while Crunch is a tool used to generate wordlists for brute-force attacks. Both tools can be useful in penetration testing when attempting to gain access to a system by guessing passwords.

[Removed]

Netcat and cURL B is correct

[Removed]

but that line of code (shell exec) is telling us we could place a reverse shell, trigger it with curl and receive the incoming connection via net at, so the answer is B

[Removed]Option: B

B is correct

Etc_Shadow28000Option: B

To exploit the given script, which seems to be vulnerable to command injection due to the use of shell_exec with unsanitized user input, the penetration tester would use tools that allow for sending crafted HTTP POST requests and capturing the responses. The best combination of tools for this purpose is: B. Netcat and cURL Explanation: • Netcat (nc): Netcat is a versatile networking tool that can be used to read from and write to network connections using TCP or UDP. It can be useful for setting up a listener to catch the output of an exploited command injection. • cURL: cURL is a command-line tool for transferring data with URLs. It can be used to send HTTP POST requests to the target web application, injecting the payload into the item parameter.

cy_analystOption: A

Use Crunch to generate a wordlist of potential payloads for the 'item' parameter in the vulnerable PHP script. The wordlist should contain a large number of possible values for the parameter, including variations and combinations of characters that an attacker may try to inject as commands. Use Hydra to automate the process of sending HTTP POST requests to the vulnerable PHP script with different payloads for the 'item' parameter. Hydra should be configured to use the wordlist generated by Crunch as the list of possible payloads. Monitor the responses from the server to identify successful command injections. If the attacker finds a payload that successfully injects a command and executes it on the server, they can use this to gain further access to the system and carry out other attacks.

KingIT_ENG

The penetration tester would use cURL to send a HTTP POST request to the script with a crafted parameter in the 'item' field, which would then be passed to the shell_exec function and executed on the server. Netcat could be used to listen for the response or output of the command execution. The other options listed (A, C, D) are not relevant to this specific script and exploit scenario.

KingIT_ENG

It’s b, here’s why: echo shell exec("/http/www/cgi-bin/queryitem <—— This line indicates you can execute a shell if you wanted to. Netcat is for you to open your listener nc -nlvp and receive the shell, in order for you to execute the webshell, you need you make a request via curl.

KingIT_ENG

https://www.google.com/url?sa=t&source=web&rct=j&url=https://www.examtopics.com/discussions/comptia/view/66651-exam-pt1-002-topic-1-question-51-discussion/&ved=2ahUKEwiktpX7uOL9AhVO3qQKHU6aBycQFnoECAgQAQ&usg=AOvVaw1e_vh_XdbkdXtGU0WN6NYb Check

cy_analyst

In my field we don't use the public internet to find answers for advance topics, only the best books from best authors. For example one thing to consider is there are more than one answers to a problem. Bye.

b0ad9e1

And yet, here you are on a brain dump site. What a goofball.