PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |
Old January 11th, 2010, 05:15 PM   #1 (permalink)
Junior Member
Verified Customer
 
Join Date: Mar 2005
Location: New Jersey
Posts: 29
Post Error or exploit attempt

I got 31 of these database error reports over the course of 2 minutes.

Code:
Content visible to verified customers only.
All of the errors were the same except for the URL (see Script: line above).
These are the different URLs (domain changed):

Code:
Content visible to verified customers only.
The IP Address is from China.

Is this a real error or a probe for exploits?
Ocean44 is offline   Reply With Quote
Old January 12th, 2010, 09:33 AM   #2 (permalink)
Moderator
Verified Customer
 
Join Date: Aug 2005
Posts: 1,231
Well at first look, someone seems to have tried to add some urlencoded stuff to the get request...

I'll be back in a couple of hours...

Luc

Last edited by Luciano; January 12th, 2010 at 02:36 PM.
Luciano is offline   Reply With Quote
Old January 12th, 2010, 01:44 PM   #3 (permalink)
Moderator
Verified Customer
 
Join Date: Aug 2005
Posts: 1,231
Well, I looked into it.. AND..following remarks and questions:
Are you getting similar "Attacks" on other files other that browseimages,php (check that ip in your logs) even without mysql errors?

It seems that there is some bot (a human would not try in such a clumsy way) trying some sql injection by adding something to the url..
Why I think its a bot? a human would not add something to an url where there is no chance to succeed in a repeated way... a human would try to add something before the do= not after...

What he does.. Is he scans your page for forms.. finds a get form (the category jump) and adds some stuff hoping he will get into the database.... So the answer is yes, its a probe for exploits.

Actually you get the same error (or result) if you go to a category in browse images example:
http://gallery.mydomain.com/gallery/browseimages.php?catid=20
and manually add: &do=stupid or like the bot did: &do=jumpstupid
You will get the same error.. limit is empty..
(So much on efficiency of those bots)

Why do i then get a db error?
Well that is a teeny weeny problem in browseimages...
if do is not empty but has not one of the predefined values..
the images orderby and limit are empty... spitting out a mysql error...
instead of having :
ORDER BY votes DESC, LIMIT 0,15;
you have:
ORDER BY , LIMIT ;

That gives you the mysql error... It was never found because you never get into that position unless... someone tries to tamper with the url of a browseimage page.. So it is NOT a security problem, just a little bug that nobody stumbled into before..

Its easy to fix:
there are several ways
1 . we could simlply populate the limit and the orderby with default values if empty,
Or
2 . we could check if the do=xxx has not one of the predefined values.. and set it to browseimages if its value is wrong..
Or
3 . we could do like 2. but instead of fixing it.. just send the user to another site...

------------

i think 2. is the best solution:
But I think we should fix it before we call gallery_global.php (you never know what plugins users have installed...)

So for a quick FIX do the following:
Open browseimages.php
find:
Code:
Content visible to verified customers only.
and ABOVE that line add:
Code:
Content visible to verified customers only.
In the unlikely case that someone uses a hack that needs another $_REQUEST['do'] than those listed in the array, just add it to the array. But I am NOT aware of any hack existing that would need it..

That will fix the problem in a very straight forward way.. but maybe michael or chuck have a better solution..

Luc
Luciano is offline   Reply With Quote
Old January 12th, 2010, 05:19 PM   #4 (permalink)
Junior Member
Verified Customer
 
Join Date: Mar 2005
Location: New Jersey
Posts: 29
Luciano -

Thank you much for digging into this. It is good to know it isn't a security issue.

To answer your question:
In my log for that day, I do not see that IP using any files other than browseimages.php
I do see some attempts that do not cause an error such as this one: http://gallery.mydomain.com/browseimages.php?do=jump&catid=20&s=%27/**/XoR/**/%278%27%3D%278
Ocean44 is offline   Reply With Quote
Old January 12th, 2010, 10:44 PM   #5 (permalink)
Moderator
Verified Customer
 
Join Date: Aug 2005
Posts: 1,231
well it definetly is a bot...looking for exploits.. otherwise he would not add his code to the session id..
ban him...
Luc
Luciano is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is this a possible hack attempt? see pic IndyWebDesign Photopost Pro Bug Reports 3 February 6th, 2008 05:36 PM
Upgrade & Exploit Prevention Question ldk Photopost Pro Installation & Upgrades 1 August 24th, 2007 05:22 PM
hack attempt?? sanddancer Classifieds Bug Reports 10 December 15th, 2006 10:01 AM
Is this exploit or etc ? Lizard King Bugs From 1.0.0 13 June 13th, 2005 03:03 PM


All times are GMT -5. The time now is 10:24 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0