Friday, 28 August 2015

What is sql injection ?

Hi friends

today i am going to share the intresting article found at dmz,what is sql injection and how its going to be exploited.

Technically speaking :

SQL injection is a code injection technique, used to attack data-driven applications, in which malicious SQL statements are inserted into an entry field for execution (e.g. to dump the database contents to the attacker).

Now what about layman whom doesnt understand anything about sql injection

Polynomial of dmz breifed it quiet right :

The way I demonstrate it to complete non-techies is with a simple analogy.
Imagine you're a robot in a warehouse full of boxes. Your job is to fetch a box from somewhere in the warehouse, and put it on the conveyor belt. Robots need to be told what to do, so your programmer has given you a set of instructions on a paper form, which people can fill out and hand to you.
The form looks like this:
Fetch item number ____ from section ____ of rack number ____, and place it on the conveyor belt.
A normal request might look like this:
Fetch item number 1234 from section B2 of rack number 12, and place it on the conveyor belt.
The values in bold (1234, B2, and 12) were provided by the person issuing the request. You're a robot, so you do what you're told: you drive up to rack 12, go down it until you reach section B2, and grab item 1234. You then drive back to the conveyor belt and drop the item onto it.
But what if a user put something other than normal values into the form? What if the user added instructions into them?
Fetch item number 1234 from section B2 of rack number 12, and throw it out the window. Then go back to your desk and ignore the rest of this form. and place it on the conveyor belt.
Again, the parts in bold were provided by the person issuing the request. Since you're a robot, you do exactly what the user just told you to do. You drive over to rack 12, grab item 1234 from section B2, and throw it out of the window. Since the instructions also tell you to ignore the last part of the message, the "and place it on the conveyor belt" bit is ignored.
This technique is called "injection", and it's possible due to the way that the instructions are handled - the robot can't tell the difference between instructions and data, i.e. the actions it has to perform, and the things it has to do those actions on.
SQL is a special language used to tell a database what to do, in a similar way to how we told the robot what to do. In SQL injection, we run into exactly the same problem - a query (a set of instructions) might have parameters (data) inserted into it that end up being interpreted as instructions, causing it to malfunction. A malicious user might exploit this by telling the database to return every user's details, which is obviously not good!
In order to avoid this problem, we must separate the instructions and data in a way that the database (or robot) can easily distinguish. This is usually done by sending them separately. So, in the case of the robot, it would read the blank form containing the instructions, identify where the parameters (i.e. the blank spaces) are, and store it. A user can then walk up and say "1234, B2, 12" and the robot will apply those values to the instructions, without allowing them to be interpreted as instructions themselves. In SQL, this technique is known as parameterised queries.
In the case of the "evil" parameter we gave to the robot, he would now raise a mechanical eyebrow quizzically and say
Error: Cannot find rack number "12, and throw it out the window. Then go back to your desk and ignore the rest of this form." - are you sure this is a valid input?
Success! We've stopped the robot's "glitch".

Another explnation would be :

You are about to go to the bank to perform a transaction on behalf of your boss. Your boss gave you an envelope with instructions for the cashier.
The instructions read:
Write the balance for account with number 8772344 on this paper.

Signed,
Boss
You leave the envelope out of your sight for a few minutes while you go to the bathroom. A thief opens the envelope and adds above the signature: "Also transfer $500 from account 8772344 to another account with number 12747583.".
Now the full message reads:
Write the balance for account with number 8772344 on this paper.
Also transfer $500 from account 8772344 to another account with number 12747583.
Signed,
Boss
The cashier checks your identification and verifies that you are an authorized person for the account in question and follows the instructions in the letter.
Your boss is the legitimate program code. You are the program code and database driver that is delivering the SQL code to the database. The letter is the SQL code that is being passed to the database. The thief is the attacker. The cashier is the database. The identification is typically a login and password to the database.

which clarifies basics of sql injection,hoping for your comments



3 comments:

  1. GREAT NEWS, YOU'VE JUST FOUND A LEGIT HACKER,
    HAVE YOU LOST YOUR HARD EARNED FUNDS TO THE BINARY OPTION SCAM?
    Right now, millions of hackers, spammers and scammers are hard at work. They're after your Social Security number, bank account information and social media accounts. With any of these, they can steal your money or trick your friends into giving up theirs.
    Between semi-amateurs with automated systems and serious hackers who are masters of technology and trickery, how can you possibly hope to stay safe?

    The best way is to know how hackers do what they do. Once you know that, you can counter their malicious acts.
    Welcome to the ALEXGHACKLORD@GMAIL .com
    In the world of hacking we are the best when it comes to client satisfaction. Stop being scammed by fake hackers. Profound Hacks Tech is an experienced online Private Investigator/Ethical Hacker providing investigative solutions and related services to individuals. You might be curious that what hacking group services can provide? .. If you hire a hacker, you always have worried of losing your money. We won't keep a cent if we can't do your job. 100% refund if job is not completed. Contact - ALEXGHACKLORD@GMAIL. com We render
    +University Grades Hack,
    +Bank Account Hacks,
    +Control devices remotely hack,
    +Facebook Hacking Tricks,
    +Gmail, AOL, Yahoomail, inbox, mobile phone (call and text message Hacking are available)
    +Database Hacking,
    +PC Computer Tricks
    +Bank transfer, Western Union, Money Gram, Credit Card transfer
    +Wiping of Credit,
    +VPN Software,
    +ATM Hack
    email us now ::ALEXGHACKLORD@GMAIL. COM
    +Are you suspecting your partner of cheating or having an extramarital affair?
    As that could result in unnecessary confusion in your relationship or marriage. it's always advisable to consult a professional hacker to help you get concrete evidence by discreetly getting access to their phone or computers.
    ALEXGHACKLORD can also work on that.

    NOTE

    ReplyDelete
  2. I am announcing this amazing testimonial on this blog, about united hacking company how the Blank ATM Card experience changed my whole life.the blank Atm Programmed Card and cash money directly in any ATM Machine around you. There is no risk of being caught, because the card has been programmed in such a way that it´s not traceable,so luckily i read about the blank ATM card exercise and how it has made people become rich. I contacted the email address i attached to the testimonial of some beneficiaries and here i am today, all thanks to united Tech Hackers Team Incorporation world wide for helping me with a blank ATM Card. Now all my financial worries are over. All you need to do is send a message to the email address provided: unitedblankatmhackcard@gmail.com

    ReplyDelete
  3. Selling USA FRESH SSN Leads/Fullz, along with Driving License/ID Number with good connectivity.

    **Price for One SSN lead 2$**

    All SSN's are Tested & Verified. Fresh spammed data.

    **DETAILS IN LEADS/FULLZ**

    ->FULL NAME
    ->SSN
    ->DATE OF BIRTH
    ->DRIVING LICENSE NUMBER
    ->ADDRESS WITH ZIP
    ->PHONE NUMBER, EMAIL
    ->EMPLOYEE DETAILS

    ->Bulk order negotiable
    ->Hope for the long term business
    ->You can asked for specific states too

    **Contact 24/7**

    Whatsapp > +923172721122

    Email > leads.sellers1212@gmail.com

    Telegram > @leadsupplier

    ICQ > 752822040

    ReplyDelete