连接到远程服务器时使用psexec拒绝访问

时间:2014-07-30 11:33:01

标签: remote-access psexec

我使用最新版本的PsExec,并以管理员身份执行命令提示符。 我们使用PsExec v2.11

MY_MACHINE is on MY_DOMAIN domain.
REMOTE_SERVER is on OTHER_DOMAIN domain.
user_partner is on DOMAIN_PARTNER.NET.

执行简单的服务器连接测试(例如,从我的机器MY_MACHINE到REMOTE_SERVER服务器)

C:\Tests\GRMDeployment\Tools>PsExec \\REMOTE_SERVER.OTHER_DOMAIN.local -u OTHER_DOMAIN\USER_FOR_TFS -p **PASS** cmd.exe /v /c echo ^%computername^%

PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com


REMOTE_SERVER
cmd.exe exited on REMOTE_SERVER.OTHER_DOMAIN.local with error code 0.

另一个域中的另一个合作伙伴,它会获得拒绝访问权限错误。

登录计算机的用户是DOMAIN_PARTNER \ user_partner。

COMPUTERNAME=WS001S90-01-JEN
USERDNSDOMAIN=DOMAIN_PARTNER.NET
USERDOMAIN=DOMAIN_PARTNER
USERNAME=user_partner
USERPROFILE=C:\Users\user_partner

我检查了PSExec,445和135使用的端口,两者都在REMOTE_SERVER.OTHER_DOMAIN.local机器上打开:

nc -z REMOTE_SERVER.OTHER_DOMAIN.local 445
Connection to REMOTE_SERVER.OTHER_DOMAIN.local port 445 [tcp/microsoft-ds] succeeded!

nc -z REMOTE_SERVER.OTHER_DOMAIN.local 135
Connection to REMOTE_SERVER.OTHER_DOMAIN.local port 135 [tcp/epmap] succeeded!

可以从资源管理器访问该目录:

\\REMOTE_SERVER.OTHER_DOMAIN.local\SharedFolder

我收到Access is Denied错误,也是管理员用户。

PsExec \\REMOTE_SERVER.OTHER_DOMAIN.local -u OTHER_DOMAIN\TFSADMIN -p xxxxx cmd.exe /v /c echo ^%computername^%

我尝试添加Windows凭据。

Internet or network address: REMOTE_SERVER.OTHER_DOMAIN.local
User Name: OTHER_DOMAIN\USER_FOR_TFS
Password: **PASS**

我得到同样的错误。

然后,我试试这个:

C:\Users\user_partner>net user administrator /enable:yes
The command completed successfully.


C:\Users\user_partner>PsExec \\REMOTE_SERVER.OTHER_DOMAIN.local -u OTHER_DOMAIN\USER_FOR_TFS -p xxxxxx cmd.exe /v /c echo ^%computername^%

PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com

Couldn't access REMOTE_SERVER.OTHER_DOMAIN.local:
Access is denied.

其他测试:

C:\Users\user_partner>PsExec \\REMOTE_SERVER -u OTHER_DOMAIN\USER_FOR_TFS -p **PASS** cmd.exe /v /c echo ^%computername^%

PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com

Couldn't access REMOTE_SERVER:
The network path was not found.

其他测试,使用ip,我得到Access拒绝:

C:\Users\user_partner>PsExec \\10.254.6.40 -u OTHER_DOMAIN\USER_FOR_TFS -p **PASS** cmd.exe /v /c echo ^%computername^%

PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com

Couldn't access 10.254.6.40:
Access is denied.

其他测试

runas /user:OTHER_DOMAIN\USER_FOR_TFS cmd 

PsExec \\REMOTE_SERVER.OTHER_DOMAIN.local -u OTHER_DOMAIN\USER_FOR_TFS -p **PASS** cmd.exe /v /c echo ^%computername^%

有什么建议吗?

1 个答案:

答案 0 :(得分:3)

尝试以下方法:

  1. 尝试在目标计算机上禁用UAC - 首先尝试!
  2. 检查您是否可以在目标计算机上访问\ admin $ share
  3. 尝试使用域用户而不是本地用户。这个域用户必须 是目标机器上的管理员
  4. 在使用之前尝试使用cmdkey将名称和密码添加到凭据缓存中 PSEXEC
  5. 使用cmdkey:

    cmdkey.exe /add:MACHINE_NAME /user:MACHINE_NAME\Administrator /pass:PASSWORD
    psexec.exe \\MACHINE_NAME cmd
    cmdkey.exe /delete:MACHINE_NAME
    

    5。通过在目标计算机

    上运行此操作来尝试disbale uac for remote users
    reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f