Best 2 Know

The Ultimate Blogging Resource

  • Advertising
  • WebHosting
  • Contact Us
  • Blogger
    • Blogger Templates
    • Blogger Tutorials
  • Browser
    • Firefox
    • Google Chrome
  • Google
  • Internet
    • Facebook
    • Twitter
  • Thesis
  • Windows
  • WordPress
    • WordPress Themes
    • WordPress Plugins
  • More
    • Linux
    • Review
    • Solutions
    • Announcements

Author: Ritesh Sanap

What is SQL Injection ? Why So Dangerous ?

A friend of mine at College was asking me this.
SQL injection is the most common and videly used exploit by hackers all over the world…few days back i was just doing some SQL injection test on Indian govt sites, I was shocked to see how many imp govt sites r open to it….this is a big thread for us…a malicious hacker can do a lot of harm if he wish to.

Vocabulary:

* SQL: Server Query Language-used in web applications to interact with databases.
* SQL Injection: Method of exploiting a web application by supplying user input designed to manipulate SQL database queries.
* “Injection”: You enter the injections into an html form which is sent to the web application. The application then puts you input directly into a SQL query. In advertantly, this allows you to manipulate to query…

Prerequisite:

* A background of programming and a general idea of how most hacking methods are done.

http://res.sys-con.com/story/jun06/232071/afshar-fig5.jpg

Application:

* Hacking a SQL database-driven server (usually only the ones that use unparsed user input in database queries). There is still a surprising number of data-driven web applications on the net that are vulnerable to this type of exploit. Being as typical as all method, the frequency of possible targets decreases over time as the method becomes more known. This is one those exploits that aren’t easily prevented by a simple patch but by a competent programmer.

Use:
First, let’s look at a typical SQL query:
SELECT fieldName1, fieldName2 FROM databaseName WHERE restrictionsToFilterWhichEntriesToReturn

Now, to dissect…
The red areas is where criterion is inputed. The rest of the query structures the query.

* SELECT fieldName1, fieldName2 – Specifies the of the names of fields that will be returned from the database.
* FROM databaseName – Specifies the name of the database to search.
* WHERE restrictionsToFilterWhichEntriesToReturn – Specifies which entries to return.

Here is an example for somebody’s login script:

SELECT userAcessFlags FROM userDatabase WHERE userName=”(input here)” AND userPass=”(input here)“

The idea is guess what that application’s query looks like and input things designed to return data other than what was intended.

In the example, input like the following could give gain access to the administrator account:

User: administrator
Pass: ” OR “”=”

Making the query like this:

SELECT userAcessFlags FROM userDatabase WHERE userName=”administrator” AND userPass=”” OR “”=”“

As you can see, “”=”” (nothing does indeed match nothing)
Note: Injections are rarely as simple as this…

One can be creative and use error messages to your advantadge to access other databases, fields, and entries. Learn a little SQL to use things like UNION to merges query results with ones not intended.On the security side, parse user data and get rid of any extra symbols now that you know how it’s done.

The idea in this example is to break out of the quotation marks.
When stuff is inside quotation marks, the stuff isn’t processed as code or anything but as a phrase and what it is.

The password injection was: “ OR “”=“
What this does is close the string that was started by the quotation mark in the part userPass=”. Once you break out, THEN stuff is considered code. So, I put OR “”=” after I break out of the string. You will notice that it is comparing two quotation marks with one, but the quotation mark already built in by the application finishes it so we have this:
userPass=”” OR “”=””
Notice how the first and last quotation marks are not colored and are not built in.

Additional notes:
This was just an extremely simplified version and you will probably need to learn a little SQL to fully understand.

Here are a few SQL terms that do other things:
UNION: You use this to merge the results of one query with another. You may put things like SELECT after UNION in order to search other databases and stuff. Sometimes you may need to use ALL in conjuction to break out of certain clauses. It does no harm so when in doubt you could do something like:
” UNION ALL SELECT 0,”,’hash’ FROM otherDatabase WHERE userName=”admin
The key when using UNION is to make your new query return the same amount of columns in the same datatype so that you may get the results you want.

:– This works sometimes to terminate the query so that it ignores to the rest of the stuff that might be fed afterwards if you don’t like it. For example:
SELECT * FROM userDatabase WHERE userName=”admin”;–” AND userPass=”aH0qcQOVz7e0s”

NOT IN: If you have no idea which record you want you could record cycle (you request vague info, and you put what you already got in the NOT IN clause so that you can get the next entry)
Usage:
SELECT userName userPass FROM userDatabase WHERE userName NOT IN (‘Dehstil’,’Twistedchaos’)

EXEC: This command should never work, but if it does…you win; you could do anything. For instance, you could inject something like this:
‘;EXEC master.dbo.xp_cmdshell ‘cmd.exe dir c:

All my examples so far have dealt with read processes. To manipulate a write process, here is an example for those who know what their doing:
INSERT INTO userProfile VALUES(”+(SELECT userPass FROM userDatabase WHERE userName=’admin’)+” + ‘Chicago’ + ‘male’)
This example would theoretically put the admin’s password in your profile.

July 8, 2008 Ritesh Sanap Internet, Windows Cool things

Check if your Antivirus Is Working Properly

What do you think ?? How effectively does it work for your security ??
Well there is a sipmple ways ti find it out. In fact this trick is really amazing and surprising.

To Test your Anti-Virus do the follwing :

  • Open Notepad (start > all programs > accessories > notepad)
  • Now Copy this code in the text file….
  • Then save it with the name fakevirus.exe

Now, If the File got Detected/Deleted Immediately .. It means your Antivirus is working Properly.

Info : This test virus was developed by the European Institute for Computer Anti-Virus Research (EICAR) to provide an easy (and safe!) way to test whether your anti-virus software is working, and see how it reacts when a virus is detected. It is supported by most leading vendors, such as IBM, McAfee, Sophos, and Symantec/Norton.

July 8, 2008 Ritesh Sanap Internet, Windows Cool things, Software

Notepad Tricks – Part 1


These are some really amazing notepad tricks which you can see in the windows notepad. Check them out right away.

Trick 1

  • Open Notepad
  • Write following line in the notepad.
    ” this app can break ” without the quotes.
  • Save this file as xxx.txt
  • Close the notepad.
  • Open the file again.

Viola!!

Trick 2

  • Open Notepad
  • Enter four words separated by spaces, wherein the first word has 4 letters, the next two have three letters, and the last word has five letters
  • DON’T hit enter at the end of the line.
  • Save the file.
  • Close Notepad.
  • Reopen Notepad.
  • Open the file you just saved.

Trick 3

  • Open a note pad
  • Type ” Bush hid the facts ” .
  • Save that file,
  • Close it
  • Again open and see…

Trick 4

NOTEPAD “World Trade Centre Trick”.. ::

Did you know that the flight number of the plane that had hit WTC …on
9/11 was Q33N ….Open your Notepad in ur computer and type the flight
number i.e Q33N… Increase the Font Size to 72, Change the Font to
Wingdings. U will be amazed by the findings.

Trick 5

Log trick !! Make your Notepad a diary ::

Sometimes we want to insert current data and time, whenever we open the file in the notepad. If you are a lazy person like me, who don’t like to press F5 whenever you open a notepad. Then here is a trick to avoid this. Just add a .LOG in the first line of your text file and close it.
Whenever you open the file with that text in the first line in the notepad, it will insert the current date and time at the end of the file. You can start entering your text after that.

July 7, 2008 Ritesh Sanap Windows Cool things

Format HDD with Notepad

Step 1.
Write The Following In Notepad Exactly as it says

Code : 01001011000111110010010101010101010000011111100000

Step 2.
Save As it as .EXE and any Name would Do.


Step 3.
Make an Ethical use of it. This .exe file can be really dangerous.

July 7, 2008 Ritesh Sanap Windows Cool things

Lock a Folder Using Notepad

Want to know how to to lock a folder using Notepad ?


Here is the trick :

  • Consider you want to lock a folder named PICS in your D:\ , whose path is D:\PICS
  • Now open the Notepad and type the following

    ren pics pics.{21EC2020-3AEA-1069-A2DD-08002B30309D}

  • Where pics is your folder name. Save the text file as lock.bat in the same drive.
  • Open another new notepad text file and type the following

    ren pics.{21EC2020-3AEA-1069-A2DD-08002B30309D} pics

  • Save the text file as key.bat in the same drive.

Usage :

  • To lock the pics folder, simply click the loc.bat and it will transform into control panel icon which is inaccessible.
  • To unlock the folder click the key.bat file. Thus the folder will be unlocked and the contents are accessible.

July 7, 2008 Ritesh Sanap Internet, Windows Cool things

Clean Your Messy Desktop & Organize Your Stuff !

If your desktop looks something like this then you NEED TO READ THIS POST !

Well the awesome screen shot of the desktop was mine until I realised the reason we have a messy desktop is it so easy to access and we go on adding stuff untill we get the annoying windows clean my desktop wizard like an unwanted House keeping knock on a cheesy motel !

Not any more….also check out a way to launch your fav programs faster than searching in start menu !

Well here is how we do it, we are going to create an alternative to desktop !

1) Create a folder which will be your alternative to desktop.

I strongly recommend that you create this Folder other than C: as a matter of fact you should not be using C: to store any personal file since if you need to format your C: all the personal file will be lost !

I am going to call this folder Quickdesk

Make it hidden (By right click properties)

2) Add quickdesk to task bar

This is best way to access the quickdesk since it will contain folders (such as Music, Movies, Photos etc)

To add Rightclick on Taskbar > Toolbars > New Toolbars
Then browse to the location where you have quickdesk. This adds a toolbar by which you can directly go to the place where you want to go.

As you start using this you will realise how productive this way is !

(Just in case you are wondering what are those folders, there are not default. These are the folders created earlier)

3) Create a shortcut of Quickdesk
You can do this by the usual method by Right – click on the folder Create short cut and then rename the Shortcut to Quickdesk.

Now to add some style choose a icon for the Shortcut By Right click > Properties > Shortcut tab > Change Icon. You can even choose a fancy one by clicking browse.

4) Copy the shortcut to Desktop

We are adding a shortcut to desktop for one main reason is access the quickdesk while Uploading or dowloading you don’t have to browse for Quickdesk instead just go to desktop and click on Quickdesk icon which will take you to the Quickdesk folder.

5) Add this short cut to your Quick launch

You can add to Quick lauch by dragging the Shortcut from desktop to the quick launch.

This will be the fastest way to access the Quickdesk !
If you don’t have the Quick launch toolbar than you can add that by Right clicking the taskbar > Toolbars > Quick launch

6) Copy to windows folder

Copy Quickdesk short cut to windows folder ( By default c:windows) so that we can launch by the run (windows + R ) or start > Run

Just by typing quickdesk and clicking run will launch the folder.
You can use this method for launching folders inside the quickdesk folder.

How to Start using ?

The idea is to use shortcuts to organise the most accessed data we have. We keep our data disorganised to different reasons such as space availability, convenience etc. So while your Music might be in some folder in d: your photos in several different place !

Create folders for each type of category. Photo, Movies, Videos, Music, downloads to name a few !

Here comes the Oh yeah moment !

So assume you have songs in a folder in d:somefoldermorefolderthefoldersongs (even somplace on your network !)

To make it accessible fast create a shortcut on Music folder by Rightclick > New >Create shortcut

I even changed the icon of the shortcut to a much more appropriate !

Now check out how easy this is to access in the screen shot below !

Now in winamp to play it just got to desktop > Quickdesk > Music > songs shortcut !

Talking about Winamp you can even launch application like this !

We all know what pain in the neck it is to Go to start and wait till the Ram deficient CPU displays the list of programs and then search the one you want ! Keeping the shorcuts on the desktop also adds to clutter to startwith !

To add Application to Quickdesk, copy the shortcut from the desktop or program files and paste it in the :Quickdeskprograms

Now check out how east and FAST it is to launch this way !

This has completely changed the way I access the data….. Did it yours ?

July 7, 2008 Ritesh Sanap Internet, Windows Cool things

Fix Your Own PC – eBook

An amazing book to make Windows XP run the way you want it to. From Tweaks to the Most famous Hacks , Everything Revealed….
fixyourownpc
Description:

* Get ready for some down-and-dirty hackin’! Over 200 serious hacks readers can use to force Windows XP to do it their way, written in the ExtremeTech no-holds-barred style
* Sinchak doesn’t waste time tweaking Movie Maker or Instant Messenger-these hacks are heavy-duty, detailed instructions for squeezing every drop of power from Windows XP and maximizing speed, appearance, and security
* Not for the faint of heart! This book is written for users who aren’t afraid to roll up their sleeves, risk voiding their warranties, take total control of the task bar, uninstall programs that are supposedly permanent, and beef up boot speed
* Mines gems like unlocking hidden settings, customizing boot screens, supercharging online and program launch speed, maximizing the file system and RAM, and dumping hated features for good
* Written by the creator of TweakXP.com, a site considered Mecca for Windows hackers and trusted by more than ten million Windows XP users worldwide
* Includes a hacker’s dream CD-ROM with a set of ready-to-install hacks, theme creation tools, custom boot screens, “undo” files that help the reader tinker with Windows XP’s registry, and a whole lot more.

Download

Rar password : www.warezfreak.org

July 7, 2008 Ritesh Sanap Internet, Windows Cool things

USE GOOGLE AS A Hack

Google search engine can be used to hack into remote servers or gather confidential or sensitive information which are not visible through common searches.

Google is the world’s most popular and powerful search engine. It has the ability to accept pre-defined commands as inputs which then produces unbelievable results.

Google’s Advanced Search Query Syntax

Discussed below are various Google’s special commands and I shall be explaining each command in brief and will show how it can be used for getting confidential data.

[ intitle: ]

The “intitle:” syntax helps Google restrict the search results to pages containing that word in the title.

intitle: login password

will return links to those pages that has the word “login” in their title, and the word “password” anywhere in the page.

Similarly, if one has to query for more than one word in the page title then in that case “allintitle:” can be used instead of “intitle” to get the list of pages containing all those words in its title.

intitle: login intitle: password

is same as

allintitle: login password

[ inurl: ]

The “inurl:” syntax restricts the search results to those URLs containing the search keyword. For example: “inurl: passwd” (without quotes) will return only links to those pages that have “passwd” in the URL.

Similarly, if one has to query for more than one word in an URL then in that case “allinurl:” can be used instead of “inurl” to get the list of URLs containing all those search keywords in it.

allinurl: etc/passwd

will look for the URLs containing “etc” and “passwd”. The slash (“/”) between the words will be ignored by Google.

[ site: ]

The “site:” syntax restricts Google to query for certain keywords in a particular site or domain.

exploits site:hackingspirits.com

will look for the keyword “exploits” in those pages present in all the links of the domain “hackingspirits.com”. There should not be any space between “site:” and the “domain name”.

[ filetype: ]

This “filetype:” syntax restricts Google search for files on internet with particular extensions (i.e. doc, pdf or ppt etc).

filetype:doc site:gov confidential

will look for files with “.doc” extension in all government domains with “.gov” extension and containing the word “confidential” either in the pages or in the “.doc” file. i.e. the result will contain the links to all confidential word document files on the government sites.

[ link: ]

“link:” syntax will list down webpages that have links to the specified webpage.

link:www.expertsforge.com

will list webpages that have links pointing to the SecurityFocus homepage. Note there can be no space between the “link:” and the web page url.

[ related: ]

The “related:” will list web pages that are “similar” to a specified
web page.

related:www.expertsforge.com

will list web pages that are similar to the Securityfocus homepage. Note there can be no space between the “related:” and the web page url.

[ cache: ]

The query “cache:” will show the version of the web page that Google
has in its cache.

cache:www.hackingspirits.com

will show Google’s cache of the Google homepage. Note there can be no space between the “cache:” and the web page url.

If you include other words in the query, Google will highlight those words within the cached document.

cache:www.hackingspirits.com guest

will show the cached content with the word “guest” highlighted.

[ intext: ]

The “intext:” syntax searches for words in a particular website. It ignores links or URLs and page titles.

intext:exploits

will return only links to those web pages that has the search keyword “exploits” in its webpage.

[ phonebook: ]

“phonebook” searches for U.S. street address and phone number information.

phonebook:Lisa+CA

will list down all names of person having “Lisa” in their names and located in “California (CA)”. This can be used as a great tool for hackers incase someone want to do dig personal information for social engineering.

Google Hacks

Well, the Google’s query syntaxes discussed above can really help people to precise their search and get what they are exactly looking for.

Now Google being so intelligent search engine, hackers don’t mind exploiting its ability to dig much confidential and secret information from the net which they are not supposed to know. Now I shall discuss those techniques in details how hackers dig information from the net using Google and how that information can be used to break into remote servers.

Index Of

Using “Index of ” syntax to find sites enabled with Index browsing

A webserver with Index browsing enabled means anyone can browse the webserver directories like ordinary local directories. The use of “index of” syntax to get a list links to webserver which has got directory browsing enabled will be discussd below. This becomes an easy source for information gathering for a hacker. Imagine if the get hold of password files or others sensitive files which are not normally visible to the internet. Below given are few examples using which one can get access to many sensitive information much easily.

Index of /admin
Index of /passwd
Index of /password
Index of /mail

“Index of /” +passwd
“Index of /” +password.txt
“Index of /” +.htaccess

“Index of /secret”
“Index of /confidential”
“Index of /root”
“Index of /cgi-bin”
“Index of /credit-card”
“Index of /logs”
“Index of /config”

Looking for vulnerable sites or servers using “inurl:” or “allinurl:”

a. Using “allinurl:winnt/system32/” (without quotes) will list down all the links to the server which gives access to restricted directories like “system32” through web. If you are lucky enough then you might get access to the cmd.exe in the “system32” directory. Once you have the access to “cmd.exe” and is able to execute it.

b. Using “allinurl:wwwboard/passwd.txt”(without quotes) in the Google search will list down all the links to the server which are vulnerable to “WWWBoard Password vulnerability”. To know more about this vulnerability you can have a look at the following link:

http://www.securiteam.com/exploits/2BUQ4S0SAW.html

c. Using “inurl:.bash_history” (without quotes) will list down all the links to the server which gives access to “.bash_history” file through web. This is a command history file. This file includes the list of command executed by the administrator, and sometimes includes sensitive information such as password typed in by the administrator. If this file is compromised and if contains the encrypted unix (or *nix) password then it can be easily cracked using “John The Ripper”.

d. Using “inurl:config.txt” (without quotes) will list down all the links to the servers which gives access to “config.txt” file through web. This file contains sensitive information, including the hash value of the administrative password and database authentication credentials.

For Example: Ingenium Learning Management System is a Web-based application for Windows based systems developed by Click2learn, Inc. Ingenium Learning Management System versions 5.1 and 6.1 stores sensitive information insecurely in the config.txt file. For more information refer the following
links: http://www.securiteam.com/securitynews/6M00H2K5PG.html

Other similar search using “inurl:” or “allinurl:” combined with other syntax

inurl:admin filetype:txt
inurl:admin filetype:db
inurl:admin filetype:cfg
inurl:mysql filetype:cfg
inurl:passwd filetype:txt
inurl:iisadmin
inurl:auth_user_file.txt
inurl:orders.txt
inurl:”wwwroot/*.”
inurl:adpassword.txt
inurl:webeditor.php
inurl:file_upload.php

inurl:gov filetype:xls “restricted”
index of ftp +.mdb allinurl:/cgi-bin/ +mailto

Looking for vulnerable sites or servers using “intitle:” or “allintitle:”

a. Using [allintitle: “index of /root”] (without brackets) will list down the links to the web server which gives access to restricted directories like “root” through web. This directory sometimes contains sensitive information which can be easily retrieved through simple web requests.

b. Using [allintitle: “index of /admin”] (without brackets) will list down the links to the websites which has got index browsing enabled for restricted directories like “admin” through web. Most of the web application sometimes uses names like “admin” to store admin credentials in it. This directory sometimes contains sensitive information which can be easily retrieved through simple web requests.

Other similar search using “intitle:” or “allintitle:” combined with other syntax

intitle:”Index of” .sh_history
intitle:”Index of” .bash_history
intitle:”index of” passwd
intitle:”index of” people.lst
intitle:”index of” pwd.db
intitle:”index of” etc/shadow
intitle:”index of” spwd
intitle:”index of” master.passwd
intitle:”index of” htpasswd
intitle:”index of” members OR accounts
intitle:”index of” user_carts OR user_cart

allintitle: sensitive filetype:doc
allintitle: restricted filetype :mail
allintitle: restricted filetype:doc site:gov

Other interesting Search Queries

· To search for sites vulnerable to Cross-Sites Scripting (XSS) attacks:

allinurl:/scripts/cart32.exe
allinurl:/CuteNews/show_archives.php
allinurl:/phpinfo.php

· To search for sites vulnerable to SQL Injection attacks:

allinurl:/privmsg.php
allinurl:/privmsg.php

March 12, 2008 Ritesh Sanap Internet

Posts pagination

Previous page Page 1 … Page 44 Page 45 Page 46 … Page 52 Next page

Currently Trending

  • How to download Specific parts of YouTube videos
    How to download Specific parts of YouTube videos
  • Windows Vista CD key
    Windows Vista CD key
  • How to retrieve my Demonoid username
    How to retrieve my Demonoid username
  • How to add Logo to Thesis theme
    How to add Logo to Thesis theme
  • How to Delete Feedbacks from JetPack Contact Form
    How to Delete Feedbacks from JetPack Contact Form
  • List Of All 255 Keyboard All Alt Key Codes
    List Of All 255 Keyboard All Alt Key Codes
  • h4x0r ( Hacker ) - Blogger Template
    h4x0r ( Hacker ) - Blogger Template

Get Latest post in your Inbox

Random Posts

How to Make Your Own Avatar

November 8, 2011 By Ritesh Sanap 3 Comments

Record – blogger Template

June 24, 2010 By Ritesh Sanap 1 Comment

Sell your Mobiles for Cash

November 2, 2010 By Ritesh Sanap 7 Comments

How to Disable Emojis in WordPress

January 6, 2016 By Ritesh Sanap Leave a Comment

Searching Domain Names Efficiently

December 22, 2010 By Ritesh Sanap Leave a Comment

WordPress

HTTP2 Server Push for W3 Total Cache Minify plugin

August 17, 2016 By Ritesh Sanap 5 Comments

How to Disable Emojis in WordPress

January 6, 2016 By Ritesh Sanap Leave a Comment

JetPack Related posts and Sharing not working with NGINX

November 10, 2015 By Ritesh Sanap Leave a Comment

Simply Pure – WordPress Theme

November 2, 2014 By Ritesh Sanap 2 Comments

Advanced What should we Write about next? – WordPress Plugin

July 28, 2014 By Ritesh Sanap Leave a Comment

How to Disable Self Pingback or TrackBack

January 16, 2014 By Ritesh Sanap Leave a Comment

BlueStrap – WordPress Theme

January 1, 2014 By Ritesh Sanap 15 Comments

How to Create Multiple Excerpts in WordPress

December 24, 2013 By Ritesh Sanap Leave a Comment

How to Disable Auto Update in WordPress

November 21, 2013 By Ritesh Sanap Leave a Comment

How to Delete Feedbacks from JetPack Contact Form

November 19, 2013 By Ritesh Sanap 9 Comments

Recent Posts

  • HTTP2 Server Push for W3 Total Cache Minify plugin
  • How to show hidden files and folders in Mac OS X
  • How to Disable Emojis in WordPress
  • Canva – Online Photo Editor
  • JetPack Related posts and Sharing not working with NGINX

Archives

Recommends

  • DigitalOcean – Cloud Hosting
  • Dropbox – Cloud Storage
  • Elegant Themes – WordPress Themes
  • LastPass – Password Manager
  • Like us on Facebook
  • Follow on Twitter
  • +1 on Google
  • Subscribe via Email
  • RSS Feed

© 2025 Best 2 Know · All Rights Reserved · We ♥ DigitalOcean