HTTPMOD Form-Data Problem

Begonnen von Rampler, 07 August 2018, 17:43:38

Vorheriges Thema - Nächstes Thema

Rampler

Hallo zusammen,
Ihr seid meine letzte Hoffnung...
Ich möchte mein Gast-WLAN von FHEM aus steuern, hat auch immer funktioniert, jetzt nach Firmware Update des Routers nicht mehr.
Wenn ich im Burp folgendes abstetze funktioniert es:
POST /cgi-bin/luci/admin/network/wireless HTTP/1.1
Host: 192.168.1.4
User-Agent: Fhem
Content-Type: multipart/form-data; boundary=xx
Cookie: sysauth=ebaf3284189e113ecca10841cd5d93b0
Content-Length: 243

--xx
Content-Disposition: form-data; name="token"

7ac7642aad09153a2806fca7b5015add
--xx
Content-Disposition: form-data; name="cbi.submit"

1
--xx
Content-Disposition: form-data; name="cbid.wireless.cfg053579.__disable__"

1
--xx--


Ohne die Leerzeilen nach Content-.* funktioniert es nicht !

Mit HTTPMOD habe ich es so versucht:

attr WZ.router set01Data01 --xx
attr WZ.router set01Data02 Content-Disposition: form-data;; name="token"
attr WZ.router set01Data03 ''
attr WZ.router set01Data04 %token%
attr WZ.router set01Data05 --xx
attr WZ.router set01Data06 Content-Disposition: form-data;; name="cbi.submit"
attr WZ.router set01Data07 ''
attr WZ.router set01Data08 1
attr WZ.router set01Data09 --xx
attr WZ.router set01Data10 Content-Disposition: form-data;; name="cbid.wireless.cfg053579.__disable__"
attr WZ.router set01Data11 ''
attr WZ.router set01Data12 $val
attr WZ.router set01Data13 --xx--
attr WZ.router set01Header1 Content-Type: multipart/form-data;; boundary="xx"
attr WZ.router set01Header2 Accept-Language: de,en-US;;q=0.7,en;;q=0.3
attr WZ.router set01IMap 1:off, 0:on
attr WZ.router set01Name gast_wlan
attr WZ.router set01URL http://192.168.1.4/cgi-bin/luci/admin/network/wireless


Das Problem scheint zu sein, dass ich mit set01Dataxx keinen leerzeilen eingefügt bekomme.
Weiß da jemand Rat ?

Das Log sagt folgendes:
2018.08.07 17:39:50 5: WZ.router: set called with gast_wlan on
2018.08.07 17:39:51 5: WZ.router: set found option gast_wlan in attribute set01Name
2018.08.07 17:39:51 5: WZ.router: set found on in rmap and converted to 0
2018.08.07 17:39:51 4: WZ.router: set will now set gast_wlan -> 0
2018.08.07 17:39:51 4: WZ.router: AddToQueue adds set01, initial queue len: 0
2018.08.07 17:39:51 5: WZ.router: AddToQueue adds type set01 to URL http://192.168.1.4/cgi-bin/luci/admin/network/wireless, data --xx
Content-Disposition: form-data; name="token"
''
%token%
--xx
Content-Disposition: form-data; name="cbi.submit"
''
1
--xx
Content-Disposition: form-data; name="cbid.wireless.cfg053579.__disable__"
''
$val
--xx--, header Content-Type: multipart/form-data; boundary="xx"
Accept-Language: de,en-US;q=0.7,en;q=0.3, retry 0
2018.08.07 17:39:51 5: WZ.router: HandleSendQueue called, qlen = 1
2018.08.07 17:39:51 5: WZ.router: Replace called for type set01, regex %token%, mode reading, value token input: Content-Type: multipart/form-data; boundary="xx"
Accept-Language: de,en-US;q=0.7,en;q=0.3
2018.08.07 17:39:51 5: WZ.router: Replace called for type set01, regex %token%, mode reading, value token input: --xx
Content-Disposition: form-data; name="token"
''
%token%
--xx
Content-Disposition: form-data; name="cbi.submit"
''
1
--xx
Content-Disposition: form-data; name="cbid.wireless.cfg053579.__disable__"
''
$val
--xx--
2018.08.07 17:39:51 5: WZ.router: Replace: reading value is 7ac7642aad09153a2806fca7b5015add
2018.08.07 17:39:51 4: WZ.router: Replace: match for type set01, regex %token%, mode reading, value token, input: --xx
Content-Disposition: form-data; name="token"
''
%token%
--xx
Content-Disposition: form-data; name="cbi.submit"
''
1
--xx
Content-Disposition: form-data; name="cbid.wireless.cfg053579.__disable__"
''
$val
--xx--, result is --xx
Content-Disposition: form-data; name="token"
''
7ac7642aad09153a2806fca7b5015add
--xx
Content-Disposition: form-data; name="cbi.submit"
''
1
--xx
Content-Disposition: form-data; name="cbid.wireless.cfg053579.__disable__"
''
$val
--xx--
2018.08.07 17:39:51 5: WZ.router: Replace called for type set01, regex %token%, mode reading, value token input: http://192.168.1.4/cgi-bin/luci/admin/network/wireless
2018.08.07 17:39:51 5: WZ.router: HandleSendQueue is using Cookie sysauth with path /cgi-bin/luci/ and Value 36eb0d604a6c51da465d56c640099fb7 (key sysauth;/cgi-bin/luci/, destination path is /cgi-bin/luci/admin/network/wireless)
2018.08.07 17:39:51 5: WZ.router: HandleSendQueue is adding Cookie header: sysauth=36eb0d604a6c51da465d56c640099fb7
2018.08.07 17:39:51 4: WZ.router: HandleSendQueue sends request type set01 to URL http://192.168.1.4/cgi-bin/luci/admin/network/wireless,
data: --xx
Content-Disposition: form-data; name="token"
''
7ac7642aad09153a2806fca7b5015add
--xx
Content-Disposition: form-data; name="cbi.submit"
''
1
--xx
Content-Disposition: form-data; name="cbid.wireless.cfg053579.__disable__"
''
0
--xx--,
header: Content-Type: multipart/form-data; boundary="xx"
Accept-Language: de,en-US;q=0.7,en;q=0.3
Cookie: sysauth=36eb0d604a6c51da465d56c640099fb7
timeout 10
2018.08.07 17:39:51 5: HttpUtils url=http://192.168.1.4/cgi-bin/luci/admin/network/wireless
2018.08.07 17:39:51 1: Guest WIFI started via FHEM-GUI or Quickfhem
2018.08.07 17:39:51 5: HttpUtils request header:
POST /cgi-bin/luci/admin/network/wireless HTTP/1.1
Host: 192.168.1.4
User-Agent: fhem
Accept-Encoding: gzip,deflate
Connection: Close
Content-Type: multipart/form-data; boundary="xx"
Accept-Language: de,en-US;q=0.7,en;q=0.3
Cookie: sysauth=36eb0d604a6c51da465d56c640099fb7
Content-Length: 249

2018.08.07 17:39:52 4: http://192.168.1.4/cgi-bin/luci/admin/network/wireless: HTTP response code 200
2018.08.07 17:39:52 5: HttpUtils http://192.168.1.4/cgi-bin/luci/admin/network/wireless: Got data, length: 17772
2018.08.07 17:39:52 5: HttpUtils response header:
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
X-CBI-State: 2
Content-Type: text/html
Cache-Control: no-cache
Expires: 0
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
2018.08.07 17:39:52 4: WZ.router: Read callback: request type was set01 retry 0,
Body: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Repeater_WZ - Wireless - LuCI</title>
<meta name="viewport" content="initial-scale=1.0">
<link rel="stylesheet" href="/luci-static/bootstrap/cascade.css?v=git-18.213.60274-7d69fa6">
<link rel="stylesheet" media="only screen and (max-device-width: 854px)" href="/luci-static/bootstrap/mobile.css?v=git-18.213.60274-7d69fa6" type="text/css" />
<link rel="shortcut icon" href="/luci-static/bootstrap/favicon.ico">
<script src="/luci-static/resources/cbi.js?v=git-18.213.60274-7d69fa6"></script>
<script src="/luci-static/resources/xhr.js?v=git-18.213.60274-7d69fa6"></script>


VG Klaus
3 HMUART (2 via ESP8266), 1 DUOFERN, 9 ESP8266, RPI2 (Bullseye), ZWAVE, HM-Classic, und hoch zufrieden ...
Danke an alle, die was dazu beigetragen haben !!

Rampler

Ich will die Frage mal anders stellen:
Kann HTTPMOD mit:
Content-Type: multipart/form-data;
umgehen ?
Hat das bei einem von euch evtl. schon funktioniert ?

VG
Klaus
3 HMUART (2 via ESP8266), 1 DUOFERN, 9 ESP8266, RPI2 (Bullseye), ZWAVE, HM-Classic, und hoch zufrieden ...
Danke an alle, die was dazu beigetragen haben !!