1716-272-9825

全国24Hours技术服务电话

[友价通用补丁] 友价 linux/nginx/windows 禁止执行木马,注入运行、防护木马处理方法。

0
回复
1193
查看
[复制链接]

200

主题

205

帖子

5144

积分

管理员

Rank: 22Rank: 22Rank: 22Rank: 22Rank: 22Rank: 22

UID
1
积分
5144
猪币
6450
金钱
1069
贡献
1499
阅读权限
200
买家信用
卖家信用
威望
1153
联系QQ
QQ
注册时间
2016-3-1
发表于 2019-6-29 11:06:26 | 显示全部楼层 |阅读模式
【虚拟主机或linux/nginx主机】存在可执行脚本权限漏洞,有被注入并运行木马的风险的解决方法

…………………………………………………………………………………………

本文适用于虚拟主机或LINUX主机的用户朋友,因为虚拟主机或LINUX的主机,不方便直接操作目录权限(即使操作了,也不完全能修复),因此我们是通过设置伪静态的方法,来实现漏洞修复,具体步骤如下:

一、伪静态规则是.htaccess的用户参照这里:

打开.htaccess,将以下代码复制在这个文件底部,保存即可。

  1. RewriteRule upload/(.*).(PHP)$ – [L,NC]
  2. RewriteRule upload/(.*).(asp)$ – [L,NC]
  3. RewriteRule upload1/(.*).(php)$ – [L,NC]
  4. RewriteRule upload1/(.*).(asp)$ – [L,NC]
  5. RewriteRule upload2/(.*).(php)$ – [L,NC]
  6. RewriteRule upload2/(.*).(asp)$ – [L,NC]
  7. RewriteRule upload3/(.*).(php)$ – [L,NC]
  8. RewriteRule upload3/(.*).(asp)$ – [L,NC]
  9. RewriteRule ad/(.*).(PHP)$ – [L,NC]
  10. RewriteRule ad/(.*).(asp)$ – [L,NC]
  11. RewriteRule gg/(.*).(PHP)$ – [L,NC]
  12. RewriteRule gg/(.*).(asp)$ – [L,NC]
  13. RewriteRule uploadfile/(.*).(php)$ – [L,NC]
  14. RewriteRule uploadfile/(.*).(asp)$ – [L,NC]
  15. RewriteRule userphoto/(.*).(php)$ – [L,NC]
  16. RewriteRule userphoto/(.*).(asp)$ – [L,NC]
  17. RewriteRule attached/(.*).(php)$ – [L,NC]
  18. RewriteRule attached/(.*).(asp)$ – [L,NC]
  19. RewriteRule img/(.*).(php)$ – [L,NC]
  20. RewriteRule img/(.*).(asp)$ – [L,NC]
  21. RewriteRule homeimg/(.*).(php)$ – [L,NC]
  22. RewriteRule homeimg/(.*).(asp)$ – [L,NC]
  23. RewriteRule js/(.*).(php)$ – [L,NC]
  24. RewriteRule js/(.*).(asp)$ – [L,NC]
  25. RewriteRule css/(.*).(php)$ – [L,NC]
  26. RewriteRule css/(.*).(asp)$ – [L,NC]
复制代码

二、伪静态规则是httpd.ini的用户参照这里:

打开httpd.ini,将以下代码复制在这个文件底部,保存即可。

  1. RewriteRule /config/ueditor/php/upload/(.*).PHP$ /css/ [I]
  2. RewriteRule /config/ueditor/php/upload/(.*).asp$ /css/ [I]
  3. RewriteRule /config/ueditor/php/upload1/(.*).php$ /css/ [I]
  4. RewriteRule /config/ueditor/php/upload1/(.*).asp$ /css/ [I]
  5. RewriteRule /config/ueditor/php/upload2/(.*).php$ /css/ [I]
  6. RewriteRule /config/ueditor/php/upload2/(.*).asp$ /css/ [I]
  7. RewriteRule /config/ueditor/php/upload3/(.*).php$ /css/ [I]
  8. RewriteRule /config/ueditor/php/upload3/(.*).asp$ /css/ [I]
  9. RewriteRule /config/ueditor_mini/php/upload/(.*).php$ /css/ [I]
  10. RewriteRule /config/ueditor_mini/php/upload/(.*).asp$ /css/ [I]
  11. RewriteRule /config/ueditor_mini/php/upload1/(.*).php$ /css/ [I]
  12. RewriteRule /config/ueditor_mini/php/upload1/(.*).asp$ /css/ [I]
  13. RewriteRule /config/ueditor_mini/php/upload2/(.*).php$ /css/ [I]
  14. RewriteRule /config/ueditor_mini/php/upload2/(.*).asp$ /css/ [I]
  15. RewriteRule /config/ueditor_mini/php/upload3/(.*).php$ /css/ [I]
  16. RewriteRule /config/ueditor_mini/php/upload3/(.*).asp$ /css/ [I]
  17. RewriteRule /ad/(.*).php$ /css/ [I]
  18. RewriteRule /ad/(.*).asp$ /css/ [I]
  19. RewriteRule /js/(.*).php$ /css/ [I]
  20. RewriteRule /js/(.*).asp$ /css/ [I]
  21. RewriteRule /homeimg/(.*).php$ /css/ [I]
  22. RewriteRule /homeimg/(.*).asp$ /css/ [I]
  23. RewriteRule /css/(.*).php$ /css/ [I]
  24. RewriteRule /css/(.*).asp$ /css/ [I]
  25. RewriteRule /gg/(.*).php$ /css/ [I]
  26. RewriteRule /gg/(.*).asp$ /css/ [I]
  27. RewriteRule /img/(.*).php$ /css/ [I]
  28. RewriteRule /img/(.*).asp$ /css/ [I]
  29. RewriteRule /userphoto/(.*).php$ /css/ [I]
  30. RewriteRule /userphoto/(.*).asp$ /css/ [I]
  31. RewriteRule /upload/(.*).php$ /css/ [I]
  32. RewriteRule /upload/(.*).asp$ /css/ [I]
  33. RewriteRule /ckeditor/attached/(.*).php$ /css/ [I]
  34. RewriteRule /ckeditor/attached/(.*).asp$ /css/ [I]
  35. RewriteRule /config/loveedit/uploadfile/(.*).PHP$ /css/ [I]
  36. RewriteRule /config/loveedit/uploadfile/(.*).asp$ /css/ [I]
复制代码

三、nginx伪静态的,参考如下:

将以下规则复制进伪静态文件里即可
  1. location ~* ^/((.*)upload|ad|gg|img|homeimg|js|css|ckeditor\/attached|(.*)upload1|(.*)upload2|(.*)upload3)/.*\.(php|php5|asp)$
  2. {
  3. deny all;
  4. }
复制代码

四、IIS7,建立一个UTF8格式的文件,命名为web.config,将以下代码复制到这个文件中

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3.     <system.webServer>
  4.         <handlers accessPolicy="Read" />
  5.     </system.webServer>
  6. </configuration>
复制代码

详细操作地址:http://www.epzhu.com/thread-258-1-1.html

然后将这个文件web.config传到后台提示的漏洞文件夹中

如果以上的这个IIS7方法不适用, 请用以下代码

  1. <rule name="p1">
  2. <match url="^ad/(.*).php" ignoreCase="false" />
  3. <action type="Rewrite" url="/css/" appendQueryString="false" />
  4. </rule>
  5. <rule name="a1">
  6. <match url="^ad/(.*).asp" ignoreCase="false" />
  7. <action type="Rewrite" url="/css/" appendQueryString="false" />
  8. </rule>
  9. <rule name="p0">
  10. <match url="^gg/(.*).php" ignoreCase="false" />
  11. <action type="Rewrite" url="/css/" appendQueryString="false" />
  12. </rule>
  13. <rule name="a0">
  14. <match url="^gg/(.*).asp" ignoreCase="false" />
  15. <action type="Rewrite" url="/css/" appendQueryString="false" />
  16. </rule>
  17. <rule name="p2">
  18. <match url="(.*)upload/(.*).php" ignoreCase="false" />
  19. <action type="Rewrite" url="/css/" appendQueryString="false" />
  20. </rule>
  21. <rule name="a2">
  22. <match url="(.*)upload/(.*).asp" ignoreCase="false" />
  23. <action type="Rewrite" url="/css/" appendQueryString="false" />
  24. </rule>
  25. <rule name="p3">
  26. <match url="(.*)upload1/(.*).php" ignoreCase="false" />
  27. <action type="Rewrite" url="/css/" appendQueryString="false" />
  28. </rule>
  29. <rule name="a3">
  30. <match url="(.*)upload1/(.*).asp" ignoreCase="false" />
  31. <action type="Rewrite" url="/css/" appendQueryString="false" />
  32. </rule>
  33. <rule name="p4">
  34. <match url="(.*)upload2/(.*).php" ignoreCase="false" />
  35. <action type="Rewrite" url="/css/" appendQueryString="false" />
  36. </rule>
  37. <rule name="a4">
  38. <match url="(.*)upload2/(.*).asp" ignoreCase="false" />
  39. <action type="Rewrite" url="/css/" appendQueryString="false" />
  40. </rule>
  41. <rule name="p5">
  42. <match url="(.*)upload3/(.*).php" ignoreCase="false" />
  43. <action type="Rewrite" url="/css/" appendQueryString="false" />
  44. </rule>
  45. <rule name="a5">
  46. <match url="(.*)upload3/(.*).asp" ignoreCase="false" />
  47. <action type="Rewrite" url="/css/" appendQueryString="false" />
  48. </rule>
  49. <rule name="p6">
  50. <match url="^img/(.*).php" ignoreCase="false" />
  51. <action type="Rewrite" url="/css/" appendQueryString="false" />
  52. </rule>
  53. <rule name="a6">
  54. <match url="^img/(.*).asp" ignoreCase="false" />
  55. <action type="Rewrite" url="/css/" appendQueryString="false" />
  56. </rule>
  57. <rule name="p7">
  58. <match url="^ckeditor/attached/(.*).php" ignoreCase="false" />
  59. <action type="Rewrite" url="/css/" appendQueryString="false" />
  60. </rule>
  61. <rule name="a7">
  62. <match url="^ckeditor/attached/(.*).asp" ignoreCase="false" />
  63. <action type="Rewrite" url="/css/" appendQueryString="false" />
  64. </rule>

  65. <rule name="p8">
  66. <match url="^css/(.*).php" ignoreCase="false" />
  67. <action type="Rewrite" url="/css/" appendQueryString="false" />
  68. </rule>
  69. <rule name="a8">
  70. <match url="^css/(.*).asp" ignoreCase="false" />
  71. <action type="Rewrite" url="/css/" appendQueryString="false" />
  72. </rule>
  73. <rule name="p9">
  74. <match url="^js/(.*).php" ignoreCase="false" />
  75. <action type="Rewrite" url="/css/" appendQueryString="false" />
  76. </rule>
  77. <rule name="a9">
  78. <match url="^js/(.*).asp" ignoreCase="false" />
  79. <action type="Rewrite" url="/css/" appendQueryString="false" />
  80. </rule>
  81. <rule name="p10">
  82. <match url="^homeimg/(.*).php" ignoreCase="false" />
  83. <action type="Rewrite" url="/css/" appendQueryString="false" />
  84. </rule>
  85. <rule name="a10">
  86. <match url="^homeimg/(.*).asp" ignoreCase="false" />
  87. <action type="Rewrite" url="/css/" appendQueryString="false" />
  88. </rule>
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

联系我们
1716-272-9825

客服QQ:120036745

服务时间:72小时在线 !

关注我们

QQ|百度统计Archiver手机版小黑屋一品猪网 ( 京ICP备14050275号-1 )

一品猪网! epzhu   © 2016-2019 一品猪网、我们的宗旨:先学会做人、在去做事!