When you are done exit out of the mysql interpreter

Info icon This preview shows pages 2–5. Sign up to view the full content.

View Full Document Right Arrow Icon
When you are done, exit out of the MySQL interpreter with the command
Image of page 2

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
mysql> exit  Interlude – Disable php protection against SQL injection  attacks Before you can attack the web site, you will have to turn off a feature of PHP that tries to filter out characters like single quotes (‘) from data sent to the web application. To do  this, enter the command. sudo gedit /etc/php5/apache2/php.ini  this will start up an editor. Scroll down to around line 750. You are looking for the line magic_quotes_gpc = On which you should change to magic_quotes_gpc = Off Save the file and exit the editor. Then from the command prompt, restart the web server with: sudo service apache2 restart Task 2 – Apply the injection attack to the web  front end Now that you have the idea of how to insert characters into an SQL command to alter it, try it with the web application. Point your browser at www.sqllabcollabtive.com and you  should get the screen below. The data from this login screen gets run through the following SQL command SELECT ID, name, locale, lastlogin, gender, FROM users WHERE (name = ’$user’ OR email = ’$user’) AND pass = ’$pass’; With the input typed into the top box stored in the variable $user and from the second  box in the variable $pass. Your goal now is to replicate what you did in Task 1 by inserting the characters ’, --, ;,  and ) as part of the username so that no matter what the password is, you can always  log in as Alice. To get you started, the first part of the string you will enter as the username is
Image of page 3
alice’ Once you are successful,  record the string and explain how it works to let you  login with any password Be sure that you are injecting a comment. There are  other ways of completing this attack, but this first attempt should be a comment  attack. Take a screenshot to show your work.
Image of page 4

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern