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

Documentation for cookies is wrong #27

Open
SimonSchoeni opened this issue Oct 26, 2021 · 0 comments
Open

Documentation for cookies is wrong #27

SimonSchoeni opened this issue Oct 26, 2021 · 0 comments

Comments

@SimonSchoeni
Copy link

SimonSchoeni commented Oct 26, 2021

Your cookie support works fine! However the documentation you provide in your documentation is wrong. If one follows your documenation they will run into an error with the json parser.

To Reproduce
If i run
python3 -u myhost.com --cookie {'ID':'1094200543'}

you will run into the following error:

Traceback (most recent call last):                                                                                                                                                  
  File "/home/kali/Desktop/MasterTools/PwnXSS/pwnxss.py", line 73, in <module>                                                                                                      
    start()                                                                                                                                                                         
  File "/home/kali/Desktop/MasterTools/PwnXSS/pwnxss.py", line 52, in start                                                                                                         
    core.main(getopt.u,getopt.proxy,getopt.user_agent,check(getopt),getopt.cookie,getopt.method)                                                                                    
  File "/home/kali/Desktop/MasterTools/PwnXSS/lib/core.py", line 163, in main                                                                                                       
    self.session=session(proxy,headers,cookie)                                                                                                                                      
  File "/home/kali/Desktop/MasterTools/PwnXSS/lib/helper/helper.py", line 26, in session                                                                                            
    r.cookies.update(json.loads(cookie))                                                                                                                                            
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads                                                                                                                    
    return _default_decoder.decode(s)                                                                                                                                               
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode                                                                                                                    
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())                                                                                                                               
  File "/usr/lib/python3.9/json/decoder.py", line 353, in raw_decode                                                                                                                
    obj, end = self.scan_once(s, idx)                                                                                                                                               
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)   

which is completely fine since the Json parser requires properties in double quotes. Single quotes are not valid. Furthermore the json parser requires a string to be passed. Your documentation guides the user into providing the json object itself which is off.

When changing the request to actually take the functionallity of the parser into account the request works.
python3 pwnxss.py -u myhost.com --cookie "{\"ID\":\"1094200543\"}"
Expected behavior
There are two possibilities how you could fix this.

  • Correct your documentation
  • Actually allow to pass the json object and stringify it correctly
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

1 participant