Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bypassing ConvertSQL->convertFromSQLHex() 1/2 #63

@geralt

Description

@geralt

the function convertFromSQLHex() converts SQLHEX to plain text. This meaning that if I use this attack vector:

SELECT 0x6D7973716C

The function must detect it and decode the string. But not. Try yourself and you'll see that converted string doesn't is:

SELECT mysql

This is due to the function detects ' 0x6D7973716C' instead of '0x6D7973716C', an extra white space that disturbs the later conversion process. To fix the problem replace line:

foreach (str_split(trim($match), 2) as $hex_index) {

With:

if (strpos($match, ' ') !== false) $converted = ' ';
foreach (str_split(trim($match), 2) as $hex_index) {

Regards

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions