Prerequisites for Terminal Lab
In this module, we'll go over some fundamental terminal commands and concepts you need to know before starting the quiz and lab exercises. By the end of this section, you'll be familiar with navigating the file system, creating and managing files and directories, and using basic network tools.
Terminal Basics
Navigating the File System
-
ls- List Directory ContentsThe
lscommand is used to list the contents of a directory. It shows files, directories, and sometimes hidden files, depending on the options used.ls # List files in the current directory ls / # List files in the root directory ls -a # List all files, including hidden ones ls -l # List files in a detailed format -
cd- Change DirectoryThe
cdcommand allows you to navigate between directories.cd /home # Change to the /home directory cd .. # Move up one directory level cd /usr/local # Move to the /usr/local directory -
pwd- Print Working DirectoryThe
pwdcommand displays the current directory you are in.pwd # Shows the current directory path -
mkdir- Create DirectoryUse
mkdirto create new directories.mkdir testDir # Creates a directory named testDir -
touch- Create a New FileThe
touchcommand creates an empty file or updates the timestamp of an existing file.touch newfile.txt # Creates a new file named newfile.txt
File Management
-
cp- Copy Files and DirectoriesThe
cpcommand copies files or directories from one location to another.cp source.txt destination.txt # Copy source.txt to destination.txt cp -r /source/dir /destination/ # Copy a directory recursively -
mv- Move or Rename Files and DirectoriesThe
mvcommand moves files or directories or renames them.mv oldname.txt newname.txt # Renames oldname.txt to newname.txt mv /old/path /new/path # Moves the directory from old to new path -
rm- Remove Files and DirectoriesUse
rmto delete files or directories. Be careful as this action is irreversible.rm file.txt # Deletes file.txt rm -r directory/ # Recursively deletes a directory and its contents
File Permissions
-
chmod- Change File PermissionsThe
chmodcommand changes the access permissions of files and directories.chmod 755 script.sh # Sets read, write, execute for owner; read, execute for group and others chmod u+x script.sh # Adds execute permission for the owner -
chown- Change File OwnershipThe
chowncommand changes the owner and group of files or directories.chown user:group file.txt # Changes the owner and group of file.txt
Networking Basics
-
ping- Test Network ConnectivityThe
pingcommand checks if a host is reachable over the network.ping google.com # Pings google.com -
traceroute- Trace Network PathThe
traceroutecommand shows the path packets take to reach a host.traceroute example.com # Shows the route to example.com -
tcpdump- Network Packet Analyzertcpdumpcaptures and analyzes network packets. This is useful for inspecting network traffic.tcpdump -i eth0 # Capture packets on interface eth0 -
tshark- Terminal-Based Wiresharktsharkis the terminal version of Wireshark, used for capturing and analyzing network traffic.tshark -i eth0 # Start capturing packets on interface eth0
Fingerprinting Basics
-
JA3, JA4, and JARM Fingerprinting
These are methods used to identify TLS client and server communications.
- JA3: Creates a fingerprint of the SSL/TLS client.
- JA4: Captures additional details in TLS handshakes.
- JARM: A method to identify servers based on TLS configurations.
ja3 # Capture and display JA3 fingerprint ja4 # Capture and display JA4 fingerprint jarm # Capture and display JARM fingerprint
Getting Started
Now that you have a basic understanding of the terminal commands and network tools, you can proceed to the terminal lab. Make sure to use the help command in the terminal to see all available commands and options.
Note: If you're unsure about a command or its usage, you can always refer back to this guide or use the
helpcommand in the terminal.
By mastering these basics, you'll be well-prepared for the terminal lab and quiz. Good luck!