Waraxe IT Security Portal
Login or Register
July 27, 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: 231
Members: 0
Total: 231
Full disclosure
CyberDanube Security Research 20240722-0 | Multiple Vulnerabilities in Perten/PerkinElmer ProcessPlus
[KIS-2024-06] XenForo <= 2.2.15 (Template System) Remote Code Execution Vulnerability
[KIS-2024-05] XenForo <= 2.2.15 (Widget::actionSave) Cross-Site Request Forgery Vulnerability
CVE-2024-33326
CVE-2024-33327
CVE-2024-33328
CVE-2024-33329
CyberDanube Security Research 20240703-0 | Authenticated Command Injection in Helmholz Industrial Router REX100
SEC Consult SA-20240627-0 :: Local Privilege Escalation via MSI installer in SoftMaker Office / FreeOffice
SEC Consult SA-20240626-0 :: Multiple Vulnerabilities in Siemens Power Automation Products
Novel DoS Vulnerability Affecting WebRTC Media Servers
APPLE-SA-06-25-2024-1 AirPods Firmware Update 6A326, AirPods Firmware Update 6F8, and Beats Firmware Update 6F8
40 vulnerabilities in Toshiba Multi-Function Printers
17 vulnerabilities in Sharp Multi-Function Printers
SEC Consult SA-20240624-0 :: Multiple Vulnerabilities allowing complete bypass in Faronics WINSelect (Standard + Enterprise)
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.182 Seconds