Chapter 2: Getting Comfortable with Kali Linux Flashcards
What command is used to view manuals?
man
What command is used to search for keywords amongst manuals?
man -k
Using regular expressions how can we narrow the search for the man keyword?
man -k ‘^passwd$’
What does apropos do?
Search for keywords amongst manual page descriptions.
What does ls, the -a and -l switches do?
ls shows the directory contents. -a shows all files and -l displayed each file on a separate line (good for automation).
What does pwd do?
Print working directory.
What does cd do?
Change directory
What does mkdir do? How do we make multiple folders and subfolders at once?
mkdir makes a file or directory. To create multiple at once use mkdir -p test{test1,test2,test3}
What does the which command do?
Searches for files in the PATH variable
How do you look at the $PATH variable
echo $PATH
What does the locate command do and why is it unique? How do we update the database?
It searches for files in kali and is updated through a database to shorten waiting time.
We update the database through sudo updatedb
How do we use the find command? Use an example
find
find / -name sbd*
find is the command, / is the directory (root) -name is the switch and sbd* is the keyword.
How do we start the ssh service?
sudo systemctl start ssh
How do we verify sshd has started one we’ve used the systemctl command?
sudo ss -antlp | grep sshd
How do we enable ssh to run on start up?
sudo systemctl enable ssh
How do we start apache/HTTP service?
sudo systemctl start apache2
How do we verify that apache has started?
sudo ss -antlp | grep apache
How do we allow apache2 to start at boot time?
sudo systemctl enable apache2
How do we show a list showing all services that can be used with systemctl?
systemctl list-unit-files
How do we update the APT (advanced package tool) cache for faster installation?
sudo apt update
How do we upgrade using apt?
sudo apt upgrade
How do we upgrade a single program?
sudo apt upgrade
e.g. sudo apt upgrade metasploit-framework
What is apt cache, how do we use it?
apt-cache stores information on potential upgrades.
To see if a particular program is present, use apt-cache search pure-ftpd
How do we install using apt?
sudo apt install
What are the two commands that remove programs and what is the difference?
sudo apt remove
sudo apt remove –purge
apt remove removes the programs core files but keeps configuration files (user settings etc).
purge will remove everything to do with the program.
What is dpkg and how does it differ to apt?
dpkg is the core tool used to install packages either through apt or without.
it is unique in that it doesn’t require the internet in order to do it’s job.