Join us at IRC!
Imagination is more valuable than knowledge - Albert Einstein
Wednesday, May 23, 2012
Navigation
Members Online
Total Online: 39
Web Spiders: 20
Guests Online: 34
Members Online: 5

Registered Members: 70162
Newest Member: Windows-2012
Latest Articles
View Thread

HellBound Hackers | Challenges | Basic

Page 3 of 3 < 1 2 3
Author

RE: Basic 8... OMFG !

new_hack8912
Member

Posts: 42
Location: /dev/null
Joined: 23.10.07
Rank:
God
Posted on 28-12-08 19:41
theoderic wrote:

Yeah! I learned that SQL injection into PHP websites (only PHP?)
is a great method to find different types of information from weak spots.

SQL Clients are not only used on PHP sites, it can be used with pretty much anything ex: ASP, Perl, etc

The SQL injection itself can only be used when a user inputs data (GET or POST) and the data is put through a mysql query.

So for example if you had a page like this:
http://www.example.com/page.php?id=3

This may be exploitable because 1. id is an integer and the SQL server will process this (unlike if it was page.php?id=news) 2. And it is a GET variable which the user may change.

So the PHP code would look something like this:

<?php
mysql_connect("example.com","username","password");
mysql_connect_db("example database");
//those two lines are connecting to the SQL server and then connecting to the database

$page = $_GET['id']
//getting the id that was submitted in the url

$row = mysql_query("SELECT information FROM sometable WHERE id='$page'")
//Taking the $page value from the table 'sometable' and storing the info in $row

$echo = mysql_fetch_array($row);
//storing the array that we just created from $row into $echo

echo $echo['information'];
//printing out the information on the page
?>


However this could be exploitable if the user inputed a ' because it would allow the user to then enter in his own query and therefore compromising the security of the site. The user could add/delete tables, rows, columns; view information in the rows; and even (if he has root on SQL) use load_file("/etc/passwd") to compromise the entire server.
I recommend people having trouble on this challenge to download XAMPP , which is windows software (if you have linux, you should know what your doing) and then follow http://www.tizag.com/mysqlTutorial/. Thats how I learned the basics

Edited by new_hack8912 on 28-12-08 19:42
Author

RE: Basic 8... OMFG !

theoderic
Member



Posts: 3
Location: S.D's left sock
Joined: 26.12.08
Rank:
Apprentice
Posted on 28-12-08 21:23
Wow that's a lot of information.

As I said in the beginning;

____ U GuyZ R GR8 ! ____
Author

RE: Basic 8... OMFG !

MosDef
Member

Posts: 1
Location: 127.0.0.1
Joined: 25.12.10
Rank:
Newbie
Posted on 26-12-10 01:49
new_hack8912 wrote:
theoderic wrote:

Yeah! I learned that SQL injection into PHP websites (only PHP?)
is a great method to find different types of information from weak spots.

SQL Clients are not only used on PHP sites, it can be used with pretty much anything ex: ASP, Perl, etc

The SQL injection itself can only be used when a user inputs data (GET or POST) and the data is put through a mysql query.

So for example if you had a page like this:
http://www.example.com/page.php?id=3

This may be exploitable because 1. id is an integer and the SQL server will process this (unlike if it was page.php?id=news) 2. And it is a GET variable which the user may change.

So the PHP code would look something like this:

<?php
mysql_connect("example.com","username","password");
mysql_connect_db("example database");
//those two lines are connecting to the SQL server and then connecting to the database

$page = $_GET['id']
//getting the id that was submitted in the url

$row = mysql_query("SELECT information FROM sometable WHERE id='$page'")
//Taking the $page value from the table 'sometable' and storing the info in $row

$echo = mysql_fetch_array($row);
//storing the array that we just created from $row into $echo

echo $echo['information'];
//printing out the information on the page
?>


However this could be exploitable if the user inputed a ' because it would allow the user to then enter in his own query and therefore compromising the security of the site. The user could add/delete tables, rows, columns; view information in the rows; and even (if he has root on SQL) use load_file("/etc/passwd") to compromise the entire server.
I recommend people having trouble on this challenge to download XAMPP , which is windows software (if you have linux, you should know what your doing) and then follow http://www.tizag.com/mysqlTutorial/. Thats how I learned the basics


Very good post. Thanks
Author

RE: Basic 8... OMFG !

Nutzy
Member



Posts: 1
Location: U.S.S Enterprise
Joined: 11.01.12
Rank:
Wiseman
Posted on 11-01-12 16:39
this thread was so usefull for me completing this challenge. thank you for putting so much effort clearing this up :)
Page 3 of 3 < 1 2 3
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.