jankeymeulen / siemens-logo-rest

Trying to make sense of the Siemens Logo sort-of built-in REST API
33 stars 2 forks source link

Security-Hint is not infinite valid #1

Open fafr84 opened 3 years ago

fafr84 commented 3 years ago

Hi, first of all many thank to your research about the internal api of siemens logo 🥇 It works for me only the first - let's say five times. After that the security hint seems to be invalid and i'm getting back a "403 - forbidden" response. Did you maybe figure our how to get a lifetime valid security hint or how to create a security hint out of username/password or some other way to communicate unlimited?

Thanks and greetings Fabian

jankeymeulen commented 3 years ago

Did you check the "keep me logged on" checkbox?

See this screenshot

fafr84 commented 3 years ago

Hi, yes i've tried it with and without "keep me logged on". The special thing is, i want to use it with tasker, so i have created a http request task with a 'post '-command. The first few times it worked and suddenly it stopped (maybe because i've closed browser window which was used to sniff security hint). Any idea for me?

jankeymeulen commented 3 years ago

Hmm, I'd need to check. After researching this, I've finally got Modbus working, so didn't use it really anymore.

What is the version of the firmware you're running on the Logo?

jankeymeulen commented 3 years ago

I checked, just browsed to the Logo, got myself a new security hint, and it seems to be working still after > 1000 tries. :-D

FW version is 1.82.01.

You're using the same IP address to get the security hint and where Tasker is running? (Which may not be all that easy but it seems the Logo is remembering the IP address and the hint together.)

fafr84 commented 3 years ago

Actually on logo there is running fw 1.82.02.03.9222l. Mhh maybe modbus is also a solution for me :) Would you explain how to communicate with to me? You can directly contact me by mail fafr84@googlemail.com

At the moment i finally got snap7 running on a pi. But maybe i can skip this middleware with your help.

Thanks Fabian

parthdshah9 commented 3 years ago

Can you please share the solution to fetch the variable of LOGO using Modbus then? @fafr84 @jankeymeulen

Actually on logo there is running fw 1.82.02.03.9222l. Mhh maybe modbus is also a solution for me :) Would you explain how to communicate with to me? You can directly contact me by mail fafr84@googlemail.com

At the moment i finally got snap7 running on a pi. But maybe i can skip this middleware with your help.

Thanks Fabian

jankeymeulen commented 3 years ago

Sorry must have missed your earlier reply. Since my Logo is used to control my home, I'm using Home Assistant which has support for modbus built in.

I've also used https://github.com/epsilonrt/mbpoll to test out things, works as well. Documentation for the Logo has all the modbus mappings laid out.

parthdshah9 commented 3 years ago

I found the solution using Sharp7 library and I built the REST wrapper which can provide me the real-time data of any address of LOGO PLC. Moreover, as it does not using protocols that Web Server uses, it can retrieve data anytime without username and password.

jankeymeulen commented 3 years ago

Ah, would you care to share that wrapper?

parthdshah9 commented 3 years ago

Ah, would you care to share that wrapper?

Sure. I'll publish a new repo.