Catatan ini ditujukan untuk mempermudah pencarian perintah-perintah dasar Linux untuk keperluan Pentesting/VA.Cheatsheet ini disadur dari akun Github rekan saya Satrya Mahardhika.
ls
ls -la // Print out all files including hidden files
which nmap // Locate the full path of nmap
man which // Manual page of which Command
man -K "change password" // Search for command to change password
locate -i passwd // Find for passwd files with case-Insensitive
wget http://<IP>:<Port>/access_log.txt
cat access_log.txt
head access_log.txt
less access_log.txt
cp access_log.txt access_log.txt.backup
mv access_log.txt exercise.txt
grep admin exercise.txt
wc exercise.txt
sort -u exercise.txt // Sort unique lines on exercise.txt
cat ex<TAB> // will show exercise.txt
history
cat /etc/shadow // It will prompt Access Denied
ls -la /etc/shadow // Check permission of /etc/shadow file
whoami
sudo -l // Check our sudo privilege
sudo /etc/shadow
cat /etc/shadow
sudo !! // Sudo above command
su kali // Switch to kali
sudo su // Switch to root
cat exercise.txt // Will show all lines of exercises.txt
cat exercise.txt | grep admin // will only show line contain admin
cat exercise.txt | grep admin | wc -c // Count bytes of above output
cat exercise.txt | grep admin > admin_exercise.txt
echo "This will overwrite" > admin_exercise.txt | Overwrite exercise.txt with "This will overwrite", or make exercise.txt file if it is not exists
echo "This will not overwrite" >> admin_exercise.txt | write "This will not overwrite" to the last line of exercise.txt