代码之家  ›  专栏  ›  技术社区  ›  Saagar

WinExe-错误:打开连接失败-NT连接状态重置

  •  0
  • Saagar  · 技术社区  · 7 年前

    我们正在尝试从Linux(CentOS 7)到Windows 10远程执行Windows命令。我在Centos 7设置了WinExe。我觉得设置似乎不错

    [user@abcd build]$ ./winexe-static -v
    winexe version 1.1
    This program may be freely redistributed under the terms of the GNU GPLv3
    Usage: winexe-static [OPTION]... //HOST COMMAND
    Options:
    -h, --help                                  Display help message
    -V, --version                               Display version number
    -U, --user=[DOMAIN/]USERNAME[%PASSWORD]     Set the network username
    -A, --authentication-file=FILE              Get the credentials from a file
    -N, --no-pass                               Do not ask for a password
    -k, --kerberos=STRING                       Use Kerberos, -k [yes|no]
    -d, --debuglevel=DEBUGLEVEL                 Set debug level
    --uninstall                                 Uninstall winexe service after
                                              remote execution
    --reinstall                                 Reinstall winexe service before
                                              remote execution
    --system                                    Use SYSTEM account
    --profile                                   Load user profile
    --convert                                   Try to convert characters
                                              between local and remote
                                              code-pages
    --runas=[DOMAIN\]USERNAME%PASSWORD          Run as the given user (BEWARE:
                                              this password is sent in
                                              cleartext over the network!)
    --runas-file=FILE                           Run as user options defined in a
                                              file
    --interactive=0|1                           Desktop interaction: 0 -
                                              disallow, 1 - allow. If allow,
                                              also use the --system switch
                                              (Windows requirement). Vista
                                              does not support this option.
    --ostype=0|1|2                              OS type: 0 - 32-bit, 1 - 64-bit,
                                              2 - winexe will decide.
                                              Determines which version (32-bit
                                              or 64-bit) of service will be
                                              installed.
    

    但是它没有连接到Windows10计算机。下面是我们用来测试的命令。我们还尝试了sudo用户。显示错误:打开连接失败-NT连接状态重置错误

    [user@abcd build]$ ./winexe-static -U Domain123/CI.Admin%JeesOver*819 //Windows10 “ipconfig”
    ERROR: Failed to open connection - NT_STATUS_CONNECTION_RESET
    
    [user@abcd build]$ sudo ./winexe-static -U 'Domain123/CI.Admin%JeesOver*819' //Windows10  “ipconfig”
    [sudo] password for user:
    ERROR: Failed to open connection - NT_STATUS_CONNECTION_RESET
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   masimito    7 年前

    您的WinExe可能正在使用SMB1方言进行连接,在现代Windows版本中不推荐使用这种方言。

    仅出于调试目的,暂时启用Windows中的smb1(提示:optionalfeatures.exe),然后重试。它应该可以工作,除非您还需要向注册表中添加“localaccounttokefilterpolicy”。

    别忘了再次禁用smb1。

    有一个支持smb2的winexec二进制文件,可在CentOS 7中针对Windows 10运行: http://dl-openaudit.opmantek.com/winexe-static

    适用于我的源代码: https://bitbucket.org/reevertcode/reevert-winexe-waf

    除了自述文件之外,您还应该阅读“build”文件,它包含附加信息(要应用的补丁)。

    祝你好运!