Skip to content

Commit 62a18ac

Browse files
committed
Adding content from Issue #9. Reorg'ing content to put it with similar stuff and in the right places.
1 parent 2870f3b commit 62a18ac

File tree

3 files changed

+33
-27
lines changed

3 files changed

+33
-27
lines changed

persistence/windows/general.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ return false;
1313

1414
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.
1515

16+
### Remote Assistance Enable
17+
* **Command with arguments**: `reg add “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server” /v fAllowToGetHelp /t REG_DWORD /d 1 /f`
18+
* **Description**: **Must be admin to run this.** Enable remote assistance through adding a registry entry on the local system.
19+
* **Output**:
20+
* <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
21+
The operation completed successfully.</code></div>
1622

17-
### Enable `psexec`
18-
The [`psexec` tool](http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx) executes processes on other systems over a network. Most systems now disable the "clipbook" which `psexec` required. According to Val Smith's and Colin Ames' [BlackHat 2008 presentation (page 50)](http://www.blackhat.com/presentations/bh-usa-08/Smith_Ames/BH_US_08_Smith_Ames_Meta-Post_Exploitation.pdf), you can re-enable the sub-systems needed to use `psexec` using the `sc` commands below.
19-
20-
<pre>
21-
c:\> net use \\[TargetIP]\ipc$ username /user:password
22-
c:\> sc \\[TargetIP] config netdde start= auto
23-
c:\> sc \\[TargetIP] config netddedsdm start= auto
24-
c:\> sc \\[TargetIP] config clipsrv start= auto
25-
c:\> sc \\[TargetIP] start netdde
26-
c:\> sc \\[TargetIP] start netddedsdm
27-
c:\> sc \\[TargetIP] start clipsrv
28-
</pre>
23+
### Remote Desktop Enable - Method 1
24+
* **Command with arguments**: `reg add “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server” /v fDenyTSConnections /t REG_DWORD /d 0 /f`
25+
* **Description**: **Must be admin to run this.** Enable remote desktop through adding a registry entry on the local system.
26+
* **Output**:
27+
* <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
28+
The operation completed successfully.</code></div>
2929

30-
### Enable Remote Desktop
30+
### Remote Desktop Enable - Method 2
3131
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.
3232

3333
1. On the compromised system, create a file named `fix_ts_policy.ini` containing the contents below. Change the *"hacked_account"* value to the account you have compromised on the remote system.

pivoting/windows/remote.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,19 @@ Commands that move data and files between systems on a network and are usually e
7171
* **Output**:
7272
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>qwinsta<br> SESSIONNAME USERNAME ID STATE TYPE DEVICE<br> services 0 Disc<br>>console johndoe 1 Active<br> rdp-tcp 65536 Listen</code></div>
7373

74-
### Remote Assistance Enable
75-
* **Command with arguments**: `reg add “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server” /v fAllowToGetHelp /t REG_DWORD /d 1 /f`
76-
* **Description**: **Must be admin to run this.** Enable remote assistance through adding a registry entry on the local system.
77-
* **Output**:
78-
* <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
79-
The operation completed successfully.</code></div>
80-
81-
### Remote Desktop Enable
82-
* **Command with arguments**: `reg add “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server” /v fDenyTSConnections /t REG_DWORD /d 0 /f`
83-
* **Description**: **Must be admin to run this.** Enable remote desktop through adding a registry entry on the local system.
84-
* **Output**:
85-
* <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
86-
The operation completed successfully.</code></div>
74+
### psexec
75+
* **Command with arguments**: `psexec \\[computername|IP] [cmd]`
76+
* **Description**: The [`psexec` tool](http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx) executes processes on other systems over a network. Most systems now disable the "clipbook" which `psexec` required. According to Val Smith's and Colin Ames' [BlackHat 2008 presentation (page 50)](http://www.blackhat.com/presentations/bh-usa-08/Smith_Ames/BH_US_08_Smith_Ames_Meta-Post_Exploitation.pdf), you can re-enable the sub-systems needed to use `psexec` using the `sc` commands below.
77+
<pre>
78+
c:\> net use \\[computername|IP]\ipc$ username /user:password
79+
c:\> sc \\[computername|IP] config netdde start= auto
80+
c:\> sc \\[computername|IP] config netddedsdm start= auto
81+
c:\> sc \\[computername|IP] config clipsrv start= auto
82+
c:\> sc \\[computername|IP] start netdde
83+
c:\> sc \\[computername|IP] start netddedsdm
84+
c:\> sc \\[computername|IP] start clipsrv
85+
</pre>
86+
* **Example Command**: `psexec \\1.1.1.1 ipconfig /all` would retrieve the IP settings for the 1.1.1.1 system.
8787

8888
### tasklist
8989
* **Command with arguments**: `tasklist /v /s [computername|IP]`

presence/windows/find_files.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ Commands that find files on the filesystem and are usually executed from the con
1818
* **Command with arguments**: `dir /a`
1919
* **Description**: Displays files with specified attributes. Examples: D=Directories, R=Read-only files, H=Hidden files, A=Files ready for archiving, S=System files
2020
* **Output**:
21-
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>dir /a c:\<br> Volume in drive C has no label. Volume Serial Number is 1A09-5F16<br><br> Directory of c:\<br><br>01/19/2008 03:45 AM <DIR> $Recycle.Bin<br>09/18/2006 04:43 PM 24 autoexec.bat<br>10/08/2013 10:27 PM <DIR> Boot<br>04/11/2009 08:00 AM 333,257 bootmgr<br>10/08/2013 10:27 PM 8,192 BOOTSECT.BAK<br>09/18/2006 04:43 PM 10 config.sys<br>01/19/2008 06:47 AM <JUNCTION> Documents and Settings [C:\Users]<br>10/23/2013 07:39 PM 2,460,454,912 pagefile.sys<br>01/19/2008 04:40 AM <DIR> PerfLogs<br>10/08/2013 06:36 PM <DIR> Program Files<br>10/08/2013 06:36 PM <DIR> <br>10/10/2013 07:59 PM <DIR> Users<br>10/23/2013 07:38 PM <DIR> Windows<br> 5 File(s) 2,460,796,395 bytes<br> 10 Dir(s) 33,311,416,320 bytes free</code></div>
21+
* <div class="slide" style="cursor: pointer;"> **Windows 2008:** Show/Hide</div><div class="view"><code>C:\Users\johndoe>dir /a c:\<br> Volume in drive C has no label. Volume Serial Number is 1A09-5F16<br><br> Directory of c:\<br><br>01/19/2008 03:45 AM <DIR> $Recycle.Bin<br>09/18/2006 04:43 PM 24 autoexec.bat<br>10/08/2013 10:27 PM <DIR> Boot<br>04/11/2009 08:00 AM 333,257 bootmgr<br>10/08/2013 10:27 PM 8,192 BOOTSECT.BAK<br>09/18/2006 04:43 PM 10 config.sys<br>01/19/2008 06:47 AM <JUNCTION> Documents and Settings [C:\Users]<br>10/23/2013 07:39 PM 2,460,454,912 pagefile.sys<br>01/19/2008 04:40 AM <DIR> PerfLogs<br>10/08/2013 06:36 PM <DIR> Program Files<br>10/08/2013 06:36 PM <DIR> <br>10/10/2013 07:59 PM <DIR> Users<br>10/23/2013 07:38 PM <DIR> Windows<br> 5 File(s) 2,460,796,395 bytes<br> 10 Dir(s) 33,311,416,320 bytes free</code></div>
22+
23+
### Searching Sub-directories
24+
* **Command with arguments**: `dir /s *[term]*`
25+
* **Description**: Searches for the word entered in the [term] section in all sub-directories ofthe current directory.
26+
* **Example Terms**: `pass`, `cred`, `vnc`, `.config`, `sysprep.*`
27+
* **Attribution**: http://www.slideshare.net/mubix/windows-attacks-at-is-the-new-black-26665607
2228

2329
### Recursive
2430
* **Command with arguments**: `dir /b /s [directory or filename]`

0 commit comments

Comments
 (0)