Page 1 of 1
[SOLVED] How to disable the Site Shutdown function? 3.0.3.8
Posted: Wed Mar 27, 2024 2:56 am
by wisma
Good afternoon,
I noticed that today someone turned off the site twice. There are about 500 pages of logs on the live site, and it is difficult to search them. I have access only to myself and I changed passwords twice, but it did not help. It will take a long time to figure out this problem, so I think it will be faster to disable the site shutdown function?
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Wed Mar 27, 2024 11:15 am
by OSWorX
If you really expect answer(s) and help, read this here before:
viewtopic.php?t=200480
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Wed Mar 27, 2024 12:59 pm
by SohBH
It's got to be some kind of vulnerability added by an extension.
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Wed Mar 27, 2024 8:42 pm
by wisma
I think I wrote it correctly. I'm using CMS version 3.0.3.8. How can I remove the site shutdown function from the CMS?
-----
Regarding the modules, I understand that myself, but I haven't found in the logs which module was responsible for disabling the site. As I wrote above, there are too many logs to search through manually.
update^
I found some suspicious attempts in the logs. However, it is relatively easy to maintain a pool of 1000 proxies and avoid getting banned.
[Wed Mar 27 01:13:40.738620 2024] [autoindex:error] [pid 877443] [client 66.249.66.206:33922] AH01276: Cannot serve directory /var/www/wisma/data/www/*/image/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
[Wed Mar 27 01:24:11.328452 2024] [authz_core:error] [pid 878616] [client 34.125.240.71:42404] AH01630: client denied by server configuration: /var/www/wisma/data/www/*/ads.txt, referer: https://*/uk-generator-honda-eu-70-is
[Wed Mar 27 01:24:11.336256 2024] [authz_core:error] [pid 878617] [client 34.125.240.71:42418] AH01630: client denied by server configuration: /var/www/wisma/data/www/*/app-ads.txt, referer: https://*/uk-generator-honda-eu-70-is
[Wed Mar 27 01:24:17.098637 2024] [authz_core:error] [pid 878659] [client 34.94.137.71:60254] AH01630: client denied by server configuration: /var/www/wisma/data/www/*/app-ads.txt, referer: https://*/uk-generator-honda-eu-70-is
[Wed Mar 27 01:24:17.098944 2024] [authz_core:error] [pid 878658] [client 34.94.137.71:60240] AH01630: client denied by server configuration: /var/www/wisma/data/www/*/ads.txt, referer: https://*/uk-generator-honda-eu-70-is
Or can you tell me the approximate code that needs to be found? I'm talking about the one that is responsible for disabling the site? I understand that it is related to the configuration.
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Wed Mar 27, 2024 11:08 pm
by wisma
Code: Select all
public function cacheDelete() {
if ($this->validateModification()) {
$this->load->language('octemplates/theme/'. $this->oct_theme);
$maintenance = $this->config->get('config_maintenance');
$this->load->model('setting/setting');
$this->cache->delete('octemplates');
$this->model_setting_setting->editSettingValue('config', 'config_maintenance', true);
if (isset($this->request->get['store_id'])) {
$store_id = $this->request->get['store_id'];
} else {
$store_id = 0;
}
$setting_info = $this->model_setting_setting->getSetting('theme_'. $this->oct_theme, $store_id);
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Thu Mar 28, 2024 12:02 am
by Cue4cheap
wisma wrote: ↑Wed Mar 27, 2024 2:56 am
Good afternoon,
I noticed that today someone turned off the site twice. There are about 500 pages of logs on the live site, and it is difficult to search them. I have access only to myself and I changed passwords twice, but it did not help. It will take a long time to figure out this problem, so I think it will be faster to disable the site shutdown function?
There is no such thing as a "Site shutdown function".
As others have said you need to give us relevant information.
Mike
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Thu Mar 28, 2024 1:53 am
by wisma
I'm trying to disable the website's maintenance mode permanently. Here's why I'm confused:
The system seems to have the functionality for maintenance mode:
There's a controller and code ($maintenance = $this->config->get('config_maintenance');) to manage it.
There's a corresponding entry in the MySQL database.
Yet, I can't find a way to disable it permanently.
My question:
In which files can I remove code to permanently disable the ability to put the site in maintenance mode?
Additional context (optional):
The website recently received updates to the ReMarket template and ocfilter module. These updates might be coincidental to the issue, but I'm unsure.
There haven't been any problems for over a month until yesterday's outages.
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Thu Mar 28, 2024 2:25 am
by OSWorX
wisma wrote: ↑Thu Mar 28, 2024 1:53 am
The website recently received updates to the ReMarket template and ocfilter module. These updates might be coincidental to the issue, but I'm unsure.
There haven't been any problems for over a month until yesterday's outages.
You haven't read my comment here:
posting.php?mode=quote&p=868510&sid=109 ... a#pr868488
Why do you thinkl I highlighted that here:
viewtopic.php?t=200480 (doing it again!!).
And especially this here:
viewtopic.php?t=200480#p707152 (read carefully and slow!).
And this here:
viewtopic.php?t=53294
But you do not want to hear nor reading!
With this post you declare, that you have installed (several) other extensions/theme/mods/hacks/whatever ..
So better follow the advices and post what's important (for us) - or do you think we are all clairvoyants ?
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Thu Mar 28, 2024 2:38 am
by wisma
It seems you misunderstood my question.
My question is:
In which files can I find the code for disabling the maintenance mode in OpenCart 3.0.3.8?
What code do I need to delete to permanently remove this functionality?
Context:
I am aware of the controller and code $maintenance = $this->config->get('config_maintenance');.
I have checked the developer's code, but it is encrypted against hacking.
I am not interested in the reason for the issue; I just want to remove the maintenance mode function entirely.
The website is currently indexed and displayed as "Technically closed" in Google, which is unacceptable.
I understand this is a drastic measure, but it is necessary to prevent future problems.
I apologize for any confusion.
Please help me by providing the specific file names and code I need to delete.
Thank you for your understanding.
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Thu Mar 28, 2024 2:41 am
by wisma
I am not interested in errors because they are hidden and are admin errors, for the user too. I am only interested in removing the function out of the box.
Additional details:
The user is not interested in fixing the errors that are causing the maintenance mode to be enabled.
The user wants to remove the maintenance mode function completely from the OpenCart software.
The user wants to do this so that the maintenance mode cannot be enabled by anyone, including administrators.
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Thu Mar 28, 2024 2:51 am
by wisma
Okay, lets go, I've been reading your replies carefully, but it's difficult for me to prepare a complete list of files because:
I'm new to the website's webmaster and don't know where some of the files were purchased or downloaded.
Some of the files are pirated.
I don't think anyone wants to go through 100,500 files when you can simply remove the function out of the box.
What do you think? Do you want me to burden you with searching for a small line of code in all these files?
It would be much easier to just tell me what to delete, and it would only cause a small error on the website that users wouldn't even see.
I understand that this is not an ideal solution, but it's the quickest and simplest one.
Please let me know if this is possible.
Thank you for your time!
P.S.
I can provide you with FTP/SSH access if needed.
I can also provide you with more information about the website if it helps.
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Thu Mar 28, 2024 2:53 am
by wisma
add atach/
opencart 3.0.3.8
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Thu Mar 28, 2024 2:57 am
by ADD Creative
Look at the action_pre_action in system/config/catalog.php. You could remove the 'startup/maintenance' entry. Else look in catalog/controller/startup/maintenance.php.
However, I wouldn't recommend it as a final solution. If it is being changed by someone and not just a bug, they probably have access to a lot more.
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Thu Mar 28, 2024 3:07 am
by wisma
ADD Creative wrote: ↑Thu Mar 28, 2024 2:57 am
Look at the action_pre_action in system/config/catalog.php. You could remove the 'startup/maintenance' entry. Else look in catalog/controller/startup/maintenance.php.
However, I wouldn't recommend it as a final solution. If it is being changed by someone and not just a bug, they probably have access to a lot more.
Thank you! This is exactly what I needed.
I understand that this is a workaround, but the website's behavior shows that only this function is accessible. If there are any problems in the future, I think I will be able to solve them. For now, I just need to remove this feature.
Thank you again for your help.
I really appreciate it!
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Thu Mar 28, 2024 3:26 am
by wisma
ADD Creative wrote: ↑Thu Mar 28, 2024 2:57 am
Look at the action_pre_action in system/config/catalog.php. You could remove the 'startup/maintenance' entry. Else look in catalog/controller/startup/maintenance.php.
However, I wouldn't recommend it as a final solution. If it is being changed by someone and not just a bug, they probably have access to a lot more.
Sorry, I can't understand this code a little:
catalog/controller/startup/maintenance.php
Code: Select all
<?php
class ControllerStartupMaintenance extends Controller {
public function index() {
if ($this->config->get('config_maintenance')) {
// Route
if (isset($this->request->get['route']) && $this->request->get['route'] != 'startup/router') {
$route = $this->request->get['route'];
} else {
$route = $this->config->get('action_default');
}
$ignore = array(
'common/language/language',
'common/currency/currency'
);
// Show site if logged in as admin
$this->user = new Cart\User($this->registry);
if ((substr($route, 0, 17) != 'extension/payment' && substr($route, 0, 3) != 'api') && !in_array($route, $ignore) && !$this->user->isLogged()) {
return new Action('common/maintenance');
}
}
}
As I understand it, what could have been made simpler? just change this code:
Code: Select all
// Show site if logged in as admin
$this->user = new Cart\User($this->registry);
if ((substr($route, 0, 17) != 'extension/payment' && substr($route, 0, 3) != 'api') && !in_array($route, $ignore) && !$this->user->isLogged()) {
return new Action('common/maintenance');
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Thu Mar 28, 2024 7:46 am
by straightlight
In system/config/catalog.php file,
find:
replace with:
This should resolve the issue.
Re: How to disable the Site Shutdown function? 3.0.3.8
Posted: Thu Mar 28, 2024 12:59 pm
by wisma
thanks everyone for the help