Skip to content

response decode error when found sequence like &#xd #5220

Description

@drJabber

Describe the bug
Sqlmap returns connection error if there's single character hex sequence in target response

To Reproduce

Expected behavior
decode response page correctly

The error is in

page = re.sub(b"&#x([0-9a-f]{1,2});", lambda _: decodeHex(_.group(1) if len(_.group(1)) == 2 else "0%s" % _.group(1)), page)

page = re.sub(b"&#x([0-9a-f]{1,2});", lambda _: decodeHex(_.group(1) if len(_.group(1)) == 2 else "0%s" % _.group(1)), page)
I think there should be binary format in "0%s" % _.group(1) - something like
b"0%s" % _.group(1)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions