D
D
Dima_kras2019-06-13 16:17:20
Python
Dima_kras, 2019-06-13 16:17:20

How to get the token that the site gives when logging in?

Good afternoon, I'm trying to parse the admin panel of the Teltonika router so that the script can get connection data from the admin panel. The problem is that after I logged in, "stok" is added to the url, for example 192.168.5.1/cgi-bin/luci/;stok=b0f53878dbbc297d8cf...
I'm trying to do this:

payload = {
        "username": "admin",
        "password": "admin"
    }

    # Perform login
    result = session_requests.post("http://192.168.5.1", data=payload, headers=dict(referer="http://192.168.5.1."))

I looked at what I get in result, there is no stok.
I tried to get data after login - it gives out the authorization page again.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question