ical import hinter Login - WebUntis

Begonnen von Otto, 14 November 2018, 10:18:36

Vorheriges Thema - Nächstes Thema

Otto

Hi,

ich möchte jeden Tag eine ical Datei für einen Stundenplan importieren.

Die ical liegt in einem geschützten Bereich hinter dieser Seite https://kephiso.webuntis.com/WebUntis/?school=bbs-neustadt-adw

Wie komme ich an die Datei um diese zu verarbeiten? Das Login ist leider als PopUp und ich habe dazu keine http-Adresse

Wie stelle ich das an?
Gruss Otto

.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.

docker - homematic

rischbiter123

Moin,

schau Dir mal diesen Link an. Aber wie dort auch steht, muss dies (kostenpflichtig) von der Schule dazugebucht sein. Leider (wenn auch verständlich) machen das die wenigsten.
https://www.untis.at/HTML/WebHelp/de/untis/wu_ical_kalender_abonnement.htm

LG

Andreas
4*Raspi, Max Thermostate und Fensterkontakte, FB7590, Mysensors und NanoCUL, IT und Sonoff, zigbee2mqtt2

Otto

#2
Hi Andreas,
ja, das ist ja das Problem. Ein Abo gibt es nicht.

Nach dem Login kann man aber ein ical Datei herunterladen. An die will ich ran :)
Gruss Otto

.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.

docker - homematic

rischbiter123

Kannst Du ruhig. Mache ich jeden Sonntag und lese die dann täglich in Fhem ein. Hat allerdings den Nachteil, dass man aktuelle Änderungen so nicht mitbekommt. Einen anderen Weg habe ich leider auch noch nicht gefunden.

Falls also hier jemand eine Möglichkeit sieht, ich stelle auch gerne meine Logindaten per PM zur Verfügung.

LG

Andreas
4*Raspi, Max Thermostate und Fensterkontakte, FB7590, Mysensors und NanoCUL, IT und Sonoff, zigbee2mqtt2

betateilchen

Zitat von: Otto am 14 November 2018, 10:18:36
Das Login ist leider als PopUp und ich habe dazu keine http-Adresse

Ich sehe kein Popup.

Aber kann nicht HTTPMOD die unterschiedlichsten Anmeldeverfahren? Damit käme man vielleicht ein Stück weiter und hätte die ausgelesene Seite zumindest mal in FHEM in einem Buffer stehen. Diese Daten dann an ein Calendar-device zu übergeben, sollte keine schwierige Aufgabe mehr sein.

-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

Otto

Moin,

HTTPMOD ist schwere Kost  :)

Hab mal schnell den Login mitgeschnitten.

Request

POST /WebUntis/j_spring_security_check HTTP/1.1
Host: xxx.webuntis.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: application/json
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: https://xxx.webuntis.com/WebUntis/?school=xxx
content-type: application/x-www-form-urlencoded
origin: https://xxx.webuntis.com
Content-Length: 70
Cookie: schoolname="_xxxxxxxxxxxx"; JSESSIONID=8D9CBB38DFAF68Exxxxxxxxxxx
Connection: close

school=xxx&j_username=mxx.xxxe&j_password=xxxxx&token=


Response

HTTP/1.1 200 200
Server: nginx
Date: Wed, 14 Nov 2018 13:08:55 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 34
Connection: close
Set-Cookie: JSESSIONID=7F786476B3F941BA8A4xxxxxxxxxxxx; Path=/WebUntis; HttpOnly
Set-Cookie: schoolname="_xxxxxxxxxxxx"; Expires=Wed, 28-Nov-2018 13:08:54 GMT
Set-Cookie: schoolname="_xxxxxxxxxxxx"; Expires=Wed, 28-Nov-2018 13:08:54 GMT
Set-Cookie: auth="_cxxxxx=="; Version=1; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-UA-Compatible: IE=edge

{"reload":false,"state":"SUCCESS"}


... und wie bekomme ich das jetzt in HTTPMOD ?
Wie und wo kommen die Login Daten hin.

Kann mir da einer helfen, das ist zu hoch für mich.
Gruss Otto

.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.

docker - homematic

amenomade

#6
Mit reAuthRegex Login
enableCookies 1
sid01URL xxx.webuntis.com/WebUntis/j_spring_security_check
und sid01Data school=xxx&j_username=mxx.xxxe&j_password=xxxxx&token=
solltest Du etwas anfangen können...

Gibt es nicht auch auf der Hauptseite die Möglichkeit, Login-data einzugeben? Wäre einfacher als mit dem Popup. Ich kann nicht weiter gucken, da
ZitatDer WebUntis Service steht zwischen 14.11.2018 22:00 Uhr und 15.11.2018 07:30 Uhr wegen einer Datenbankmigration nicht zur Verfügung!

Hinweis: Sie werden automatisch zu WebUntis weitergeleitet, sobald die Seite wieder verfügbar ist.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

Otto

Hi,

naja die Logindaten werden schon auf der Hauptseite eingegeben aber mit Javascript? verarbeitet.
Gruss Otto

.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.

docker - homematic

amenomade

ZitatMit reAuthRegex Login
enableCookies 1
sid01URL xxx.webuntis.com/WebUntis/j_spring_security_check
und sid01Data school=xxx&j_username=mxx.xxxe&j_password=xxxxx&token=
solltest Du etwas anfangen können...
Hast Du es probiert?
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

Otto

Danke das du nachfragst.

Nee, geht nicht. Weiß aber nicht warum.

Hier der hoffentlich richtige Teil des logs


2018.11.17 13:51:03.778 5: BBS: GetCookies is looking for Cookies
2018.11.17 13:51:03.778 4: BBS: GetCookies parsed Cookie: JSESSIONID Wert 99BE664273E123D5E7DE72D93D36E682 Rest Path=/WebUntis; HttpOnly
2018.11.17 13:51:03.778 4: BBS: GetCookies parsed Cookie: schoolname Wert "_axxxxxxxxxxxxxx" Rest Expires=Sat, 01-Dec-2018 12:51:04 GMT
2018.11.17 13:51:03.778 5: BBS: ExtractSid called, context reading, num
2018.11.17 13:51:03.778 5: BBS: CheckAuth is checking buffer with ReAuthRegex Login
2018.11.17 13:51:03.778 4: BBS: CheckAuth decided new authentication required
2018.11.17 13:51:03.778 4: BBS: Auth called with Steps: 01
2018.11.17 13:51:03.779 4: BBS: AddToQueue adds auth01, initial queue len: 0, prio
2018.11.17 13:51:03.779 5: BBS: AddToQueue prepends type auth01 to URL kephiso.webuntis.com/WebUntis/j_spring_security_check, data school=bbs-neustadt-adw&j_username=mxxx.xxxxxe&j_password=secret&token=, no headers, retry 0
2018.11.17 13:51:03.779 5: BBS: HandleSendQueue called, qlen = 1
2018.11.17 13:51:03.779 5: BBS: HandleSendQueue is using Cookie JSESSIONID with path  and Value 99BE664273E123D5E7DE72D93D36E682 (key JSESSIONID;, destination path is )
2018.11.17 13:51:03.779 5: BBS: HandleSendQueue is using Cookie schoolname with path  and Value "_axxxxxxxxxxxxxx" (key schoolname;, destination path is )
2018.11.17 13:51:03.779 5: BBS: HandleSendQueue is adding Cookie header: JSESSIONID=99BE664273E123D5E7DE72D93D36E682; schoolname="_axxxxxxxxxxxxxx"
2018.11.17 13:51:03.779 4: BBS: HandleSendQueue sends request type auth01 to URL kephiso.webuntis.com/WebUntis/j_spring_security_check,
data: school=bbs-neustadt-adw&j_username=mxxx.xxxxxe&j_password=secret&token=,
header: Cookie: JSESSIONID=99BE664273E123D5E7DE72D93D36E682; schoolname="_axxxxxxxxxxxxxx"
timeout 2
2018.11.17 13:51:03.779 5: HttpUtils url=kephiso.webuntis.com/WebUntis/j_spring_security_check
2018.11.17 13:51:03.779 3: BBS: Read callback: Error: kephiso.webuntis.com/WebUntis/j_spring_security_check: malformed or unsupported URL
2018.11.17 13:51:03.779 4: BBS: Read callback: request type was auth01 retry 0, body empty
2018.11.17 13:51:03.779 5: BBS: GetCookies is looking for Cookies
2018.11.17 13:51:03.779 4: BBS: GetCookies parsed Cookie: JSESSIONID Wert 99BE664273E123D5E7DE72D93D36E682 Rest Path=/WebUntis; HttpOnly
2018.11.17 13:51:03.779 4: BBS: GetCookies parsed Cookie: schoolname Wert "_axxxxxxxxxxxxxx" Rest Expires=Sat, 01-Dec-2018 12:51:04 GMT
2018.11.17 13:51:03.779 5: BBS: ExtractSid called, context sid, num 01
2018.11.17 13:51:03.779 4: BBS: AddToQueue adds update, initial queue len: 0
2018.11.17 13:51:03.779 5: BBS: AddToQueue adds type update to URL https://kephiso.webuntis.com/WebUntis/?school=bbs-neustadt-adw, no data, no headers, retry 1
2018.11.17 13:51:03.779 5: BBS: HandleSendQueue called, qlen = 1
2018.11.17 13:51:03.779 5: BBS: HandleSendQueue - minSendDelay not over, rescheduling


Liegt wohl an der Zeile
2018.11.17 13:51:03.779 3: BBS: Read callback: Error: kephiso.webuntis.com/WebUntis/j_spring_security_check: malformed or unsupported URL

Aber welche URL nehme ich?
Gruss Otto

.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.

docker - homematic

amenomade

#10
sid01URL und Haupt-URL mit https:// vorne

Mach mal ein "list BBS" bitte (login data ausblenden)
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

Otto

Hier das list

Internals:
   BUSY       0
   CHANGED   
   DEF        https://kephiso.webuntis.com/WebUntis/?school=bbs-neustadt-adw 120
   Interval   120
   LASTSEND   1542530347.52698
   LastAuthTry 2018-11-18 09:39:05
   MainURL    https://kephiso.webuntis.com/WebUntis/?school=bbs-neustadt-adw
   ModuleVersion 3.5.1 - 5.7.2018
   NAME       BBS
   NR         30
   STATE      ???
   TRIGGERTIME 1542530465.13284
   TRIGGERTIME_FMT 2018-11-18 09:41:05
   TYPE       HTTPMOD
   addr       https://kephiso.webuntis.com:443
   auth       0
   buf       
   code       200
   compress   1
   conn       
   data       
   displayurl https://kephiso.webuntis.com/WebUntis/?school=bbs-neustadt-adw
   header     Cookie: JSESSIONID=C480322E2226618D74CCA8CEC4188AAE; schoolname="_axxxxxxxxxxxxxx"
   host       kephiso.webuntis.com
   httpheader HTTP/1.1 200 200
Server: nginx
Date: Sun, 18 Nov 2018 08:39:08 GMT
Content-Type: text/html;charset=UTF-8
Content-Length: 4083
Connection: close
Pragma: no-cache
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Language: de
Vary: Accept-Encoding
Content-Encoding: gzip
X-UA-Compatible: IE=edge
   httpversion 1.0
   hu_blocking 0
   hu_filecount 96
   hu_port    443
   hu_portSfx
   ignoreredirects 0
   loglevel   4
   path       /WebUntis/?school=bbs-neustadt-adw
   protocol   https
   redirects  0
   timeout    2
   url        https://kephiso.webuntis.com/WebUntis/?school=bbs-neustadt-adw
   value      0
   HTTPCookieHash:
     JSESSIONID;:
       Name       JSESSIONID
       Options    Path=/WebUntis; HttpOnly
       Path       
       Value      C480322E2226618D74CCA8CEC4188AAE
     schoolname;:
       Name       schoolname
       Options    Expires=Sun, 02-Dec-2018 08:39:05 GMT
       Path       
       Value      "_axxxxxxxxxxxxxx"
   QUEUE:
   READINGS:
   REQUEST:
     data       
     header     
     ignoreredirects 0
     retryCount 1
     type       update
     url        https://kephiso.webuntis.com/WebUntis/?school=bbs-neustadt-adw
     value      0
   sslargs:
Attributes:
   disable    0
   enableCookies 1
   reAuthRegex Login
   room       IGS
   sid01Data  school=bbs-neustadt-adw&j_username=mxxx.xxxxxe&j_password=secret&token=
   sid01URL   https://kephiso.webuntis.com/WebUntis/j_spring_security_check
   userattr   sid01Data sid01URL
   verbose    5


Im Log fällt mir noch ein "HTTP response code 302" auf


2018.11.18 09:43:05.338 5: BBS: GetCookies is looking for Cookies
2018.11.18 09:43:05.338 5: BBS: ExtractSid called, context reading, num
2018.11.18 09:43:05.338 5: BBS: CheckAuth is checking buffer with ReAuthRegex Login
2018.11.18 09:43:05.338 4: BBS: CheckAuth decided new authentication required
2018.11.18 09:43:05.338 4: BBS: Auth called with Steps: 01
2018.11.18 09:43:05.338 4: BBS: AddToQueue adds auth01, initial queue len: 0, prio
2018.11.18 09:43:05.338 5: BBS: AddToQueue prepends type auth01 to URL https://kephiso.webuntis.com/WebUntis/j_spring_security_check, data school=bbs-neustadt-adw&j_username=mxxx.xxxxxe&j_password=secret&token=, no headers, retry 0
2018.11.18 09:43:05.338 5: BBS: HandleSendQueue called, qlen = 1
2018.11.18 09:43:05.338 5: BBS: HandleSendQueue is using Cookie JSESSIONID with path  and Value C480322E2226618D74CCA8CEC4188AAE (key JSESSIONID;, destination path is /WebUntis/j_spring_security_check)
2018.11.18 09:43:05.338 5: BBS: HandleSendQueue is using Cookie schoolname with path  and Value "_axxxxxxxxxxxxxx" (key schoolname;, destination path is /WebUntis/j_spring_security_check)
2018.11.18 09:43:05.338 5: BBS: HandleSendQueue is adding Cookie header: JSESSIONID=C480322E2226618D74CCA8CEC4188AAE; schoolname="_axxxxxxxxxxxxxx"
2018.11.18 09:43:05.338 4: BBS: HandleSendQueue sends request type auth01 to URL https://kephiso.webuntis.com/WebUntis/j_spring_security_check,
data: school=bbs-neustadt-adw&j_username=mxxx.xxxxxe&j_password=secret&token=,
header: Cookie: JSESSIONID=C480322E2226618D74CCA8CEC4188AAE; schoolname="_axxxxxxxxxxxxxx"
timeout 2
2018.11.18 09:43:05.338 5: HttpUtils url=https://kephiso.webuntis.com/WebUntis/j_spring_security_check
2018.11.18 09:43:05.338 4: BBS: AddToQueue adds update, initial queue len: 0
2018.11.18 09:43:05.338 5: BBS: AddToQueue adds type update to URL https://kephiso.webuntis.com/WebUntis/?school=bbs-neustadt-adw, no data, no headers, retry 1
2018.11.18 09:43:05.339 5: BBS: HandleSendQueue called, qlen = 1
2018.11.18 09:43:05.339 5: BBS: HandleSendQueue - still waiting for reply to last request, delay sending from queue
2018.11.18 09:43:05.339 4: BBS: CheckAuth requeued request update after auth, retryCount 0 ...
2018.11.18 09:43:05.418 5: HttpUtils request header:
POST /WebUntis/j_spring_security_check HTTP/1.0
Host: kephiso.webuntis.com
User-Agent: fhem
Accept-Encoding: gzip,deflate
Cookie: JSESSIONID=C480322E2226618D74CCA8CEC4188AAE; schoolname="_axxxxxxxxxxxxxx"
Content-Length: 70
Content-Type: application/x-www-form-urlencoded

2018.11.18 09:43:05.555 4: https://kephiso.webuntis.com/WebUntis/j_spring_security_check: HTTP response code 302
2018.11.18 09:43:05.555 4: HttpUtils https://kephiso.webuntis.com/WebUntis/j_spring_security_check: Redirect to https://kephiso.webuntis.com:443/WebUntis/index.do
2018.11.18 09:43:05.555 5: HttpUtils url=https://kephiso.webuntis.com:443/WebUntis/index.do
2018.11.18 09:43:05.642 5: HttpUtils request header:
POST /WebUntis/index.do HTTP/1.0
Host: kephiso.webuntis.com
User-Agent: fhem
Accept-Encoding: gzip,deflate
Cookie: JSESSIONID=C480322E2226618D74CCA8CEC4188AAE; schoolname="_axxxxxxxxxxxxxx"
Content-Length: 70
Content-Type: application/x-www-form-urlencoded

2018.11.18 09:43:05.732 4: https://kephiso.webuntis.com:443/WebUntis/index.do: HTTP response code 200
2018.11.18 09:43:05.732 5: HttpUtils https://kephiso.webuntis.com:443/WebUntis/index.do: Got data, length: 12949
2018.11.18 09:43:05.732 5: HttpUtils response header:
HTTP/1.1 200 200
Server: nginx
Date: Sun, 18 Nov 2018 08:43:06 GMT
Content-Type: text/html;charset=UTF-8
Content-Length: 4083
Connection: close
Pragma: no-cache
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Language: de
Vary: Accept-Encoding
Content-Encoding: gzip
X-UA-Compatible: IE=edge
2018.11.18 09:43:05.732 4: BBS: Read callback: request type was auth01 retry 0,
Body:
Gruss Otto

.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.

docker - homematic

amenomade

HTTP 302 = redirect
Ihm fehlt wahrscheinlich etwas, um die Anmeldung zu erkennen. Da muss man mit Burp ein bisschen das Loginverfahren weiter analysieren.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

rischbiter123

Moin,

versuch mal das als URL, natürlich für Deine Schule:
http://bbs1.bbs-wilhelmshaven.de/weitere-seiten/vertretungsplan.html

Ist auch WebUntis und zeigt mir nach dem Einloggen den Stunden- bzw. Vertretungsplan des Tages.

LG

Andreas
4*Raspi, Max Thermostate und Fensterkontakte, FB7590, Mysensors und NanoCUL, IT und Sonoff, zigbee2mqtt2

amenomade

Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus