sqlmap/tamper/base64encode.py

25 lines
519 B
Python
Raw Normal View History

2019-05-08 13:47:52 +03:00
#!/usr/bin/env python
2011-11-21 16:47:23 +04:00
"""
2022-01-03 13:30:34 +03:00
Copyright (c) 2006-2022 sqlmap developers (https://sqlmap.org/)
2017-10-11 15:50:46 +03:00
See the file 'LICENSE' for copying permission
2011-11-21 16:47:23 +04:00
"""
2019-05-03 14:20:15 +03:00
from lib.core.convert import encodeBase64
2011-11-21 16:47:23 +04:00
from lib.core.enums import PRIORITY
2018-02-08 18:49:16 +03:00
__priority__ = PRIORITY.LOW
2011-11-21 16:47:23 +04:00
def dependencies():
pass
2012-12-03 17:27:01 +04:00
def tamper(payload, **kwargs):
2011-11-21 16:47:23 +04:00
"""
2018-07-31 03:18:33 +03:00
Base64-encodes all characters in a given payload
2011-11-21 16:47:23 +04:00
>>> tamper("1' AND SLEEP(5)#")
'MScgQU5EIFNMRUVQKDUpIw=='
2011-11-21 16:47:23 +04:00
"""
2019-05-03 14:20:15 +03:00
return encodeBase64(payload, binary=False) if payload else payload