Skip to content
Search

ONVIF

lastmod 2024-10-14created 2017-01-2440 edits

ONVIF is an open industry forum for the development of a global standard for the interface of IP-based physical security products.

Profiles

ONVIF Device Manager

Examples

Libraries

ONVIF Application Programmer's Guide

WSDL Spec

The WSDL specs for ONVIF can be downloaded from the following sites.

Authentication using wsse

Authentication methods for requests and what to do when one fails:

  1. Include <UsernameToken> in the SOAP Header of the HTTP Body, using a plain-text password.
    1. In this case, #PasswordText is appended to the end of the Type attribute URI of <wsse:Password>.
  2. Include <UsernameToken> in the SOAP Header of the HTTP Body, using a Digest password.
    1. In this case, #PasswordDigest is appended to the end of the Type attribute URI of <wsse:Password>. (See [Programmer's Guide] for the encoding method)
      • For example: <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">...</wsse:Password>
  3. Include Basic authentication in the HTTP Authorization Header along with <UsernameToken>.
  4. Include Digest authentication in the HTTP Authorization Header along with <UsernameToken>.
    • In this case, the password used in <UsernameToken> must be a Digest.

Actual request packet:

POST /onvif/device_service HTTP/1.1
Host: 192.168.0.202
User-Agent: UserAgentFS
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 749
Authorization: Digest username="admin", realm="iPolis", nonce="399190d0cef9db75b7bd", uri="/onvif/device_service", response="59b44e9a2b4b1a8f35a7267eb062cc3a", opaque="dda4084c", qop=auth, nc=00000001, cnonce="19b0d833"

<?xml version="1.0" ?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
    <s:Header xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <wsse:Security>
            <wsse:UsernameToken>
                <wsse:Username>admin</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">iZq+wmgOB3ixwTA/EvXEgQRtWwM=</wsse:Password>
                <wsse:Nonce>Mzg4NTg0NDY1MDQyNzE5MA==</wsse:Nonce>
                <wsu:Created>2000-08-09T17:11:43Z</wsu:Created>
            </wsse:UsernameToken>
        </wsse:Security>
    </s:Header>
    <s:Body xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
        <tds:GetDeviceInformation/>
    </s:Body>
</s:Envelope>

Actual response packet:

HTTP/1.1 200 OK
Set-Cookie: TRACKID=b6b576ae163c45dd4cb8de0c3042d541; Secure; HttpOnly
Server: gSOAP/2.8
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 3329
Connection: close
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Date: Wed, 09 Aug 2000 17:11:44 GMT

<?xml version="1.0" ?>
<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:xenc="http://www.w3.org/2001/04/xmlenc#"
    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:xmime="http://tempuri.org/xmime.xsd"
    xmlns:xop="http://www.w3.org/2004/08/xop/include"
    xmlns:fc="http://www.onvif.org/ver20/analytics/humanface"
    xmlns:bd="http://www.onvif.org/ver20/analytics/humanbody"
    xmlns:ttr="http://www.onvif.org/ver20/analytics/radiometry"
    xmlns:axt="http://www.onvif.org/ver20/analytics"
    xmlns:tt="http://www.onvif.org/ver10/schema"
    xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2"
    xmlns:wstop="http://docs.oasis-open.org/wsn/t-1"
    xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-2"
    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
    xmlns:axt3="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding"
    xmlns:axt4="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding"
    xmlns:axt2="http://www.onvif.org/ver20/analytics/wsdl"
    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:tev="http://www.onvif.org/ver10/events/wsdl"
    xmlns:tev4="http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBinding"
    xmlns:tev5="http://www.onvif.org/ver10/events/wsdl/NotificationConsumerBinding"
    xmlns:tev6="http://www.onvif.org/ver10/events/wsdl/PullPointBinding"
    xmlns:tev7="http://www.onvif.org/ver10/events/wsdl/CreatePullPointBinding"
    xmlns:tev8="http://www.onvif.org/ver10/events/wsdl/PausableSubscriptionManagerBinding"
    xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
    xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl"
    xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl"
    xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl"
    xmlns:tpv="http://www.onvif.org/ver10/provisioning/wsdl"
    xmlns:tr2="http://www.onvif.org/ver20/media/wsdl"
    xmlns:trc="http://www.onvif.org/ver10/recording/wsdl"
    xmlns:trp="http://www.onvif.org/ver10/replay/wsdl"
    xmlns:trt="http://www.onvif.org/ver10/media/wsdl"
    xmlns:tse="http://www.onvif.org/ver10/search/wsdl"
    xmlns:tth="http://www.onvif.org/ver10/thermal/wsdl"
    xmlns:tns1="http://www.onvif.org/ver10/topics"
    xmlns:ter="http://www.onvif.org/ver10/error"
    xmlns:env="http://www.w3.org/2001/12/soap-envelope"
    xmlns:tnssamsung="http://www.samsungcctv.com/2011/event/topics"
>
    <SOAP-ENV:Header/>
    <SOAP-ENV:Body>
        <tds:GetDeviceInformationResponse>
            <tds:Manufacturer>Samsung Techwin</tds:Manufacturer>
            <tds:Model>XNP-9300RW</tds:Model>
            <tds:FirmwareVersion>2.01.07_20220429_R440</tds:FirmwareVersion>
            <tds:SerialNumber>ZS5F6V4TC0000QZ</tds:SerialNumber>
            <tds:HardwareId>XNP-9300RW</tds:HardwareId>
        </tds:GetDeviceInformationResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

How to scan

If the camera is configured to obtain it's address via DHCP, and you plug it into your network. You could run nmap on your ubuntu box to scan the network. There are a myriad of options to nmap - but you could try something like:

nmap -A -T4 192.168.1.*

Obviously, change the ip range to suit your network. namp will attempt to figure out what OS is running on each of the IPs it finds, so you should be able to work out what one the camera is.

Another answer

Use nmap to find all devices with RTSP (port 554) streams (replace IP range with your network's applicable IPs):

nmap --open -p 554 10.0.0.1-254 -oG - | grep "/open"

Look in /proc/net/arp to see any applicable IPs for MAC address you know:

cat /proc/net/arp

Use brute force with nmap to find the stream URLs (replace 10.0.0.198 with whatever you found in previous command):

nmap --script rtsp-url-brute -p 554 10.0.0.198

See also

Favorite site

References


  1. https://github.com/mvantellingen/python-zeep ↩

  2. ONVIF_WG-APG-Application_Programmers_Guide-1.pdf ↩

  3. Onvif_and_soap_and_web_service.pdf ↩

  4. ONVIF_WG-APG-Application_Programmers_Guide-1.pdf ↩

  5. ONVIF_and_SOAP_and_web_service.pdf ↩

author Zer0 sitemap