Linux
Bash History
ID
There are some groups that are vulnerable:
USERS
Enumerate the users and try to access to them
LXD
If lxc/lxd is not working USE THE FULL PATH
First download an Alpine image, then upload it to the remote machine.
A compressed file will be created. Now, we have to send this file to the victim machine
Sudoers
Files belonging the user
SUID Privileges
We will have to look for that path have suid permissions, this will allow to be able to execute commands as the owner, that in case of being root is tensed.
Once we find one go to https://gtfobins.github.io/.
Cron Jobs
Path Hijacking
Abuse of incorrectly implemented permissions
Buscamos ficheros que permitan la escritura
The following command will look for files (and not symlinks etc) that are writable.
Abusing Password Authentication
Add users to /etc/sudoers
Detection and Explotation of Capabilities
Potential Escalate Privileges capabilities
cap_dac_read
Allows us to read any file from the system
cap_setuid
Allow us to change the uid of the user
With this capability in python 3.8 we can create a python file for changing our id and open a shell:
Kernel Explotation
To see the linux version and the kernel put the commands:
Locally Stored Credentials
Search for credentials by trying various options like username, password, db_username, db_password, db_user etc.
Mozilla Firefox files
We can decrypt the protected passwords using direpwd:
Enumerate local ports
If we detect ports that we don't detected initially we should forward the port to our machine and check what is inside.
motd.legal-displayed
Path Hijacking
$PATH
is an environment variable that tells the system where to look for executables when you run a command without specifying its full path.
Example output:
Each directory is separated by :
. The system searches these directories from left to right when executing commands.
Look for external commands without absolute paths. For example using tar instead of /usr/bin/tar in a script.
Modifying $PATH
$PATH
You can add new directories at the beginning of $PATH
to prioritize them:
Now, if an executable called tar
exists in /tmp
, it will run before the system's default tar
.
Docker Escape
Enumerate the disks available
Last updated