简体   繁体   中英

Hex Entity Encoding in SQLmap

I am using SQLmap and want to hex-entitiy-encode the input before SQLmap sends it to the server. For example, hex-entity-encoding of "abc" should give me abc

I know that I should use a python tamper script which should hex-entity-encode the given input. But I don't know how I could hex-entity-encode data in Python.

May someone help?

Apply formatted string literals (also called f-strings for short) eg as follows:

a_string = 'abc Trường An Tô Nguyễn'
''.join([f'&#x{ord(ch):x};' for ch in a_string])
# 'abc Trường An Tô Nguyễn'

or eg (see Format Specification Mini-Language )

''.join([f'&#x{ord(ch):04x};' for ch in a_string])
#'abc Trường An Tô Nguyễn'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM