What does writing echo do?
echo Output any text that we provide
How do you find out which user you are logged in as?
whoami Find out what user we’re currently logged in as!
How do you list contents of directory with privileges? How do you include hidden files?
ls -l
ls listing
ls -a for hidden files
How do you move in and out of a directory?
cd
cd ..
cd /dir/
How do you list the contents of a file?
cat file.txt
How do you show your current working directory?
pwd
print working directory
How do you find a specific file in among different directories?
find -name specificfile.txt
How do you find a specific TYPE of file in among different directories?
find -name *.txt
How do you find a specific entry in a long file, like an IP address in a .log file?
grep “(what you’re looking for)” (file of contents).log
grep “81.143.211.90” access.log
How do you write text into an empty file using the command line?
echo (content) > (filename)
cat (content) > (filename)
echo hey > welcome
> > to keep the contents of the file without overwriting them
What is SSH and how does it work? How does SSH authenticate users, and how does this authentication work?
Secure Shell is a network communication protocol.
SSH employs encryption to ensure that hackers cannot interpret the traffic between two connected devices.
The ssh command provides a secure encrypted connection between two hosts over an insecure network. This connection can also be used for terminal access, file transfers, and for tunneling other applications. Graphical X11 applications can also be run securely over SSH from a remote location.
AUTHENTICATION
TCP based connection, 3 way handshake.
SSH daemon must be running in order to use this protocol on both sides of the communication. I.E, listening on a port for inbound SSH connections.
SSH authenticates users by using passwords or SSH keys. SSH passwords can be easily breached.
SIMPLER EXPLANATION
An SSH key relies upon the use of two related keys, a public key and a private key, that together create a key pair that is used as the secure access credential. The private key is secret, known only to the user, and should be encrypted and stored safely. The public key can be shared freely with any SSH server to which the user wishes to connect. These keys are normally managed by an organization’s IT team, or better yet, with the help of a trusted Certificate Authority (CA) to ensure they are stored safely.
What is ARP? How does it function (1)? How can it be abused?
ARP stands for Address Resolution Protocol. It is used to discover MAC addresses and map them to IP addresses for LAN communications.
operating on layer 2 of the OSI7 and TCP/IP as it deals with MAC addressing
ARP can be abused via ARP cache poisoning
You can use bettercap ARP spoof feature which will send arbitrary ARP packets to intended victims, allowing you to impersonate any device on the LAN (default gateway being the prime target to imitate)
How do you usually install the requirements for a particular package off github?
Pip.
python3 -m pip install filename.txt
How do you quickly view the history of your commands from a terminal session?
History
How do you make a new directory?
mkdir *
How do you delete a directory? How do you remove a directory if it isn’t empty?
rmdir *
rm -r
How do you get the current system details such as OS version?
hostnamectl
Detailed
uname -a
OS version and build of machine
How do you display free memory of the system?
free -m
sounds like “free -memory”
How do you display the running processes in a system?
top
htop
sounds like “top processes”
How do you display all ports the machine is listening on?
netstat
How do you list the contents of your current working directory with permissions? How do you do this for a specific file?
ls -l filename
How do you allow a file to be ran by every user? How do you allow to read, write and execute?
chmod 777 filename
How do you allow a file to be read and written by every user but not executed?
chmod 766 filename
How do you add another user?
useradd username