exam questions

Exam CS0-002 All Questions

View all questions & answers for the CS0-002 exam

Exam CS0-002 topic 1 question 128 discussion

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

An organization is experiencing security incidents in which a systems administrator is creating unauthorized user accounts. A security analyst has created a script to snapshot the system configuration each day. Following is one of the scripts: cat /etc/passwd > daily_$(date +"%m_%d_%Y")
This script has been running successfully every day. Which of the following commands would provide the analyst with additional useful information relevant to the above script?

  • A. diff daily_11_03_2019 daily_11_04_2019
  • B. ps ג€"ef | grep admin > daily_process_$(date +%m_%d_%Y")
  • C. more /etc/passwd > daily_$(date +%m_%d_%Y_%H:%M:%S")
  • D. la ג€"lai /usr/sbin > daily_applications
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
f3lix
Highly Voted 2 years, 5 months ago
Selected Answer: B
Guys dont make a mistake, B is the answer to this question. The question is asking to see more information about the running script. it'll be ps -ef | grep "the script, i.e python" ... with this, you can see how long the script has been running for, the storage location of the capture, size and the time the script started etc. I do this on daily basis so I know. Answer is afirmative B!!
upvoted 8 times
aleXplicitly
2 years, 4 months ago
My guy, the script is bash not python… all the analyst is doing is outputting the /etc/passwd file to different files differentiated by each day. So the only logical thing he would do is to view the diff of 2 files to see which users are created each day. Why would viewing processes help the analyst in solving the problem with sysadmins creating unnecessary accounts.
upvoted 10 times
...
...
RobV
Most Recent 1 year, 6 months ago
Selected Answer: B
Answer is B.
upvoted 1 times
...
32d799a
1 year, 7 months ago
Selected Answer: A
Option B is focused on monitoring processes containing the term "admin" but is not directly related to changes in user accounts. To address the security incidents where unauthorized user accounts are being created, you would want to compare the snapshots of the /etc/passwd file on different days to identify any changes. Therefore, the most relevant command is: A. diff daily_11_03_2019 daily_11_04_2019
upvoted 2 times
...
chaddman
1 year, 8 months ago
Command A: diff daily_11_03_2019 daily_11_04_2019 This command compares the snapshots of the /etc/passwd file on two different days to find any differences. This could potentially highlight unauthorized user account creation by showing what changed between these two snapshots.
upvoted 1 times
...
Xoomalla
1 year, 10 months ago
My Guy (Just kidding ), Your answer would convince me if the word admin is not there. Why greping for admin? administrator can be root or Xoomalla or F3lix.
upvoted 1 times
...
naleenh
1 year, 10 months ago
Selected Answer: B
The command in option B (ps -ef | grep admin > daily_process_$(date +%m_%d_%Y")) would provide the analyst with additional useful information relevant to the script. This command uses the ps command to list all running processes (-ef flag) and then pipes the output to grep to search for processes containing the keyword "admin." The results are then redirected to a file named with the current date in the filename.
upvoted 1 times
...
Sleezyglizzy
1 year, 11 months ago
B most logical to me
upvoted 1 times
...
tutita
2 years ago
Selected Answer: B
A doesn't seen right, you are comparing 2 dates which are not stated above in the questions, and also what about the other days? I think running the command ps to see the processes make more sense and adds additional information
upvoted 2 times
...
HereToStudy
2 years, 2 months ago
Selected Answer: B
A compares two different snapshots of the /etc/passwd file, which could be useful for identifying changes to the user account database over time but would not provide any information about specific processes or user activity.
upvoted 1 times
...
[Removed]
2 years, 3 months ago
Selected Answer: A
Diff Daily duh
upvoted 1 times
...
101martin101
2 years, 3 months ago
Selected Answer: A
The script cat /etc/passwd > daily_$(date +"%m_%d_%Y") creates a daily snapshot of the /etc/passwd file, which contains information about user accounts on the system. The script captures this information and saves it in a file named daily_<date>. To gather additional useful information relevant to the above script, the security analyst could run the following command: A. diff daily_11_03_2019 daily_11_04_2019 This command would compare the contents of the daily_11_03_2019 and daily_11_04_2019 files and show any differences. This would help the analyst identify any unauthorized changes to user accounts that may have been made between those two days.
upvoted 2 times
...
AC6280
2 years, 4 months ago
Selected Answer: B
So the question is presented as, the analyst is doing something each day (over some period of time) to gather information. I initially thought A, but that command only words for a single day as others have pointed out. I think this is CompTIA trying to trick you by giving a command that seems very useful (and honestly I would do A in real life but) but only works in that one instance (why not use the variables for that day in the script?). B allows you to output the running processes each day running under the security context of admin. Maybe there's a rogue process that has elevated it's permissions. But by reviewing the processes each day, you can see what 'admin' is doing, so if there's a funny process or port that sticks out, you can investigate further.
upvoted 1 times
khrid4
2 years, 3 months ago
"additional useful information relevant to the above script" I am not sure if I can comprehend the keyword above directly but I think only A makes the most relevance for the existing script. While others is more relevant to conducting further investigation.
upvoted 1 times
...
...
aleXplicitly
2 years, 4 months ago
Selected Answer: A
Viewing the diff of each day will help the analyst figure out which accounts were created by the sysadmins…
upvoted 1 times
...
db97
2 years, 4 months ago
Selected Answer: A
I tested this on my home lab and the "A" seems to be most logic/useful one. The diff command will show you the output of why file1.txt is different of file2.txt. For example: echo "test" >> file1.txt echo "test" >> file2.txt echo "something else" >> file1.txt diff file1.txt file2.txt --> output will be: "something else" And that would be useful for the security analyst and figure out if new accounts were added from one day to another.
upvoted 3 times
...
Cock
2 years, 4 months ago
Selected Answer: A
The command "diff daily_11_03_2019 daily_11_04_2019" would be useful in this scenario because it compares two files and outputs the differences between them. By comparing the /etc/passwd file snapshots taken on different dates, the analyst could identify any unauthorized user accounts that were added or removed over time, which would help with their investigation into the security incidents.
upvoted 3 times
sudoaptgoaway
1 year, 9 months ago
Good point cock.
upvoted 2 times
...
...
IanRogerStewart
2 years, 5 months ago
Selected Answer: A
While it would require changing each day, A is the only one that makes sense. B is only going to pull out processes with the word "admin" in them (why would that be useful?). C & D are nonsense.
upvoted 1 times
...
knister
2 years, 5 months ago
Selected Answer: B
f3lix all the way
upvoted 3 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 ...