Aypac / Arduino-TR-064-SOAP-Library

Arduino library for the TR-064 protocol, most commonly used by the Fritz!Box router API
Other
63 stars 21 forks source link

Authentication problem in FB 7590 #33

Closed Aypac closed 4 years ago

Aypac commented 4 years ago

I did not follow all steps you discussed in perfect detail, but I just wanted to confirm that this problem also happens on the 7590. I tried your and also get the error

17:17:58.334 -> Button pressed[action] no nonce/realm found. requesting...
17:17:58.334 -> [HTTP] prepare request to URL: http://192.168.178.1:49000
17:17:58.369 -> [HTTP] POST... SOAPACTION: 'urn:dslforum-org:service:WLANConfiguration:1#GetGenericAssociatedDeviceInfo'
17:17:58.369 -> [HTTP] request code: 500

Also, just as above:

 curl -s -k -m 5 --anyauth -u "klingel:ringdingringdingringdingringding" "http://192.168.178.1:49000/upnp/control/deviceinfo" -H 'Content-Type: text/xml; charset="utf-8"' -H "SoapAction:urn:dslforum-org:service:DeviceInfo:1#GetInfo" -d "<?xml version=\"1.0\"?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><s:Header><h:InitChallenge xmlns:h=\"http://soap-authentication.org/digest/2001/10/\" s:mustUnderstand=\"1\"><UserID>doorbell</UserID></h:InitChallenge ></s:Header><s:Body><u:GetGenericAssociatedDeviceInfo xmlns:u='urn:dslforum-org:service:WLANConfiguration:1'><NewAssociatedDeviceIndex>1</NewAssociatedDeviceIndex></u:GetGenericAssociatedDeviceInfo></s:Body></s:Envelope>"

creates

<?xml version="1.0"?>
 <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Header>
<h:Challenge xmlns:h="http://soap-authentication.org/digest/2001/10/" s:mustUnderstand="1">
<Status>Unauthenticated</Status>
<Nonce>353C512DBD67CCFF</Nonce>
<Realm>F!Box SOAP-Auth</Realm>
</h:Challenge>
</s:Header>
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:dslforum-org:control-1-0">
<errorCode>503</errorCode>
<errorDescription></errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>

Let me know if I can do anything to help :)

Originally posted by @xerg0n in https://github.com/Aypac/Arduino-TR-064-SOAP-Library/issues/30#issuecomment-644835715

Aypac commented 4 years ago

Hi xerg0n, thanks for posting! Can you post the output after the line [initServiceURLs] Detected Services:? What branch are you on? Can you try using the branch 'debug_issue_30' ?

0xE0-rng commented 4 years ago

Thanks for moving, I was not really sure if this warrents a new issue. I thought I tested the branch, but it turns out I did not... Long strory short: It worked! 🥇 Thanks for all the great work you are doing!

I attached the output, maybe its useful to someone. I was running FRITZ!OS: 07.19-79328 BETA -:

2:54:43.563 -> [HTTP] Prepare HTTP request to URL: 'http://192.168.178.1:49000/tr64desc.xml'.
02:54:43.597 -> [HTTP] GET...
02:54:43.597 -> [HTTP] Request code: 200
02:54:43.736 -> [initServiceURLs] Router name: 
02:54:43.736 -> [initServiceURLs] Router model: 
02:54:43.736 -> [initServiceURLs] Detected Services:
02:54:43.736 ->     1   urn:dslforum-org:service:DeviceInfo:1 @ /upnp/control/deviceinfo
02:54:43.736 ->     2   urn:dslforum-org:service:DeviceConfig:1 @ /upnp/control/deviceconfig
02:54:43.769 ->     3   urn:dslforum-org:service:Layer3Forwarding:1 @ /upnp/control/layer3forwarding
02:54:43.769 ->     4   urn:dslforum-org:service:LANConfigSecurity:1 @ /upnp/control/lanconfigsecurity
02:54:43.769 ->     5   urn:dslforum-org:service:ManagementServer:1 @ /upnp/control/mgmsrv
02:54:43.803 ->     6   urn:dslforum-org:service:Time:1 @ /upnp/control/time
02:54:43.803 ->     7   urn:dslforum-org:service:UserInterface:1 @ /upnp/control/userif
02:54:43.803 ->     8   urn:dslforum-org:service:X_AVM-DE_Storage:1 @ /upnp/control/x_storage
02:54:43.803 ->     9   urn:dslforum-org:service:X_AVM-DE_WebDAVClient:1 @ /upnp/control/x_webdav
02:54:43.803 ->     10  urn:dslforum-org:service:X_AVM-DE_UPnP:1 @ /upnp/control/x_upnp
02:54:43.838 ->     11  urn:dslforum-org:service:X_AVM-DE_Speedtest:1 @ /upnp/control/x_speedtest
02:54:43.838 ->     12  urn:dslforum-org:service:X_AVM-DE_RemoteAccess:1 @ /upnp/control/x_remote
02:54:43.838 ->     13  urn:dslforum-org:service:X_AVM-DE_MyFritz:1 @ /upnp/control/x_myfritz
02:54:43.838 ->     14  urn:dslforum-org:service:X_VoIP:1 @ /upnp/control/x_voip
02:54:43.872 ->     15  urn:dslforum-org:service:X_AVM-DE_OnTel:1 @ /upnp/control/x_contact
02:54:43.872 ->     16  urn:dslforum-org:service:X_AVM-DE_Dect:1 @ /upnp/control/x_dect
02:54:43.872 ->     17  urn:dslforum-org:service:X_AVM-DE_TAM:1 @ /upnp/control/x_tam
02:54:43.872 ->     18  urn:dslforum-org:service:X_AVM-DE_AppSetup:1 @ /upnp/control/x_appsetup
02:54:43.907 ->     19  urn:dslforum-org:service:X_AVM-DE_Homeauto:1 @ /upnp/control/x_homeauto
02:54:43.907 ->     20  urn:dslforum-org:service:X_AVM-DE_Homeplug:1 @ /upnp/control/x_homeplug
02:54:43.907 ->     21  urn:dslforum-org:service:X_AVM-DE_Filelinks:1 @ /upnp/control/x_filelinks
02:54:43.907 ->     22  urn:dslforum-org:service:X_AVM-DE_Auth:1 @ /upnp/control/x_auth
02:54:43.942 ->     23  urn:dslforum-org:service:X_AVM-DE_HostFilter:1 @ /upnp/control/x_hostfilter
02:54:43.942 ->     24  urn:dslforum-org:service:WLANConfiguration:1 @ /upnp/control/wlanconfig1
02:54:43.942 ->     25  urn:dslforum-org:service:WLANConfiguration:2 @ /upnp/control/wlanconfig2
02:54:43.942 ->     26  urn:dslforum-org:service:WLANConfiguration:3 @ /upnp/control/wlanconfig3
02:54:43.942 ->     27  urn:dslforum-org:service:Hosts:1 @ /upnp/control/hosts
02:54:43.976 ->     28  urn:dslforum-org:service:LANEthernetInterfaceConfig:1 @ /upnp/control/lanethernetifcfg
02:54:43.976 ->     29  urn:dslforum-org:service:LANHostConfigManagement:1 @ /upnp/control/lanhostconfigmgm
02:54:43.976 ->     30  urn:dslforum-org:service:WANCommonInterfaceConfig:1 @ /upnp/control/wancommonifconfig1
02:54:44.010 ->     31  urn:dslforum-org:service:WANDSLInterfaceConfig:1 @ /upnp/control/wandslifconfig1
02:54:44.010 ->     32  urn:dslforum-org:service:WANDSLLinkConfig:1 @ /upnp/control/wandsllinkconfig1
02:54:44.010 ->     33  urn:dslforum-org:service:WANEthernetLinkConfig:1 @ /upnp/control/wanethlinkconfig1
02:54:44.010 ->     34  urn:dslforum-org:service:WANPPPConnection:1 @ /upnp/control/wanpppconn1
02:54:44.010 ->     35  urn:dslforum-org:service:WANIPConnection:1 @ /upnp/control/wanipconnection1
02:54:44.044 -> [HTTP] Prepare HTTP request to URL: 'http://192.168.178.1:49000/upnp/control/x_voip'.
02:54:44.078 -> [HTTP] POSTing the XML to SOAPACTION: 'urn:dslforum-org:service:X_VoIP:1#X_AVM-DE_DialNumber'
02:54:44.078 -> [HTTP] Request code: 200
02:54:44.078 -> [action] Response status: Unauthenticated
02:54:44.078 -> [action]<warning> Got an unauthenticated error. Using the new nonce and trying again.
02:54:44.078 -> [takeNonce] Extracted the nonce '057DABBB9EDBB793' from the last request.
02:54:44.112 -> [takeNonce] Your secret is 'klingel:F!Box SOAP-Auth:ringdingringdingringdingringding'
02:54:44.112 -> [takeNonce] Your hashed secret is '1a1de29becee6475893a3cb6f7c476ea'
02:54:44.112 -> [generateAuthToken] With nonce '057DABBB9EDBB793', the auth token is '2e630613791bb178b32bf3e4e619eea0'.
02:54:44.112 -> [HTTP] Prepare HTTP request to URL: 'http://192.168.178.1:49000/upnp/control/x_voip'.
02:54:44.180 -> [HTTP] POSTing the XML to SOAPACTION: 'urn:dslforum-org:service:X_VoIP:1#X_AVM-DE_DialNumber'
02:54:44.180 -> [HTTP] Request code: 200
02:54:44.214 -> [action] Response status: Authenticated
02:54:44.214 -> [action] Done.
02:54:44.214 -> [takeNonce] Extracted the nonce '26070D91BDCB909E' from the last request.
Aypac commented 4 years ago

Great to hear! Thanks for confirming :) Is always good to build some confidence before pushing to master :)