Upgrade VM
sudo apt update
- downloads package information from all configured sources.
sudo apt upgrade
- will upgrade all installed packages to their latest versions.
sudo apt-get autoremove
- deletes orphaned packages, or dependencies that remain installed after you have installed an application and then deleted it.
sudo apt-get clean
- removes all packages from the cache.
Setup Environment
- GNU Development Tools Packages:
sudo apt install build-essential gcc make perl dkms
- Install netcat:
sudo apt-get install netcat
- Install networking tools:
sudo apt install net-tools
- Visual Studio Code:
sudo snap install --classic code
- Sublime:
sudo snap install sublime-text --classic
- clion:
sudo snap install clion --classic
- Test Setup:
- List Network Adapters: list-network-adapters.c
- Compile with
gcc list-network-adapters.c -o list-network-adapters
- Run with
./list-network-adapters
Install Wireshark
sudo apt-get install wireshark
sudo dpkg-reconfigure wireshark-common
sudo adduser $USER wireshark
sudo chmod +x /usr/bin/dumpcap
Install Python
sudo apt-get install python3
- Run a webserver:
python3 -m http.server 8000
File Commands and Directory Navigation
cd
go to $HOME directory.
cd ...
go one level up the directory tree.
cd /etc
to change to the /etc directory.
ls
list all files.
- Use
-R
to list all-subdirectories as well
-a
will list hidden files as well
- Use the
-al
argument to view details
pwd
lists the present working directory.
mkdir directory
created a directory.
rm -r directory
removes the directory and its contents recursively. Use the f
argument to forcefully remove, re: rm -rf directory
.
touch file
will create an empty file.
rm file
removes a flle.
cp file file2
will copy file to file2.
mv file file2
renames or moves file to file2.
cat filename
will display the contests of filename.
cat > filename
creates a new file with filename.
Networking
ifconfig -a
displays all network interfaces and IP address.
hostname -I
displays the IP addresses of the host (all local IP addresses).
host domain
displays IP address for domain.
ping host
sends ICMP echo request to host.
whois domain
displays whois records for domain.
dig domain
displays DNS information for domain.
dig -x IP
does reverse lookup of IP address.
nslookup
query Internet name servers interactively.
- To display the IP/kernel routing table:
netstat -rn
ip route
route -n
Socket
- tcp_server.c
- Why 14 on line 61?
- Display Client Data?
- Create a new server or update to handle HTTP requests.