Einzelnen Beitrag anzeigen

WunniKunz

Registriert seit: 13. Feb 2024
8 Beiträge
 
#18

AW: Maschinesteuern mit TNetHttpClient

  Alt 14. Apr 2024, 20:02
Das Passwort ist sicher wichtig, viel wichtiger ist mir aber im Moment wie ich den Authentifizierungsstring speichere und bei jedem Get bzw. Post mitschicke.
Weiss hier jemand etwas?

Auf verschiedenen Wunsch hier noch die Sende und Empfangsdaten mitgeschrieben mit NirSoft-SmartSniff:
Bei Post mit vorheriger Authentifizierung sieht man, daß der Authentifizierungsstring erzeugt, bei Post aber nicht mitgesendet wird.

Authentifizierung mit Browser:

GET /index.html HTTP/1.1
Host: 192.168.178.25:8080
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding: gzip, deflate
Accept-Language: de,de-DE;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6


HTTP/1.1 401 Unauthorized
Content-Length: 13
WWW-Authenticate: Basic realm="DachsEthernet"
Date: Sun, 14 Apr 2024 18:41:51 GMT

ACCESS DENIED
GET /index.html HTTP/1.1
Host: 192.168.178.25:8080
Connection: keep-alive
Cache-Control: max-age=0
Authorization: Basic R0xUOjI2MjE3NQ==
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding: gzip, deflate
Accept-Language: de,de-DE;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6


HTTP/1.1 200 OK
Content-Length: 1145
Content-Type: text/html;charset=iso-8859-1
Date: Sun, 14 Apr 2024 18:42:03 GMT


Authentifizierung mit Delphi, Methode Get:

GET /getKey?k=Hka_Mw1.usDrehzahl&_rnd=9619 HTTP/1.1
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded; charset=ASCII
Accept: text/html
Accept-Charset: utf-8
Accept-Encoding: gzip, deflate
Accept-Language: de-DE,de
User-Agent: Mozilla/5.0
Host: 192.168.178.25:8080


HTTP/1.1 401 Unauthorized
Content-Length: 13
WWW-Authenticate: Basic realm="DachsEthernet"
Date: Sun, 14 Apr 2024 12:09:33 GMT

ACCESS DENIED
GET /getKey?k=Hka_Mw1.usDrehzahl&_rnd=9619 HTTP/1.1
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded; charset=ASCII
Accept: text/html
Accept-Charset: utf-8
Accept-Encoding: gzip, deflate
Accept-Language: de-DE,de
User-Agent: Mozilla/5.0
Host: 192.168.178.25:8080
Authorization: Basic R0xUOjI2MjE3NQ==


HTTP/1.1 200 OK
Content-Length: 22
Cache-Control: max-age=4, must-revalidate
Content-Type: text/plain
Date: Sun, 14 Apr 2024 12:09:33 GMT

Hka_Mw1.usDrehzahl=0

Delphi mit Methode Post mit Authentifizierungsanforderung vor Senden von Post :

==================================================
Index : 3
Protocol : TCP
Local Address : 10.211.55.3
Remote Address : 192.168.178.25
Local Port : 61815
Remote Port : 8080
Local Host : WUNNIBALDKUC143.localdomain
Remote Host : dachs.fritz.box
Service Name :
Packets : 12 {6 ; 6}
Data Size : 1.265 Bytes {952 ; 313}
Total Size : 2.081 Bytes {1.192 ; 889}
Data Speed : 0.1 KB/Sec
Capture Time : 12.04.2024 15:15:32:861
Last Packet Time : 12.04.2024 15:15:44:848
Duration : 00:00:11.987
Local MAC Address :
Remote MAC Address:
Local IP Country :
Remote IP Country :
==================================================

GET /getKey?k=Hka_Mw1.usDrehzahl&_rnd=9619 HTTP/1.1
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded; charset=ASCII
Accept: text/html
Accept-Charset: utf-8
Accept-Encoding: gzip, deflate
Accept-Language: de-DE,de
User-Agent: Mozilla/5.0
Host: 192.168.178.25:8080


HTTP/1.1 401 Unauthorized
Content-Length: 13
WWW-Authenticate: Basic realm="DachsEthernet"
Date: Fri, 12 Apr 2024 13:15:32 GMT

ACCESS DENIED
GET /getKey?k=Hka_Mw1.usDrehzahl&_rnd=9619 HTTP/1.1
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded; charset=ASCII
Accept: text/html
Accept-Charset: utf-8
Accept-Encoding: gzip, deflate
Accept-Language: de-DE,de
User-Agent: Mozilla/5.0
Host: 192.168.178.25:8080
Authorization: Basic R0xUOjI2MjE3NQ==


HTTP/1.1 200 OK
Content-Length: 22
Cache-Control: max-age=4, must-revalidate
Content-Type: text/plain
Date: Fri, 12 Apr 2024 13:15:32 GMT

Hka_Mw1.usDrehzahl=0


POST /setKeys HTTP/1.1
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Accept: text/html
Accept-Charset: utf-8
Accept-Encoding: gzip, deflate
Accept-Language: de-DE,de
User-Agent: Mozilla/5.0
Content-Length: 34
Host: 192.168.178.25:8080

Stromf_Ew.Anforderung_GLT.bAktiv=1
  Mit Zitat antworten Zitat