menkrep1337 / XSSCon

XSSCon: Simple XSS Scanner tool
MIT License
210 stars 60 forks source link

Cookies not working :: json.decoder.JSONDecodeError #19

Open meto1111 opened 3 years ago

meto1111 commented 3 years ago

python3 xsscon.py -u http://172.17.244.102/reflected.php --cookie "{'PHPSESSID':'njv5bi4en9dfs2fkbtcslggkmm'}"

Traceback (most recent call last):
File "xsscon.py", line 73, in
start()
File "xsscon.py", line 52, in start
core.main(getopt.u,getopt.proxy,getopt.user_agent,check(getopt),getopt.cookie,getopt.method)
File "/home/pentester/XSSCon/lib/core.py", line 148, in main
self.session=session(proxy,headers,cookie)
File "/home/pentester/XSSCon/lib/helper/helper.py", line 26, in session
r.cookies.update(json.loads(cookie))
File "/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/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)

JonasChristiano commented 1 year ago

You need to wrap the dict in single quotes. Example: python .\xsscon.py -u https://www.test.com/ --cookie '{"token";"GiOTI5OCIsiIwODRhNWQ4NC0yNTAwLTNhY2Q1OTk}'