Waraxe IT Security Portal  
  Login or Register
::  Home  ::  Search  ::  Your Account  ::  Forums  ::   Waraxe Advisories  ::  Tools  ::
April 30, 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: 9145

People Online:
Visitors: 543
Members: 0
Total: 543
PacketStorm News
·301 Moved Permanently

read more...
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 topic  Reply 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 topic  Reply 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-2020 Janek Vind "waraxe"
Page Generation: 0.115 Seconds