312-50V13 practice question 17 of 35
By performing a penetration test, you gained access under a user account. During the test, you established a connection with your own machine via the SMB service and occasionally entered your login and password in plaintext. Which file do you have to clean to clear the password?
Full set: 573 questionsDomain System Hacking Phases and Attack Techniques
The .bashhistory file, located in a user's home directory, is the default file used by the Bash shell to log the commands executed by that user. When a user types a command that includes sensitive information in plaintext, such as a password for an SMB connection (smbclient //server/share -U user%password), the entire command string is saved in this file. To remove evidence of this action and the exposed password, a penetration tester must edit or clear the contents of the .bashhistory file. This is a critical step in post-exploitation cleanup.
A. .Xsession-log: This file logs output and errors from the X Window System session startup, not the user's interactive shell commands.
B. .bashrc: This is a shell script that contains user-specific configurations and functions that are executed when an interactive Bash shell starts.
C. .profile: This is a configuration file executed for login shells, primarily used to set environment variables for the user's session.
1. GNU Project
Bash Reference Manual. Section 8.2
"Bash History Facilities
" specifies that when an interactive shell exits
the command history is saved to the file designated by the HISTFILE variable
which defaults to ~/.bashhistory.
Source: Free Software Foundation
Inc. (2022). Bash Reference Manual
for Bash version 5.2. Section 8.2. Retrieved from https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Bash-History-Facilities
2. Carvey
H. (2012). Windows Forensic Analysis Toolkit
Fourth Edition. While focused on Windows
Chapter 1 discusses attacker methodologies
including covering tracks. The principle of clearing command history is a universal concept in digital forensics and post-exploitation
with .bashhistory being the direct Linux equivalent of the artifacts discussed. The CEH curriculum covers both Windows and Linux environments.
Source: Carvey
H. (2012). Windows Forensic Analysis Toolkit
Fourth Edition. Syngress. (Principle of clearing command history as a post-exploitation step).
3. University of California
Berkeley
CS 161: Computer Security. Course materials on system security and forensics frequently identify shell history files as a primary artifact for investigators. Lecture notes and labs emphasize that files like .bashhistory contain a chronological record of a user's command-line activity
making them a key target for both attackers to clean and defenders to analyze.
Source: University of California
Berkeley. CS 161: Computer Security
Lecture 20: "Forensics". (Discusses system artifacts
including shell history).
Keep practicing
Take the free 312-50V13 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 312-50V13 practice questions
- Question 1Your network infrastructure is under a SYN flood attack. The attacker has crafted an auto…
- Question 2Robin, an attacker, is attempting to bypass the firewalls of an organization through the …
- Question 3In the context of password security, a simple dictionary attack involves loading a dictio…
- Question 4Email is transmitted across the Internet using the Simple Mail Transport Protocol. SMTP d…
- Question 5What is one of the advantages of using both symmetric and asymmetric cryptography in SSL/…
- Question 6Which Nmap switch helps evade IDS or firewalls?
