Skip to content
Permalink
Browse files

Plugin arris-tg3442: describe content of the base64 encoded cookie

The cookie content probably depends on the router model.
  • Loading branch information...
sumpfralle committed Aug 13, 2019
1 parent 9b5dd91 commit 69602b1bbf80c4376ce35cf2b5b4532193379205
Showing with 14 additions and 7 deletions.
  1. +14 −7 plugins/router/arris-tg3442
@@ -73,6 +73,19 @@ import sys
import os


"""
The CREDENTIAL_COOKIE below equals the following:
base64.encodebytes(b'{ "unique":"280oaPSLiF", "family":"852", "modelname":"TG2492LG-85", '
'"name":"technician", "tech":true, "moca":0, "wifi":5, "conType":"WAN", '
'"gwWan":"f", "DefPasswdChanged":"YES" }').decode()
"""
CREDENTIAL_COOKIE = """eyAidW5pcXVlIjoiMjgwb2FQU0xpRiIsICJmYW1pbHkiOiI4NTIiLCAibW9kZWxuYW1lIjoiVEcy
NDkyTEctODUiLCAibmFtZSI6InRlY2huaWNpYW4iLCAidGVjaCI6dHJ1ZSwgIm1vY2EiOjAsICJ3
aWZpIjo1LCAiY29uVHlwZSI6IldBTiIsICJnd1dhbiI6ImYiLCAiRGVmUGFzc3dkQ2hhbmdlZCI6
IllFUyIgfQ==
"""


def login(session, url, username, password):
"""login to """
# get login page
@@ -139,13 +152,7 @@ def login(session, url, username, password):
"Referer": f"{url}/"
})
# set credentials cookie
session.cookies.set(
"credential",
"eyAidW5pcXVlIjoiMjgwb2FQU0xpRiIsICJmYW1pbHkiOiI4NTIiLCAibW9kZWxuYW1lIjoiV"
"EcyNDkyTEctODUiLCAibmFtZSI6InRlY2huaWNpYW4iLCAidGVjaCI6dHJ1ZSwgIm1vY2EiOj"
"AsICJ3aWZpIjo1LCAiY29uVHlwZSI6IldBTiIsICJnd1dhbiI6ImYiLCAiRGVmUGFzc3dkQ2h"
"hbmdlZCI6IllFUyIgfQ=="
)
session.cookies.set("credential", CREDENTIAL_COOKIE)

# set session
r = session.post(f"{url}/php/ajaxSet_Session.php")

0 comments on commit 69602b1

Please sign in to comment.
You can’t perform that action at this time.