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: 45
Members: 0
Total: 45
Full disclosure
APPLE-SA-11-19-2024-5 macOS Sequoia 15.1.1
Local Privilege Escalations in needrestart
APPLE-SA-11-19-2024-4 iOS 17.7.2 and iPadOS 17.7.2
APPLE-SA-11-19-2024-3 iOS 18.1.1 and iPadOS 18.1.1
APPLE-SA-11-19-2024-2 visionOS 2.1.1
APPLE-SA-11-19-2024-1 Safari 18.1.1
Reflected XSS - fronsetiav1.1
XXE OOB - fronsetiav1.1
St. Poelten UAS | Path Traversal in Korenix JetPort 5601
St. Poelten UAS | Multiple Stored Cross-Site Scripting in SEH utnserver Pro
Apple web content filter bypass allows unrestricted access to blocked content (macOS/iOS/iPadOS/visionO S/watchOS)
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
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Sql injection -> SQL Injecting PHP Topsites Script
Post new topicReply to topic View previous topic :: View next topic
SQL Injecting PHP Topsites Script
PostPosted: Wed Apr 22, 2009 2:25 am Reply with quote
Invader
Beginner
Beginner
Joined: Apr 22, 2009
Posts: 4




Hi Guys,

If you don't understand my english, sorry for that Wink

i need some help from you.
I'm playing around with the PHP Topsites Script -> http://webscripts.softpedia.com/script/Top-Sites/PHP-TopSites-41994.html (I'm not sure if the Version I'm trying to inject into is the same)

The Codeline I'm trying to use is the following ($cid):
Code:
$squery = mysql_db_query ($dbname,"select *,if (rank/votes, rank/votes,0) as ranks,if (stars, stars,0) as star from top_user where status='Y' AND thin>=$min_hits and category=$cid order by thin DESC,ranks DESC,star DESC,thout DESC limit $from,$t_step",$db) or die (mysql_error());


Everytime I try to inject something I get the Error: The used SELECT statements have a different number of columns

So I tried the following to enumerate the number of columns (counting up to 50), but everytime I get the same error.

http://www.example.com/index.php?cid=1+union+select+1,2,3,4,5,6,7,.....--

After I found the PHP Toplist Script (the guy who use this script has removed the Copyright) I tried it counting from 1 to 19 but, you know what, i get the same error...

Anyone here who knows what I'm doing wrong?

Greeting,
Invader...
View user's profile Send private message
Re: SQL Injecting PHP Topsites Script
PostPosted: Wed Apr 22, 2009 3:13 am Reply with quote
brisk
Advanced user
Advanced user
Joined: Mar 07, 2009
Posts: 108




Invader wrote:
Hi Guys,

If you don't understand my english, sorry for that Wink

i need some help from you.
I'm playing around with the PHP Topsites Script -> http://webscripts.softpedia.com/script/Top-Sites/PHP-TopSites-41994.html (I'm not sure if the Version I'm trying to inject into is the same)

The Codeline I'm trying to use is the following ($cid):
Code:
$squery = mysql_db_query ($dbname,"select *,if (rank/votes, rank/votes,0) as ranks,if (stars, stars,0) as star from top_user where status='Y' AND thin>=$min_hits and category=$cid order by thin DESC,ranks DESC,star DESC,thout DESC limit $from,$t_step",$db) or die (mysql_error());


Everytime I try to inject something I get the Error: The used SELECT statements have a different number of columns

So I tried the following to enumerate the number of columns (counting up to 50), but everytime I get the same error.

http://www.example.com/index.php?cid=1+union+select+1,2,3,4,5,6,7,.....--

After I found the PHP Toplist Script (the guy who use this script has removed the Copyright) I tried it counting from 1 to 19 but, you know what, i get the same error...

Anyone here who knows what I'm doing wrong?

Greeting,
Invader...


use blind sql injection : http://milw0rm.com/papers/202
View user's profile Send private message
PostPosted: Fri Apr 24, 2009 5:49 pm Reply with quote
Invader
Beginner
Beginner
Joined: Apr 22, 2009
Posts: 4




Many thanks for the link brisk, it works now and i got some informations about the system (MySQL Version, PHP Version, Admin Login and Pass to Backend, Database Name, DB User Name, DB User Privileges (USAGE only)).
But now I'm stuck again. With the admin login data I'm able to write articles, view and manage registered members etc.
I'm not able to upload files or create/write files through sql injection (because of USAGE privileges only)...
And, of course, the echo()'d articles are not eval()'d.

How would you go further to get a shell installed? What other possibilities do I have?

Greetings Invader...
View user's profile Send private message
SQL Injecting PHP Topsites Script
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.048 Seconds