ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 35 - PT0-002 discussion

Report
Export

A penetration tester gains access to a system and establishes persistence, and then runs the following commands:

cat /dev/null > temp

touch -r .bash_history temp

mv temp .bash_history

Which of the following actions is the tester MOST likely performing?

A.
Redirecting Bash history to /dev/null
Answers
A.
Redirecting Bash history to /dev/null
B.
Making a copy of the user's Bash history for further enumeration
Answers
B.
Making a copy of the user's Bash history for further enumeration
C.
Covering tracks by clearing the Bash history
Answers
C.
Covering tracks by clearing the Bash history
D.
Making decoy files on the system to confuse incident responders
Answers
D.
Making decoy files on the system to confuse incident responders
Suggested answer: C

Explanation:

The commands are used to clear the Bash history file of the current user, which records the commands entered in the terminal. The first command redirects /dev/null (a special file that discards any data written to it) to temp, which creates an empty file named temp. The second command changes the timestamp of temp to match that of .bash_history (the hidden file that stores the Bash history). The third command renames temp to .bash_history, which overwrites the original file with an empty one. This effectively erases any trace of the commands executed by the user.

Reference: https://null-byte.wonderhowto.com/how-to/clear-logs-bash-history-hacked-linuxsystems-cover- your-tracks-remain-undetected-0244768/

asked 02/10/2024
Miguel Tuimil Galdo
40 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first