ecshop php一句话后门,彻底解决ECSHOP一句话木马 断除WEBSHELL

本文详细介绍了针对PHP Webshell和一句话木马的查杀方法,包括基于Shell特征的检测、PHP安全函数与配置选项的分析以及语法检测。列举了多种可能涉及的安全函数和配置选项,并强调了安全意识、服务器日志监控、权限管理和手动查杀的重要性。此外,还提醒关注网络安全动态,不断学习和理解攻击者思维。
摘要由CSDN通过智能技术生成

总体来讲,对php webshell和一句话木马的查杀,主要从三个方面进行

1.Shell特征

2.PHP安全方面的函数和变量 以及安全配置选项

3.语法检测

首先,基于Shell特征,此方法主要针对base64_decode编码与gzinflate等参考特征库与匹配算法:Web Shell Detector v1.51,当前共有296个特征https://github.com/emposha/PHP-Shell-Detector/zipball/master可同时参考其他开源软件特征库

其次,对涉及PHP安全方面的函数和安全配置选项进行了归类,参照了很多文章,博客以及开源工具,在此表示感谢

1.include/require/require_once/include_once/file_get_contents //文件包含

2.exec/system/popen/passthru/proc_open/pcntl_exec/shell_exec/curl_exec/curl_multi_exec/“/escapeshellcmd/pcntl_exec //系统命令执行

3.eval/preg_replace/assert/call_user_func/call_user_func_array/create_function/ob_start/array_map //代码执行

4._GET/_POST/_COOKIE/_SERVER/_REQUEST/_ENV/GLOBALS/php://input/getenv/ //数据传递

5. session/cookie

6. extract/parse_str/mb_parse_str/import_request_variables/unserialize

7.copy/rmdir/chmod/delete/fwrite/fopen/readfile/fpassthru/move_uploaded_file/file_put_contents/unlink/upload/opendir/fgetc/fgets/ftruncate/fputs/fputcs //文件操作

8.select/insert/update/delete/order by/group by/limit/in(/stripslashes/urldecode //数据库操作

9.confirm_phpdoc_compiled/mssql_pconnect/mssql_connect/crack_opendict/snmpget/ibase_connect

10.echo/print/printf/vprintf/document.write/document.innerHTML/document.innerHtmlText

11.phpinfo/highlight_file/show_source/parse_ini_file //敏感信息,源代码泄露

12.iconv/mb_convert_encoding13.base64_decode, gzinflate, gzuncompress, gzdecode, str_rot13 //代码加密

其他:

usort(), uasort(), uksort()

array_filter()

array_reduce()

array_diff_uassoc(), array_diff_ukey()

array_udiff(), array_udiff_assoc(), array_udiff_uassoc()

array_intersect_assoc(), array_intersect_uassoc()

array_uintersect(), array_uintersect_assoc(), array_uintersect_uassoc()

array_walk(), array_walk_recursive()

xml_set_character_data_handler()

xml_set_default_handler()

xml_set_element_handler()

xml_set_end_namespace_decl_handler()

xml_set_external_entity_ref_handler()

xml_set_notation_decl_handler()

xml_set_processing_instruction_handler()

xml_set_start_namespace_decl_handler()

xml_set_unparsed_entity_decl_handler()

stream_filter_register()

set_error_handler()

register_shutdown_function()

register_tick_function()

附带php.ini中涉及安全配置选项。

safe_mode = off ( a lot of shit cannot be done with this on )

disabled_functions = N/A ( no one,we want all )

register_globals = on ( we can set variables by request )

allow_url_include = on ( for lfi/rfi )

allow_url_fopen = on ( for lfi/rfi )

magic_quotes_gpc = off ( this will escape ‘ ” \ and NUL’s with a backslash and we don’t want that )short_tag_open = on ( some scripts are using short tags,better on )

file_uploads = on ( we want to upload )

display_errors = on ( we want to see the script errors,maybe some undeclared variables? )

open_basedir 限制访问目录

display_errors = off 显示错误信息

auto_prepend_file = on 在每个页面之前被载入

auto_append_file = on 在每个页面之后被载入

HP一句话后门可谓五脏俱全,一不小心您肯定中招了,而我们今天这篇文章的重中之重在哪呢?重点就在下边的总结!

如何应对PHP一句话后门

我们强调几个关键点,看这文章的你相信不是门外汉,我也就不啰嗦了:

对PHP程序编写要有安全意识

服务器日志文件要经常看,经常备份

对每个站点进行严格的权限分配

对动态文件及目录经常批量安全审查

学会如何进行手工杀毒《即行为判断查杀》

时刻关注,或渗入活跃的网络安全营地

对服务器环境层级化处理,哪怕一个函数也可做规则

阿牛认为当管理的站点多了,数据量大时,我们应合理应用一些辅助工具,但不应完全依赖这些工具,技术是时刻在更新进步的,最为重要的是你应学会和理解,编写这些强悍后门的人所处思维,角色上的换位可为你带来更大的进步。

文中所列后门中如涉及版权问题,要强调的是这类后门无从查找原始出处,也无唯一性,如果你非要和我说某某是你原创的,请联系我,我会验证后在文中特别强调。我非常看重网络知识产权问题。

部分转载自某安全网

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值