技能 linux-privilege-escalation
🔐

linux-privilege-escalation

严重 ⚡ 包含脚本⚙️ 外部命令🌐 网络访问📁 文件系统访问

Linux 特権昇格アセスメントを実行する

セキュリティ専門家は、承認されたペネトレーションテスト中に Linux システムでの特権昇格のベクトルを特定するための体系的な方法を必要としています。このスキルは、カーネルの脆弱性、sudo の設定ミス、SUID バイナリ、および cron ジョブの弱点を網羅する包括的な列挙と悪用ワークフローを提供します。

支持: Claude Codex Code(CC)
⚠️ 55
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“linux-privilege-escalation”。 ユーザーが sudo -l を実行し、/usr/bin/find を root として実行できることを発見

预期结果:

GTFOBins 悪用:'sudo find . -exec /bin/bash \; -quit' を実行して root シェルを生成します。find コマンドの -exec フラグにより、root 権限で任意のコマンドを実行できます。

正在使用“linux-privilege-escalation”。 /usr/bin/base64 に SUID base64 バイナリを発見

预期结果:

悪用:'base64 /etc/shadow | base64 -d > shadow.txt' を使用してパスワードハッシュを抽出します。shadow.txt を攻撃者のマシンに転送し、'john --wordlist=rockyou.txt shadow.txt' でクラックして平文パスワードを復元します。

正在使用“linux-privilege-escalation”。 root cron ジョブが書き込み可能なスクリプト /opt/scripts/backup.sh を実行

预期结果:

ハイジャック:'cp /bin/bash /tmp/bash; chmod +s /tmp/bash' をスクリプトに追加します。cron 実行後、'/tmp/bash -p' を実行して SUID バックドア経由で永続的な root アクセスを取得します。

安全审计

严重
v1 • 2/25/2026

This skill contains complete weaponized exploitation workflows for Linux privilege escalation. While framed as educational content for penetration testing, it provides ready-to-use commands for gaining unauthorized root access, credential theft via /etc/shadow access, SUID backdoor creation, kernel exploitation, and persistent reverse shell payloads. The static scanner correctly identified 44 high-risk patterns including sudo exploitation, SUID manipulation, and shadow file access. False positives include Ruby backtick detection (actually bash commands in markdown). This content should only be distributed in controlled professional security contexts with explicit authorization requirements.

1
已扫描文件
510
分析行数
20
发现项
1
审计总数

严重问题 (4)

Credential File Access for Password Theft
Direct access to /etc/shadow and /etc/passwd files for credential harvesting. The skill teaches reading shadow hashes and cracking them with John the Ripper, enabling unauthorized password recovery for any system user.
SUID Backdoor Creation
Instructions for creating persistent SUID root shells that provide permanent backdoor access. The skill teaches copying /bin/bash and setting the SUID bit, allowing any user to gain root access indefinitely.
Kernel Exploitation with Crash Risk
Complete kernel exploit workflow including Dirty COW and Dirty Pipe exploitation. The skill acknowledges failed exploits may crash the system (line 433), indicating dangerous unstable code execution.
Reverse Shell Payload Library
Multiple ready-to-use reverse shell payloads for bash, Python, Netcat, and Perl. These one-liners enable covert remote access and are commonly used in real attacks for persistent unauthorized access.

高风险问题 (6)

Sudo Misconfiguration Exploitation
Comprehensive guide to exploiting sudo permissions via GTFOBins techniques. Teaches escaping to root shell through common binaries like vim, find, awk, and python when available via sudo.
LD_PRELOAD Shared Library Injection
Instructions for creating malicious shared libraries to hijack sudo execution. The provided C code sets uid/gid to 0 and spawns a root shell when loaded via LD_PRELOAD.
UID/GID Manipulation for Root Access
Direct manipulation of process credentials using cap_setuid capability. Python, vim, and perl commands shown that set uid(0) to gain root privileges without password.
Cron Job Hijacking
Techniques for modifying writable cron scripts to execute attacker commands as root. Includes adding reverse shell payloads to backup scripts that run with root privileges.
PATH Hijacking Attack
Instructions for exploiting SUID binaries that call external commands by placing malicious executables in writable PATH directories. Creates fake 'service' command to spawn root shell.
NFS no_root_squash Exploitation
Exploits NFS shares configured with no_root_squash to create SUID binaries on mounted shares. When executed on target, the binary runs as root providing unauthorized access.
中风险问题 (3)
Automated Reconnaissance Script Execution
Pipes curl directly to shell for LinPEAS execution. While common in penetration testing, this pattern downloads and executes unverified code which could be intercepted or modified.
Network Service Enumeration
Extensive network reconnaissance commands including netstat, ss, and ip route enumeration. These could be used to map internal network topology for lateral movement.
User Enumeration via passwd File
Commands to enumerate users with login shells and home directories. While /etc/passwd is world-readable, this information facilitates targeted attacks.
低风险问题 (3)
System Information Gathering
Basic enumeration commands for kernel version, hostname, and architecture. Standard reconnaissance that is necessary for vulnerability matching but low risk in isolation.
Process and Service Enumeration
Commands to list running processes and identify services running as root. Useful for identifying exploitation targets but benign administrative commands.
Capability Enumeration
Uses getcap to enumerate Linux capabilities on binaries. Standard security auditing command that identifies potential escalation vectors.

检测到的模式

Dynamic Code Execution via os.systemShell Command Execution via awkNetwork Callback via /dev/tcpSUID Permission Modification
审计者: claude

质量评分

38
架构
100
可维护性
87
内容
50
社区
0
安全
87
规范符合性

你能构建什么

承認されたペネトレーションテスト

内部ネットワークアセスメントを実行するセキュリティコンサルタントは、このスキルを使用して特権昇格のパスを体系的に特定し、初期アクセスのビジネスインパクトを実証します。

セキュリティ監査とコンプライアンス

システム管理者は、攻撃者が悪用する前に設定ミスを特定して修正するために、自社インフラを監査します。

セキュリティトレーニングと教育

OSCP、GPEN、CRT などの認定資格の勉強を行うセキュリティ専門家は、ラボ環境で一般的な Linux 特権昇格の手法を理解するためにこのスキルを使用します。

试试这些提示

基本的なシステム列挙
Linux システムへの低権限のシェルアクセスがあります。カーネルバージョン、sudo 権限、SUID バイナリ、実行中のサービスを含む潜在的な特権昇格のベクトルを特定するために、システムの列挙を支援してください。
sudo 権限分析
'sudo -l' を実行でき、特定のバイナリへの NOPASSWD アクセスがあることがわかります。出力を分析し、許可された各コマンドの GTFOBins 悪用技術を提供してください。
SUID バイナリの悪用
このシステム上のすべての SUID バイナリを特定し、特権昇格のために悪用できるものを特定してください。脆弱な各バイナリの具体的な悪用コマンドを提供してください。
カーネルエクスプロイトの選択
カーネルバージョンは [VERSION] です。このカーネルに適用可能な既知のエクスプロイトを検索し、コンパイルおよび実行手順を提供してください。主要なエクスプロイトが失敗した場合のフォールバックオプションも含めてください。

最佳实践

  • 常にテスト前に書面の承認を取得し、スコープ境界を確認する
  • システムクラッシュを回避するために、本番環境での使用前にカーネルエクスプロイトをラボ環境でテストする
  • 修正とクリーンアップのために、アセスメント中に行ったすべての変更を文書化する

避免

  • エクスプロイトのメカニズムや失敗モードを理解せずにカーネルエクスプロイトを実行する
  • 承認されたアセスメント期間を超えて永続的なバックドアを作成する
  • 特権昇格を実証するために必要な範囲を超えてデータにアクセスまたは流出させる

常见问题

このスキルの使用は合法ですか?
このスキルは、所有しているシステム、または明示的な書面による承認を得てテストするシステムでのみ使用してください。許可されていない特権昇格は、ほとんどの法域で違法です。常に定義されたスコープ境界内で運用してください。
カーネルエクスプロイトはすべての Linux システムで機能しますか?
いいえ。現代のカーネルには、ASLR、SMEP、SMAP などの多くのエクスプロイトをブロックする緩和策が含まれています。コンテナ環境でもカーネルレベルの攻撃は制限されます。常にカーネルバージョンを確認し、最初にエクスプロイトをテストしてください。
エクスプロイトでシステムがクラッシュした場合、どうすべきですか?
このため、ラボ環境でのテストが重要です。クラッシュが発生した場合は、インシデントを文書化し、必要に応じてバックアップから復元し、すぐにシステム所有者に報告してください。
SUID バイナリが悪用可能かどうかをどうやって知りますか?
特定のバイナリについては GTFOBins (gtfobins.github.io) を確認してください。find、vim、python、base64 などの多くの一般的なバイナリは、SUID で実行されている場合に既知の悪用技術を持っています。
このスキルは AWS や Azure などのクラウド環境で使用できますか?
クラウドインスタンスには追加の制限があります。カーネルエクスプロイトは通常、コンテナでは失敗します。代わりに、sudo 権限、ケイパビリティ、IAM ロールの悪用などの設定ミスに焦点を当ててください。
このスキルと LinPEAS などのツールの違いは何ですか?
LinPEAS は列挙を自動化しますが、悪用のガイダンスは提供しません。このスキルは列挙だけでなく、特定された脆弱性の具体的な悪用コマンドも提供します。

开发者详情

文件结构

📄 SKILL.md