Skip to content

msfpayload stderr not corrrectly parsed  #329

Closed

Description

@spenneb

Hi,

when issuing the option --os-bof to sqlmap running on Linux the output of the msfpayload command is incorrectly parsed I think.

On Linux the Output of msfpayload at least contains the line "Length: 290"
Based on the Backend.OS (Windows) the sqlmap code looks for size: \d.
I think the if-clause based on the backend-os is wrong.

    pollProcess(process)
    payloadStderr = process.communicate()[1]

    if Backend.isOs(OS.WINDOWS) or extra == "BufferRegister=EAX":
        payloadSize = re.search("size ([\d]+)", payloadStderr, re.I)
    else:
        payloadSize = re.search("Length\:\s([\d]+)", payloadStderr, re.I)

    if payloadSize:
        payloadSize = int(payloadSize.group(1))

        if extra == "BufferRegister=EAX":
            payloadSize = payloadSize / 2

        debugMsg = "the shellcode size is %d bytes" % payloadSize
        logger.debug(debugMsg)
    else:
        errMsg = "failed to create the shellcode (%s)" % payloadStderr.replace("\n", "")
        raise sqlmapFilePathException, errMsg

Activity

  1. added a commit that references this issue on Jan 2, 2013
  2. ghost assigned on Jan 2, 2013
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