Ich möchte eigentlich nur einen Probe-Request absetzen und habe mich für die externe IP entschieden.
Mein aktueller Test findet im Postman statt und ich arbeite mit einer SID, die ich meiner Meinung nach auch korrekt über ein Pre-request-Script erhalte:
Meine Url: http://192.168.178.1:49000/upnp/control/wanipconnection1
Headers:
Content-Type: text/xml; charset=utf-8
SoapAction: urn:dslforum-org:service:WANIPConnection:1#GetExternalIPAddress
Cookie: sid=c82c75176d842922
Body:
Response:
Was mache ich falsch?
Oder muss ich einen anderen Namespace verwenden?
In meiner http://192.168.178.1:49000/tr64desc.xml finde ich unter serviceId:
urn:WANIPConnection-com:serviceId:WANIPConnection1
Wenn ich das verwende, dann erhalte ich folgende Response:
Was irgendwie komisch ist, da ich bei einem Authorisierungsproblem immer 401 erwarten würde.
Mein aktueller Test findet im Postman statt und ich arbeite mit einer SID, die ich meiner Meinung nach auch korrekt über ein Pre-request-Script erhalte:
Javascript:
// Challenge + SID holen
pm.sendRequest({
url: 'http://192.168.178.1/login_sid.lua',
method: 'GET'
}, function (err, res) {
if (err) { console.log(err); return; }
const challengeMatch = res.text().match(/<Challenge>(.*?)<\/Challenge>/);
const sidMatch = res.text().match(/<SID>(.*?)<\/SID>/);
if (!challengeMatch) {
console.log("Challenge nicht gefunden!");
return;
}
if (challengeMatch) pm.collectionVariables.set("challenge", challengeMatch[1]);
if (sidMatch) pm.collectionVariables.set("sid", sidMatch[1]);
console.log("Challenge:", pm.collectionVariables.get("challenge"));
console.log("SID:", pm.collectionVariables.get("sid"));
const hashInput = pm.collectionVariables.get("challenge") + "-" + pm.collectionVariables.get("password");
const encoder = new TextEncoder("utf-16le");
const data = encoder.encode(hashInput);
// CryptoJS MD5 (Postman built-in)
const CryptoJS = require('crypto-js');
const hash = CryptoJS.MD5(CryptoJS.enc.Utf16LE.parse(hashInput));
const response = pm.collectionVariables.get("challenge") + "-" + hash.toString();
console.log("Response:", response);
pm.environment.set("response", response);
// 3. Login POST (neue SID holen)
pm.sendRequest({
url: `http://192.168.178.1/login_sid.lua`,
method: 'POST',
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: {
mode: 'urlencoded',
urlencoded: [
{key: 'response', value: response},
{key: 'username', value: pm.collectionVariables.get("username")}
]
}
}, function (err, loginRes) {
if (err) {
console.log("Login Fehler:", err);
return;
}
// Neue SID extrahieren
const newSidMatch = loginRes.text().match(/<SID>(.*?)<\/SID>/);
if (newSidMatch) {
const newSid = newSidMatch[1];
pm.environment.set("sid", newSid);
console.log("✅ NEUE SID:", newSid);
} else {
console.log("❌ SID nicht gefunden:", loginRes.text());
}
});
});
Meine Url: http://192.168.178.1:49000/upnp/control/wanipconnection1
Headers:
Content-Type: text/xml; charset=utf-8
SoapAction: urn:dslforum-org:service:WANIPConnection:1#GetExternalIPAddress
Cookie: sid=c82c75176d842922
Body:
XML:
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<soap:Body>
<u:GetExternalIPAddress xmlns:u="urn:dslforum-org:service:WANIPConnection:1"/>
</soap:Body>
</soap:Envelope>
Response:
HTML:
<HTML>
<HEAD>
<TITLE>401 Unauthorized (ERR_NONE)</TITLE>
</HEAD>
<BODY>
<H1>401 Unauthorized</H1><BR>ERR_NONE
<HR><B>Webserver</B> Sun, 30 Nov 2025 16:52:31 GMT
</BODY>
</HTML>
Was mache ich falsch?
Oder muss ich einen anderen Namespace verwenden?
In meiner http://192.168.178.1:49000/tr64desc.xml finde ich unter serviceId:
urn:WANIPConnection-com:serviceId:WANIPConnection1
Wenn ich das verwende, dann erhalte ich folgende Response:
XML:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>401</errorCode>
<errorDescription>Invalid Action</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Was irgendwie komisch ist, da ich bei einem Authorisierungsproblem immer 401 erwarten würde.
