Waraxe IT Security Portal
Login or Register
November 4, 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: 64
Members: 0
Total: 64
Full disclosure
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
APPLE-SA-10-28-2024-3 macOS Sequoia 15.1
APPLE-SA-10-28-2024-2 iOS 17.7.1 and iPadOS 17.7.1
APPLE-SA-10-28-2024-1 iOS 18.1 and iPadOS 18.1
Open Redirect / Reflected XSS - booked-schedulerv2.8.5
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Sql injection -> How to "UPDATE"
Post new topicReply to topic View previous topic :: View next topic
How to "UPDATE"
PostPosted: Mon Apr 21, 2008 6:41 pm Reply with quote
bleh
Regular user
Regular user
Joined: Apr 19, 2008
Posts: 19




Hey

I've got this vulnerable url:
Code:

http://www.example.com/main/index.php?type=journal&kid=NULL+UNION+ALL+SELECT+1,concat(uid),3,4,5,6,7,8,9,10,11,12,13,14+FROM+admin--


I want to edit that uid, to the uid I use, so the command would be something like:
Code:

UPDATE admin SET uid = 5 WHERE uid = 1


Where do I put the update on that url?




EDIT:
If I do this:
Code:

http://www.example.com/main/index.php?type=journal&kid=NULL+UPDATE+admin+SET+uid+=+5+WHERE+uid+=+1--

I get this error:
Quote:
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 'UPDATE admin SET uid = 5 WHERE uid = 1--' at line 1
View user's profile Send private message
PostPosted: Mon Apr 21, 2008 7:28 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




It's easy to answer your question - you can't Smile
MySql via php does not support multiple queries and there is no other way to make UPDATE happen, if you got sql injection in SELECT query!
So, for update:

1. If you can find sql injection in UPDATE query, which deals with table you want to manipluate, then it's possible
2. If you can escalate your presence in victim system to php scripting level or shell command level, or you can find PhpMyAdmin or TCP port 3306 is open and you have proper credentials - then again - mission complete Wink
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Mon Apr 21, 2008 11:31 pm Reply with quote
bleh
Regular user
Regular user
Joined: Apr 19, 2008
Posts: 19




That was what I first thought, just wanted to hear the experts. So, after more digging, I've found out another vuln. It's in a poll script, so there's a high probability of using the update command.. right? Rolling Eyes

Code:
www.example.com/main/inc/Kpoll.php?id=UPDATE+admin+SET+uid+=+5+WHERE+uid+=+1--

Quote:

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 'UPDATE admin SET uid = 5 WHERE uid = 1--)' at line 1

Notice the ) at the end.

Can anything be done? I've lost hope. If this doesn't work I have to resort to hash cracking.... will just take a couple of hundred years lol Confused
View user's profile Send private message
PostPosted: Wed Apr 23, 2008 11:54 am Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Look, what i wrote in my previous post:

Code:

find sql injection in UPDATE query, which deals with table you want to manipulate


So if you have sql injection in UPDATE query, which deals with polls table, then you CAN'T manipulate admins table, only polls table (in case of mysql/php).
And it seems to me, that your previous example does not point to sql injection in UPDATE at all, more like injection in SELECT.
Bottom line - find other attack vectors. UPDATE is not helping you here, that's my $0.02 Smile

By the way, example of working UPDATE attack:

http://www.waraxe.us/content-51.html

This is sql injection case in 2z CMS, where attacker can manipulate with UPDATE query and therefore with only one http request it is possible to change the content of ALL pages on website. Perfect defacement possibility ...
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Thu Apr 24, 2008 7:01 pm Reply with quote
bleh
Regular user
Regular user
Joined: Apr 19, 2008
Posts: 19




waraxe wrote:
Look, what i wrote in my previous post:

Code:

find sql injection in UPDATE query, which deals with table you want to manipulate


So if you have sql injection in UPDATE query, which deals with polls table, then you CAN'T manipulate admins table, only polls table (in case of mysql/php).
And it seems to me, that your previous example does not point to sql injection in UPDATE at all, more like injection in SELECT.
Bottom line - find other attack vectors. UPDATE is not helping you here, that's my $0.02 Smile

By the way, example of working UPDATE attack:

http://www.waraxe.us/content-51.html

This is sql injection case in 2z CMS, where attacker can manipulate with UPDATE query and therefore with only one http request it is possible to change the content of ALL pages on website. Perfect defacement possibility ...

Sorry. I must have skipped that. Anyway, I managed to crack the password... in an astonish 0.8s Laughing
The problem, is that the admin that uses this password doesn't login for a long a long time. My guess, is that he uses another account now but the password for that account is still being processed.
I would login with the cracked password, but his username would show up on the "who visited us today" or sth
View user's profile Send private message
PostPosted: Wed Aug 01, 2012 12:16 pm Reply with quote
wheelq
Beginner
Beginner
Joined: Aug 01, 2012
Posts: 1




I have similar issue, however in my code there is just

UPDATE ... SET ... WHERE id=$_GET['id'];

I am aware that I can't put select/drop anything like that in here, but still, would like to know what other possibilities I have.
Strange thing is that :

id=1 and (SELECT 1)=1 works, but
id=1 and (SELECT 1 into dumpfile '/tmp/check')=1

doesn.t (while SELECT 1 into dumpfile '/tmp/check' without UPDATE in front of it works).

Ok I have found couple links here: http://www.waraxe.us/ftopic-7348-0-days0-orderasc-update.html

but still...outfile is having problems when combined with UPDATE
View user's profile Send private message
How to "UPDATE"
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.036 Seconds