Waraxe IT Security Portal
Login or Register
June 17, 2025
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: 90
Members: 0
Total: 90
Full disclosure
SEC Consult SA-20250604-0 :: Local Privilege Escalation and Default Credentials in INDAMED - MEDICAL OFFICE (Medical practice management) Demo version
Full Disclosure: CVE-2025-31200 & CVE-2025-31201 – 0-Click iMessage Chain ? Secure Enclave Key Theft, Wormable RCE, Crypto Theft
Defense in depth -- the Microsoft way (part 89): user grouppolicies don't deserve tamper protection
CVE-2025-45542: Time-Based Blind SQL Injection in CloudClassroom PHP Project v1.0
ERPNext v15.53.1 Stored XSS in bio Field Allows Arbitrary Script Execution in Profile Page
ERPNext v15.53.1 Stored XSS in user_image Field Allows Script Execution via Injected Image Path
Local information disclosure in apport and systemd-coredump
Stored XSS via File Upload - adaptcmsv3.0.3
IDOR "Change Password" Functionality - adaptcmsv3.0.3
Stored XSS "Send Message" Functionality - adaptcmsv3.0.3
Authenticated File Upload to RCE - adaptcmsv3.0.3
Stored XSS in "Description" Functionality - cubecartv6.5.9
Multiple Vulnerabilities in SAP GuiXT Scripting
CVE-2024-47081: Netrc credential leak in PSF requests library
Exploit CVE-2019-9978: Remote Code Execution in Social Warfare WordPress Plugin (<= 3.5.2)
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



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.053 Seconds