标签: ntlm

调用InitializeSecurityContext(Negotiate)时要使用的TargetName是什么?

问题

在调用时InitializeSecurityContext,我传递给TargetName参数的值是多少?

修订背景

我正在调用这个函数InitializeSecurityContext:

InitializeSecurityContextA(
      @pAS.hcred,           //[in] credentials
      phContext,            //[in] optional] Context handle structure
      pszTargetName,        //[in, optional] Target name
      0,                    //[in] context requirements
      0,                    //[in] reserved1, must be zero
      SECURITY_NATIVE_DREP, //[in] target data representation
      pInput,               //[in] optional] SecBufferDescription
      0,                    //[in] reserved2, must be zero
      @pAS.hctxt,           //[in, out] pointer to context handle structure
      @OutBuffDesc,         //[in, out] pointer to SecBufferDesc
      ContextAttributes,    //[out] context attributes
      @lifetime);           //[out] expiration timestamp
Run Code Online (Sandbox Code Playgroud)

我传递给pszTargetName谁?

我试过了

  • null: InitializeSecurityContextA(@pAS.hcred, phContext, …

security winapi ntlm kerberos

18
推荐指数
2
解决办法
6897
查看次数

JCIFS NTLM库的替代品

JCIFS NTLM库有什么替代方案吗?

java ntlm jcifs josso

17
推荐指数
2
解决办法
1万
查看次数

如何在Node.js中将NTLM凭据转换为Kerberos令牌

我想使用充当某种代理的Node.js构建服务器。连接到我的服务器的客户端使用NTLMv2进行身份验证(没有机会更改此身份),但是我的服务器应连接到的上游服务器需要Kerberos令牌。

因此,我的问题非常简单:如何使用Node.js将NTLMv2提供的信息转换为Kerberos令牌?到目前为止,在npm上,我已经找到了用于NTLMv2身份验证的模块,但是我可能需要以某种方式与Windows进行对话,以将用户的NTLMv2数据转换为该用户的令牌。

关于此的任何提示,如何解决此问题?

ntlm kerberos node.js ntlmv2 ntlm-authentication

17
推荐指数
1
解决办法
322
查看次数

使用RestSharp进行NTLM身份验证?

我正在尝试使用NTSM身份验证来使用RestSharp对TeamCity进行REST调用.

IRestClient _client=new RestClient(_url);
_client.Authenticator = new NtlmAuthenticator            
(System.Net.CredentialCache.DefaultNetworkCredentials);
Run Code Online (Sandbox Code Playgroud)

但它不起作用.如果我错过了什么,请建议.

ntlm restsharp teamcity-7.1

16
推荐指数
4
解决办法
1万
查看次数

NTLM身份验证 - 使用PHP获取Windows登录,域和主机

我正在开发一个单点登录(SSO)PHP应用程序.
用户登录他们的Windows会话,他们希望使用他们的Windows帐户(与LDAP Active Directory连接)自动登录应用程序.

我试过这个脚本:

<?php
$headers = apache_request_headers();    // Récupération des l'entêtes client

if (@$_SERVER['HTTP_VIA'] != NULL){ // nous verifions si un proxy est utilisé : parceque l'identification par ntlm ne peut pas passer par un proxy
    echo "Proxy bypass!";
} elseif(!isset($headers['Authorization'])) {           //si l'entete autorisation est inexistante
    header( "HTTP/1.0 401 Unauthorized" );          //envoi au client le mode d'identification
    header( "WWW-Authenticate: NTLM" );         //dans notre cas le NTLM
    exit;                           //on quitte

}

if(isset($headers['Authorization']))                //dans le cas d'une authorisation (identification) …
Run Code Online (Sandbox Code Playgroud)

php apache ntlm login windows-server

16
推荐指数
1
解决办法
1万
查看次数

Ruby/Rack中的单点登录服务器身份验证

我在Windows服务器上编写和托管Web应用程序以供Intranet使用.我的服务器堆栈使用Sinatra(使用Rack),Thin和(在某些情况下)Apache仅用于反向代理.

我想在我们的ActiveDirectory支持的域中支持单点登录(使用NTLM或Kerberos).我已经看到我可以使用mod_ntlm或者mod_auth_kerb当我支持Apache时执行我的NTLM身份验证.我还没有尝试过,但我认为它会起作用.

我的问题是关于NTLM或Kerberos身份验证,当我不在Apache之后,只使用Thin和Sinatra.我见过rack-ntlm,但是那里的使用细节非常稀少.

请在Sinatra或Rack下提供已知工作代码,说明如何在服务器端使用NTLM或Kerberos,使用ActiveDirectory进行身份验证(可能是通过net-ldap).

编辑:强调了所需的答案,因为到目前为止还没有答案提供这个问题要求的明确帮助.用户应该能够找到这个答案并拥有一个可行的解决方案,而不是指向外部库的指针,他们必须弄清楚如何使用.

ruby rack ntlm kerberos active-directory

15
推荐指数
2
解决办法
9202
查看次数

"匹配的通配符是严格的,但是没有找到元素'http'的声明"错误

我正在尝试配置NTLM身份验证,但收到错误:

cvc-complex-type.2.4.c:匹配的通配符是strict,但是没有为元素'http'找到声明.

我读了很多类似错误的主题,但我找不到解决问题的方法.

导致错误的security.xml文件是:

<beans:beans xmlns="http://www.springframework.org/schema/security"
    xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
                            http://www.springframework.org/schema/beans/spring-beans.xsd
                            http://www.springframework.org/schema/security
                            http://www.springframework.org/schema/security/spring-security.xsd" >

    <http access-denied-page="forms/error403.jsp" entry-point-ref="ntlmEntryPoint" servlet-api-provision="false"> 
        <intercept-url pattern="forms/error403.jsp" filters="none"/>
        <intercept-url pattern="forms/**" access="ROLE_GUEST,ROLE_OPERATOR,ROLE_ADMIN" />
                <custom-filter position="PRE_AUTH_FILTER"/>
    </http>

    <authentication-manager alias="mainAuthenticationManager"/>  
    <authentication-provider user-service-ref='userDetailsService' />

    <beans:bean id="userDetailsService"
        class="service.UserInfoService">
        <beans:property name="dataSource" ref="dataSource" />
        <beans:property name="usersByUsernameQuery" value="select distinct name, ' ' as password, 1 as enabled from TMP_SPRING_USERS where name=?" />
        <beans:property name="authoritiesByUsernameQuery" value="select name, role from TMP_SPRING_USERS where name=?" />
    </beans:bean>

    <beans:bean id="ntlmEntryPoint"
        class="org.springframework.security.ui.ntlm.NtlmProcessingFilterEntryPoint">
        <beans:property name="authenticationFailureUrl" value="forms/error403.html" />
    </beans:bean>

    <beans:bean id="exceptionTranslationFilter"
        class="org.springframework.security.ui.ExceptionTranslationFilter">
        <beans:property name="authenticationEntryPoint" …
Run Code Online (Sandbox Code Playgroud)

java spring ntlm spring-security spring-3

15
推荐指数
1
解决办法
4万
查看次数

401仅在特定计算机上调用Web Service时

我们使用C#开发了一个WPF应用程序,并使用RestSharp与一个简单的Web服务进行通信,如下所示:

Client = new RestClient(serviceUri.AbsoluteUri);
Client.Authenticator = new NtlmAuthenticator(SvcUserName, SvcPassword.GetString());
Run Code Online (Sandbox Code Playgroud)

这一切都很有效,直到我们收到一些电话(大多数工作)的应用程序无法连接到服务.用fiddler直接调用服务方法.然后我们提取了一个小的.net控制台应用程序并尝试使用RestSharp进行服务调用并直接使用HttpWebRequest,然后再次使用401失败.现在我们启用了System.Net跟踪并注意到了一些事情.在第一个401,这是正常的,故障机器产生这个日志:

System.Net信息:0:[4480]连接#3741682 - 收到的标题{连接:保持活动内容长度:1293内容类型:text/html日期:星期一,10八月2015 12:37:49 GMT服务器:Microsoft -IIS/8.0 WWW-Authenticate:Negotiate,NTLM X-Powered-By:ASP.NET}.System.Net信息:0:[4480] ConnectStream#39451090 :: ConnectStream(缓冲1293字节.)System.Net信息:0:[4480]将HttpWebRequest#2383799与ConnectStream相关联#39451090 System.Net信息:0:[4480]将HttpWebRequest#2383799与HttpWebResponse相关联#19515494 System.Net信息:0:[4480]枚举安全包:System.Net信息:0:[4480]协商System.Net信息:0:[4480] NegoExtender System.Net信息:0 :[4480] Kerberos System.Net信息:0:[4480] NTLM系统.

System.Net信息:0:[4480] AcquireCredentialsHandle(package = NTLM,intent = Outbound,authdata = (string.empty)\ corp\svc_account)

System.Net信息:0:[4480] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY,context =(null),targetName = HTTP/mysvc.mycorp.com,inFlags = Delegate,MutualAuth,Connection)System.Net Information:0 :[4480] InitializeSecurityContext(In-Buffers count = 1,Out-Buffer length = 40,返回代码= ContinueNeeded).

工作机器产生这样的输出:

System.Net信息:0:[3432]连接#57733168 - Empfangene Statusleiste:Version = 1.1,StatusCode = 401,StatusDescription = Unauthorized.System.Net信息:0:[3432]连接#57733168 - 标题{Content-Type:text/html服务器:Microsoft-IIS/8.0 WWW-Authenticate:Negotiate,NTLM X-Powered-By:ASP.NET Date:Mon, 2015年8月10日15:15:11 GMT内容长度:1293} wurden empfangen.System.Net信息:0:[3432] ConnectStream#35016340 :: …

c# ntlm httpwebrequest restsharp http-status-code-401

15
推荐指数
1
解决办法
593
查看次数

为什么CNTLM要求输入密码?

我在Windows上配置了CNTLM代理授权,配置文件看起来像,

Auth            NTLM
PassNT          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
PassLM          YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
PassNTLMv2      ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ

Proxy           proxy.xxxx.com:8080

Listen          3130
Run Code Online (Sandbox Code Playgroud)

localhost:3130在LAN设置中使用代理,点击浏览器上的任何URL,它再次要求输入密码!如果我输入与生成哈希相同的密码,则可以.只是Cntlm的目的被打败了.有人面对这个吗?这是如何运作的?有没有办法解决这个问题?

proxy ntlm

14
推荐指数
1
解决办法
2万
查看次数

是否有正确的方法在symfony中使用SwiftMailer包将NTLM auth类型添加到SwiftMailer中?

我有swiftMailer包的symfony项目.我试图使用NTLM auth通过swiftmailer发送电子邮件.但我还没有找到通过配置捆绑打开NTLM的方法.

经过努力,我找到了解决方案

第一解决方案

current($this->get('mailer')->getTransport()->getExtensionHandlers())
    ->setAuthenticators([new \Swift_Transport_Esmtp_Auth_NTLMAuthenticator()]);
Run Code Online (Sandbox Code Playgroud)

在config.yml中注释spool

#    spool:     { type: memory }
Run Code Online (Sandbox Code Playgroud)

但它看起来有点奇怪.

二解决方案

删除SwiftMailer包并直接使用swiftMailer,因为默认情况下会激活ntlm auth类型.

有没有更好的方法来使用NTLM auth类型?

php ntlm swiftmailer symfony

14
推荐指数
1
解决办法
910
查看次数