This is a JWT token eyJ2aXNpdHMiOjF9.XKk6Hg.KhrS6NOVPIU650njthC8IFdzoWM it contains {"visits": 1}.
We can't spoof that token so I guess we must set the cookie and make another request so server will ask us to set {"visits": 2} etc. and a lot of request later we will get the flag.
I could have write a ruby script but I was curious if Burp Suite could do it.
So here what I did:
Let's send the request to the Intruder
Add a Payload position at the session cookie value
Go to the Payloads tab and in the Payloads Sets section you must set Payload type as Recursive grep , this will extract the cookie from the Set-Cookie server response and set it for the next request.
Go to the Options tab, then go to the Grep - Extract section, check the option Extract the following items from responses , click Add and select the cookie value : this will automatically set an extract rule
Then go to the Grep - Match section, check the option Flag result items with responses matching these expressions, add cbmctf and flag in order to match the flag when it will appear, uncheck the option Exclude HTTP headers in case the flag is in a cookie or something similar
Go back to he Payloads tab, then go to the Payload Options [Recursive grep] section, select the extract rule we just set, add the initial payload eyJ2aXNpdHMiOjR9.eXKk7JA.ei8tMzkQyg7An4GW3KciwB61LEUk and be don't check the option Stop if duplicate payload found
Go to the Payload Processing section and add a URL-decode rule else the JWT token library won't be able to understand that %2e is a dot . and you will repeat visit n°1 again and again
Go to Payload Encoding section and uncheck URL-encode these characters, else dot will be re-encoded right after being decoded
Click Start attack
Wait, we didn't made the match rules for nothing, we don't have to manually check each answer