![]() |
How do I test for SQL Injection
I just got a DB error and searched the IP it came from and its been reported for SQL Injection. Is there a way to test to see if they were successful?
Thanks. |
Anyone have a clue?
|
What DB error did u get?
|
I changed the DB table ID but her you go. And thanks for looking at it.
Quote:
|
You can use these to scan for anything suspicious.
SELECT title, phpcode, hookname, product FROM plugin WHERE phpcode LIKE '%base64%' OR phpcode LIKE '%exec%' OR phpcode LIKE '%system%' OR phpcode like '%pass_thru%' OR phpcode like '%iframe%'; SELECT styleid, title, template FROM template WHERE template LIKE '%base64%' OR template LIKE '%exec%' OR template LIKE '%system%' OR template like '%pass_thru%' OR template like '%iframe%'; Did you locate anything in the apache/nginx etc log related to that attempted post in the cms for that time stamp? |
Well, using PHPmyadmin I found the below items.
I'm not sure how to do the search you're referring to. And not sure how to check apache/nginx. In laymen's terms, please. And thanks for the help. %base64% in _searchcore_text, _pmtext, and _post %exec% in _autosave, _cache, _cacheevent, _widgetconfig, _widgettype, _cronlog, _datastore, dbtech_dbseo_resolvedurl, iei_img, _language, _phrase, _plugin, _pmtext, _post, _postedithistory, _productcode, _searchcore_text, _searchgroup_text, _style, _template, _templatehistory, _thread, _user |
Quote:
|
Not sure how to check in the ACP. Step by step if its not to much hassle.
Thanks |
ACP>Maintenance>Execute SQL Query
One at a time, paste his queries into the manual query box and click "Continue." You have to be a Super Admin with query running permissions as defined in includes/config.php or nothing will happen, except it will let you know you don't have permission to run queries. |
I tried
Quote:
Did I get the query wrong? Sorry I feel like a total noob. You would think after 12 years I would know how to do this. |
He posted two, complete queries. Looks like you posted only part of the first one.
The queries are: HTML Code:
SELECT title, phpcode, hookname, product FROM plugin WHERE phpcode LIKE '%base64%' OR phpcode LIKE '%exec%' OR phpcode LIKE '%system%' OR phpcode like '%pass_thru%' OR phpcode like '%iframe%'; HTML Code:
SELECT styleid, title, template FROM template WHERE template LIKE '%base64%' OR template LIKE '%exec%' OR template LIKE '%system%' OR template like '%pass_thru%' OR template like '%iframe%'; |
Tried that also. Im the super admin so thats not it. aLSO TRIED IN THE sql OF PHPMyAdmin. Same result
This is the complete error I get trying either one. Code:
An error occurred while attempting to execute your query. The following information was returned. Code:
An error occurred while attempting to execute your query. The following information was returned. |
Quote:
Need the guy who posted the queries to chime in, I may be mistaken what exactly it is he posted there. LOOKS like queries, might not be though. Sorry i haven't been able to help you so far. |
Ok I added my prefix to the query and it worked. I got 3 pages of results just for the Plugin query.
Now what? |
Quote:
snakes was online today, maybe he will chime in. |
So like I said I got the plugin query to work and got 42 results. (cant get the template one to work)
Anway Maybe reinstall the plugins affected with overwriting enabled. That would change the code but not sure about the DB. Thanks again. Daniel |
Well the 2 queries i gave you just pull the data from those tables, the results you can match to a default/clean install on a dev site for example.
|
Now if I only had a dev site. :(
|
Those queries will only show you results that contain the keywords outlined base64 etc
|
Quote:
SELECT title, phpcode, hookname, product FROM plugin WHERE phpcode LIKE '%base64%'; SELECT title, phpcode, hookname, product FROM plugin WHERE phpcode LIKE '%iframe%'; What do you see with just this part of the command? Any odd plugins that you don't remember adding? A screenshot would help us, but really if your site was compromised, it's wise to have someone who knows what they're doing on board. |
All times are GMT. The time now is 04:58 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|