Skip to content
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

dict ERROR , python 3.9.5 #11

Closed
BarnabyAlexandraBaron opened this issue Feb 7, 2024 · 2 comments
Closed

dict ERROR , python 3.9.5 #11

BarnabyAlexandraBaron opened this issue Feb 7, 2024 · 2 comments

Comments

@BarnabyAlexandraBaron
Copy link

ERRO:[Encoding error] dictionary update sequence element #0 has length 1; 2 is required

Payload:python flask_session_cookie_manager3.py encode -s 'Imposs1bl3_Br0!_!H0uuD0uFXXXXXXXXX' -t '{"role":"admin"}'

python --version
Python 3.9.5

pip list is below
Package Version


blinker 1.7.0
click 8.1.7
colorama 0.4.6
flask 3.0.2
flask-session-cookie-manager 1.2.1.1
importlib-metadata 7.0.1
itsdangerous 2.1.2
jinja2 3.1.3
markupsafe 2.1.5
pip 21.1.1
setuptools 56.0.0
werkzeug 3.0.1
zipp 3.17.0

@BarnabyAlexandraBaron
Copy link
Author

BarnabyAlexandraBaron commented Feb 7, 2024

Using cmd , the erro occurs. However , using powershell can escape.

But needing payload changed , due to the malformed erro of ".

Powershell Payload:

python flask_session_cookie_manager3.py encode -s 'Imposs1bl3_Br0!_!H0uuD0uFXXXXXXXXX' -t '{\"role\":\"admin\"}'

@noraj
Copy link
Owner

noraj commented Feb 7, 2024

➜ flask-session-cookie-manager3 encode -s 'Imposs1bl3_Br0!_!H0uuD0uFXXXXXXXXX' -t '{"role":"admin"}'                                 
eyJyb2xlIjoiYWRtaW4ifQ.ZcNCPw._ssOfesATGvOBC-XfffBdtRok3Q
➜ python --version                                                                                                                                                                    
Python 3.11.6

➜ pacman -Qi python-flask | grep Version
Version         : 2.3.3-1

➜ pacman -Qi python-itsdangerous | grep Version 
Version         : 2.1.2-3

As you said, it's only an issue of PowerShell string escaping.

@noraj noraj closed this as completed Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants