首页 > 代码库 > linux 目录下文件批量植入和删除

linux 目录下文件批量植入和删除

linux目录下文件批量植入

[root@greymouster http2]# find /usr/local/http2/htdocs/ -type f|xargs sed -i "1  i <script>alert(1)</script>"

其中上面的1 为文件的第一行 i为植入

批量删除:

[root@greymouster ~]# find /usr/local/http2/htdocs/ -type f|xargs sed -i ‘/<script>alert(1)<\/script>/d‘

 批量替换

[root@greymouster ~]# find /usr/local/http2/htdocs/ -type f|xargs sed -i ‘s#<script>alert(1)</script>#1111#g

linux 目录下文件批量植入和删除