Useful Tips
Here are some tips to help you get the most out of post-exploitation concepts, tools, and utilities:
Use
hostnameandwhoamicommandsUse
uname -aMake
cat /proc/versionto get more information about the OSMake
cat /etc/issueto know OS informationMake
ps -Ato show running processes on the current shell (ps axjffor tree display mode)Use
envto see environment variablesUse
idto obtain information about users and groups, or even information about another userUse
ls -lato check hidden filesMake
cat /etc/passwd | cur -d ":" -f 1orcat /etc/passwd | grep "home"to know existing usersCheck the last used commands with
historyCheck network interfaces with
ifconfigto know if it could be a pivoting point to another network. Then useip routeto confirm an interface cannot be accessed directly by the machine (it won't say it is a default interface).Use
netstatto obtain information about listening ports and services running.Search for specific files with
findUse tools such as Linpeas or Linenum for automation of the process
Use
dpkg -lon Linux or look atC:\Program Filesin Windows, to see what software is installed on the system.Check for exposed credentials on configuration files of web apps or containers.
Check if there are write permissions to add new cron jobs in the
/etc/crontab,/etc/cron.d, or/var/spool/cron/crontabs/rootfolders to gain privileged shells or execute exploits.Use
base64encode to convert a file to base64 format, and pass it in this way to a remote host to evade filtering of file types. To encode, we usebase64 $file -w 0and to decode it withecho $encodedstring | base64 -d > $fileCheck the kernel version to find any possible exploit
Use the
sudo -lcommand to check sudo execution permissions and environment optionsCheck executables with SUID or SGID permissions
Check which binaries have capabilities assigned
Check which cron jobs are programmed to be executed
Check cron jobs that may be deleted from the system but not from crontab
Check writable folders that can be vulnerable to abuse of the PATH environment variable
Check the NFS configuration files to create a connection with the host machine
Last updated