I'm doing a simple exercise where copy a base64 encoded cookie value, and then make a few changes and then re-encode, and then use the result to log into a site as admin.
I have the following encoded string:
Tzo0OiJVc2VyIjoyOntzOjg6InVzZXJuYW1lIjtzOjU6ImRhZHNhIjtzOjc6ImlzQWRtaW4iO2I6MDt9
I decode it like so:
$ echo Tzo0OiJVc2VyIjoyOntzOjg6InVzZXJuYW1lIjtzOjU6ImRhZHNhIjtzOjc6ImlzQWRtaW4iO2I6MDt9 | base64 --decode 1 ⨯
O:4:"User":2:{s:8:"username";s:5:"dadsa";s:7:"isAdmin";b:0;}
I then make a small change in order to be able to log in as admin:
O:4:"User":2:{s:8:"username";s:5:"dadsa";s:7:"isAdmin";b:1;}
And them attempt to encode it again:
$ echo O:4:"User":2:{s:8:"username";s:5:"dadsa";s:7:"isAdmin";b:0;} | base64 1 ⨯
zsh: parse error near `}'
Which gives me a parsing error. I did this the other day, where this worked perfectly .
Why am i not able to encode this string?