You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The "page" value sent to the postprocess function is encoded as a string that I have not been able to decode into the original byte value within the postprocess function. If I take the string and encode it as utf-8, any byte value between 0x80 and 0xff gets mangled
if I take the string and try to encode it as 'iso-8859-1' . I inevitably get a ('UnicodeEncodeError: ordinal not in range(256)') error.
Describe the solution you'd like
I would like some way of getting the raw, binary response data out of the request response so that I have greater flexibility in processing the response data.
Describe alternatives you've considered
I've been trying to find where in the sqlmap codebase the pages are being converted to unicode so that I can manually switch the encoding to iso-8859-1, this hasn't been working and wouldn't be applicable for anyone else.
The workaround that I went with was to introduce the unzip logic through a burp extension (i.e. editing the HTTP response before it gets to sqlmap at all. Nonetheless I feel that there should be a mechanism to enable binary processing within a postprocess routine.
Additional context
The specific context that I need this for is an endpoint that returns xlsx files. My plan was to use ZipFile and BytesIO to convert the output to string via
zipfile = ZipFile(BytesIO(bytes(page, 'iso-8859-1')))
page = b''.join(zipfile.read(f) for f in zipfile.filelist).decode('iso-8859-1')
This specific context cannot be unique to this single application, so l expect to run into these issues again
The text was updated successfully, but these errors were encountered:
@elliot-kaplan with the latest revision, raw page will be passed to the postprocess functions. Afterwards, it will be converted to the unicode (for later processing with sqlmap)
i think it makes sense to give it as raw (non-Unicode) for people to work on raw data
Is your feature request related to a problem? Please describe.
The "page" value sent to the
postprocess
function is encoded as a string that I have not been able to decode into the original byte value within thepostprocess
function. If I take the string and encode it as utf-8, any byte value between 0x80 and 0xff gets mangledif I take the string and try to encode it as 'iso-8859-1' . I inevitably get a
('UnicodeEncodeError: ordinal not in range(256)')
error.Describe the solution you'd like
I would like some way of getting the raw, binary response data out of the request response so that I have greater flexibility in processing the response data.
Describe alternatives you've considered
I've been trying to find where in the sqlmap codebase the pages are being converted to unicode so that I can manually switch the encoding to iso-8859-1, this hasn't been working and wouldn't be applicable for anyone else.
The workaround that I went with was to introduce the unzip logic through a burp extension (i.e. editing the HTTP response before it gets to sqlmap at all. Nonetheless I feel that there should be a mechanism to enable binary processing within a postprocess routine.
Additional context
The specific context that I need this for is an endpoint that returns xlsx files. My plan was to use ZipFile and BytesIO to convert the output to string via
This specific context cannot be unique to this single application, so l expect to run into these issues again
The text was updated successfully, but these errors were encountered: