2011-03-03 2 views
7

AXIS P3301 (펌웨어 5.11.2)은 사용자 이름이 "root"이고 암호가 "root"인 첫 번째 사용자가 생성 된 후 을 반환합니다. NotAuthorized soap fault, ONVIF 어떤 요청의 경우 : 1.02 명세서 ONVIF 따르면ONVIF : ONVIF 프로토콜을 사용하는 AXIS P3301의 인증 실패

<SOAP-ENV:Fault 
    SOAP-ENV:encodingStyle="http://www.w3.org/2003/05/soap-encoding" 
    xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"> 
    <SOAP-ENV:Code> 
     <SOAP-ENV:Value>SOAP-ENV:Sender</SOAP-ENV:Value> 
     <SOAP-ENV:Subcode> 
      <SOAP-ENV:Value>ter:NotAuthorized</SOAP-ENV:Value> 
     </SOAP-ENV:Subcode> 
    </SOAP-ENV:Code> 
    <SOAP-ENV:Reason> 
     <SOAP-ENV:Text xml:lang="en">Sender not authorized</SOAP-ENV:Text> 
    </SOAP-ENV:Reason> 
    <SOAP-ENV:Detail> 
     The action requested requires authorization and the sender is not authorized 
    </SOAP-ENV:Detail> 
</SOAP-ENV:Fault> 

, I는 http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0.pdf 명세서에서 설명하는 인증 사용자 이름 토큰 프로파일을 사용한다. 요청의

static byte[] sha1(params byte[][] parts) { 
    var data = parts.Concat().ToArray(); 
    var hasher = SHA1.Create(); 
    return hasher.ComputeHash(data); 
} 

static string userName = "root"; 
static string password = "root"; 

static void Main(string[] args) { 
    Init(); 
    var uri = @"http://192.168.5.71/onvif/services"; 
    var nonce = new byte[] {1,2,3,4}; 
    var created = System.DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddThh:mm:ss.fffZ"); 
    try { 
     var body = SendSoapRequest(uri, "GetDeviceInformation.xq", new { 
      userName = userName, 
      passwordDigest = sha1(
       nonce, 
       created.ToUtf8(), 
       password.ToUtf8() 
      ).ToBase64(), 
      nonce = nonce.ToBase64(), 
      created = created, 
     }); 

     using (var _w = new XmlTextWriter(Console.Out)) { 
      _w.Formatting = Formatting.Indented; 
      body.WriteTo(_w); 
     } 
    }catch(SoapFaultException err){ 
     var fault = err.fault; 
     using (var _w = new XmlTextWriter(Console.Out)) { 
      _w.Formatting = Formatting.Indented; 
      fault.WriteTo(_w); 
     } 
    } 
} 

와이어 샤크 로그 :

<s:Envelope 
    xmlns:s="http://www.w3.org/2003/05/soap-envelope" 
    xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> 
    <s:Header> 
     <o:Security 
      xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
      s:mustUnderstand="true"> 
      <o:UsernameToken u:Id="UsernameToken-3ae8d972-d014-47b0-858b-2364f6119763"> 
       <o:Username>root</o:Username> 
       <o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">MQ52wETdmCuGHmCsYED3FGrQ0UE=</o:Password> 
       <o:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">AQIDBA==</o:Nonce> 
       <u:Created>2011-03-03T12:23:28.499Z</u:Created> 
      </o:UsernameToken> 
     </o:Security> 
    </s:Header> 
    <s:Body> 
     <tds:GetDeviceInformation xmlns:tds="http://www.onvif.org/ver10/device/wsdl" /> 
    </s:Body> 
</s:Envelope> 

여기

xquery version "1.0"; 
declare copy-namespaces no-preserve, inherit; 
<s:Envelope 
    xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
    xmlns:s="http://www.w3.org/2003/05/soap-envelope"> 

    <s:Header> 
     <o:Security 
      s:mustUnderstand="true" 
      xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> 

      <o:UsernameToken u:Id="UsernameToken-3ae8d972-d014-47b0-858b-2364f6119763"> 
       <o:Username>{model/userName/text()}</o:Username> 
       <o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest"> 
        {model/passwordDigest/text()} 
       </o:Password> 
       <o:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"> 
        {model/nonce/text()} 
       </o:Nonce> 
       <u:Created>{model/created/text()}</u:Created> 
      </o:UsernameToken> 

     </o:Security> 
    </s:Header> 

    <s:Body> 
     <tds:GetDeviceInformation xmlns:tds="http://www.onvif.org/ver10/device/wsdl" /> 
    </s:Body> 

</s:Envelope> 

보내는 요청에 대한 내 코드입니다 : 아래

내가 비누 요청을 형성하는 데 사용하는 스크립트입니다 응답의 철저한 로그 :

<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope 
    xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" 
    xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#" 
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#" 
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
    xmlns:wsa5="http://www.w3.org/2005/08/addressing" 
    xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" 
    xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" 
    xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" 
    xmlns:tt="http://www.onvif.org/ver10/schema" 
    xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-2" 
    xmlns:tan1="http://www.onvif.org/ver10/analytics/wsdl/RuleEngineBinding" 
    xmlns:tan="http://www.onvif.org/ver10/analytics/wsdl" 
    xmlns:tan2="http://www.onvif.org/ver10/analytics/wsdl/AnalyticsEngineBinding" 
    xmlns:tds="http://www.onvif.org/ver10/device/wsdl" 
    xmlns:tev1="http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding" 
    xmlns:tev2="http://www.onvif.org/ver10/events/wsdl/EventBinding" 
    xmlns:tev3="http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding" 
    xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" 
    xmlns:tev4="http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBinding" 
    xmlns:tev="http://www.onvif.org/ver10/events/wsdl" 
    xmlns:timg="http://www.onvif.org/ver10/imaging/wsdl" 
    xmlns:tptz="http://www.onvif.org/ver10/ptz/wsdl" 
    xmlns:trt="http://www.onvif.org/ver10/media/wsdl" 
    xmlns:ter="http://www.onvif.org/ver10/error" 
    xmlns:tns1="http://www.onvif.org/ver10/topics" 
    xmlns:tnsaxis="http://www.axis.com/2009/event/topics"> 

    <SOAP-ENV:Header></SOAP-ENV:Header> 
    <SOAP-ENV:Body> 
     <SOAP-ENV:Fault SOAP-ENV:encodingStyle="http://www.w3.org/2003/05/soap-encoding"> 
      <SOAP-ENV:Code> 
       <SOAP-ENV:Value>SOAP-ENV:Sender</SOAP-ENV:Value> 
       <SOAP-ENV:Subcode> 
        <SOAP-ENV:Value>ter:NotAuthorized</SOAP-ENV:Value> 
       </SOAP-ENV:Subcode> 
      </SOAP-ENV:Code> 
      <SOAP-ENV:Reason> 
       <SOAP-ENV:Text xml:lang="en">Sender not authorized</SOAP-ENV:Text> 
      </SOAP-ENV:Reason> 
      <SOAP-ENV:Detail>The action requested requires authorization and the sender is not authorized</SOAP-ENV:Detail> 
     </SOAP-ENV:Fault> 
    </SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

내가 틀렸어? (Bosch VIP X1 XF IVA 작동)

+3

AXIS의 사람들과 오랜 토론 끝에 그들은 버그라는 것을 승인했습니다. 명확하게 설명 할 때 잘못된 동작은 잘못된 타임 스탬프 동기화의 영향을받습니다. 이러한 유형의 동기화는 재생 공격 보호에 필요합니다. 이를 위해서는 장치와 클라이언트가 시간을 동기화해야합니다. ONVIF는 허용되는 시차를 지정하지 않지만 Axis는 기본적으로 5 초를 사용합니다. 그러나 버전 5.11.2에서는 제대로 작동하지 않습니다. 그들은 다음 며칠 내에 사용할 수있는 다음 펌웨어 버전 5.20에서 수정 될 것이라고 주장했습니다. –

+1

또한 5.20 버전에서는 Axis 장치에서 재생 공격 방지 기능을 해제 할 수 있습니다. 웹 인터페이스를 사용하여 수행 할 수 있습니다 (설정> SystemOptions> 고급> PlainConfig> 웹 서비스> "재생 공격 보호 활성화") –

+0

andrey.ko - 몇 가지 연락처 정보를 제공해 주시겠습니까? 업? – thelost

답변

1

비누 봉투에 "tds"네임 스페이스 ("http://www.onvif.org/ver10/device/wsdl"이어야 함)를 지정하지 않습니다. 나는 똑같은 문제가 있었다. 나의 요청에 오타가 있었고 카메라가 "http 401 not authorized"로 대답했다.

관련 문제