The*_*ner 54 scripting windows login password
是的,我可以启动虚拟机或远程设备并尝试输入密码……我知道……但是有没有一种工具或脚本可以模拟登录,足以确认或否认密码正确?
设想:
服务器服务帐户的密码被“忘记”...但我们认为我们知道它是什么。我想将凭据传递给某些东西,并让它以“正确的密码”或“不正确的密码”反击。
我什至想过一个驱动器映射脚本,其中传递了该用户帐户和密码,以查看它是否成功映射了驱动器,但在使其正常工作的逻辑中迷失了......类似于:
-Script 通过 msgbox 请求用户名 -script 通过 msgbox 请求密码 -script 尝试将驱动器映射到每个人都可以访问的公共共享 -script 如果成功则取消映射驱动器 -script 返回弹出 msgbox 说明“正确密码”或“不正确”密码”
任何帮助表示赞赏......你会认为这将是一种罕见的情况,不需要工具来支持它但是......好吧......
小智 96
runas /u:yourdomain\a_test_user notepad.exe
Run Code Online (Sandbox Code Playgroud)
该实用程序将提示输入密码,如果提供了正确的密码,记事本将启动,否则将产生错误 1326:用户名或密码不正确
Eve*_*ien 12
Powershell 脚本:
#usage: Test-UserCredential -username UserNameToTest -password (Read-Host)
Function Test-UserCredential {
Param($username, $password)
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
$ct = [System.DirectoryServices.AccountManagement.ContextType]::Machine, $env:computername
$opt = [System.DirectoryServices.AccountManagement.ContextOptions]::SimpleBind
$pc = New-Object System.DirectoryServices.AccountManagement.PrincipalContext -ArgumentList $ct
$Result = $pc.ValidateCredentials($username, $password).ToString()
$Result
}
Run Code Online (Sandbox Code Playgroud)
http://powershellcommunity.org/Forums/tabid/54/aft/8034/Default.aspx
| 归档时间: |
|
| 查看次数: |
158050 次 |
| 最近记录: |