The `--eval` option lets you define or modify request parameters using Python. The evaluated variables can then be used inside the URL, headers, cookies, etc. Particularly useful in scenarios such as: * **Dynamic parameters**: When a parameter needs to be randomly or sequentially generated. * **Token generation**: For handling CSRF tokens or dynamic auth headers. * **Custom logic**: E.g., encoding, encryption, timestamps, etc.
sqlmap -u "http://example.com/vulnerable.php?id=1" --eval="import random; id=random.randint(1,10)"
sqlmap -u "http://example.com/vulnerable.php?id=1" --eval="import hashlib;id2=hashlib.md5(id).hexdigest()"Source: SQL Injection/SQLmap.md in PayloadsAllTheThings. From PayloadsAllTheThings by Swissky and contributors. MIT License, Copyright (c) 2019 Swissky.