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

grep base64 output is wrong #33

Open
z0x0z opened this issue Mar 30, 2020 · 1 comment
Open

grep base64 output is wrong #33

z0x0z opened this issue Mar 30, 2020 · 1 comment

Comments

@z0x0z
Copy link

z0x0z commented Mar 30, 2020

Below is the content in my file.
there is a JWT token which is base64 encoded.

Cache-Control: max-age=0
< Set-Cookie: _ua={"session_id":"b24a5ce4-bd5a-4375-99a5-c5eb78c524c9","session_time_ms":1585593146162}; path=/; httponly
< Set-Cookie: jwt-session=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7ImNzcmYtc2VjcmV0Ijoi77-9Tlxu77-9VSrvv71cdTAwMTNcdTAwMDfvv71T77-977-977-977-9XHUwMDEx77-9XHUwMDEx77-9Rlx1MDAxMu-_ve-_vSDvv70877-977-9McmiMSJ9LCJpYXQiOjE1ODU1OTMxNDYsImV4cCI6MTU4NTY3OTU0Nn0.Wkn8UFPcVJIk0pV1jQI8YqeI2FJstbpXq2UMa7B0tDU; path=/; expires=Tue, 31 Mar 2020 18:32:26 GMT; httponly
< X-Content-Type-Options: nosniff

image

when I use gf, it shows only half of the base64 encoded output. that is if there is any ' - ' in base64 format then gf regex stops there and outputs until that.

Is that a bug or expected result?
Any help is appreciated!

@sudoaza
Copy link

sudoaza commented Mar 25, 2022

JWT are URL safe base64 + dots, you can add this format (didn't test it) for them.


{
    "flags": "-HnroE",
    "pattern": "eyJ[a-zA-Z0-9_-]+\.eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+={0,2}"
}

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

2 participants