Linux安装SourceGuardian loader(SG11组件)
SourceGuardian提供php源码文件的加密,而SourceGuardian loader则是提供运行这些加密php文件的php扩展。
一、访问https://www.sourceguardian.com/loaders/download.php
输入服务器上phpinfo函数的php文件地址,如: https://www.2dan.cc/phpinfo.php
二、在线的检测脚本会根据phpinfo里的信息,提取到php的版本信息和扩展路径,并会提示接下来该怎么做。如:
1、下载什么文件ixed.7.4.lin
2、上传到服务器/usr/local/php/lib/php/extensions/no-debug-non-zts-20190902
3、编辑/usr/local/php/etc/php.ini
增加一行extension=ixed.7.4.lin
4、重启php进程
使用Snuffleupagus保护PHP
之前介绍了使用Suhosin保护PHP,由于Suhosin仅支持到php5.x,对于php7.x及以上版本可以试试Snuffleupagus
编译安装:
git clone https://github.com/jvoisin/snuffleupagus
cd snuffleupagus/src
phpize
./configure --with-php-config=/usr/local/php/bin/php-config --enable-snuffleupagus
make
make install
然后在php.ini
中引用
[Snuffleupagus]
extension=snuffleupagus.so
sp.configuration_file=/usr/local/php/conf.d/snuffleupagus.rules
其中/usr/local/php/conf.d/snuffleupagus.rules
为规则文件,内容可参考:
sp.eval_blacklist.list("base64_decode,system,exec,shell_exec,passthru,proc_open,proc_close, proc_get_status,checkdnsrr,getmxrr,getservbyname,getservbyport, syslog,popen,show_source,highlight_file,dl,socket_listen,socket_create,socket_bind,socket_accept, socket_connect, stream_socket_server, stream_socket_accept,stream_socket_client,ftp_connect, ftp_login,ftp_pasv,ftp_get,sys_getloadavg,disk_total_space, disk_free_space,posix_ctermid,posix_get_last_error,posix_getcwd, posix_getegid,posix_geteuid,posix_getgid, posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid, posix_getppid,posix_getpwnam,posix_getpwuid, posix_getrlimit, posix_getsid,posix_getuid,posix_isatty, posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid, posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname");sp.global.show_old_php_warning.disable();
和Suhosin一样,可以设置函数黑白名单。
更多使用方法参考官网:https://snuffleupagus.readthedocs.io/config.html
为CentOS7升级gcc至10.x
yum -y install centos-release-scl
yum -y install devtoolset-10-gcc*
scl enable devtoolset-10 bash
需要注意的是scl命令启用只是临时的,退出shell或重启就会恢复原系统gcc版本。
如果要永久生效的话,执行:
echo "source /opt/rh/devtoolset-10/enable" >>/etc/profile
rm删除时/usr/bin/rm: Argument list too long
1、find
find . -name "*" | xargs rm -rf
2、find with delete
find . -name "*" -delete
3、rsync
先建立一个空目录
mkdir -p /root/blank
用rsync删除目标目录
rsync --delete-before -av /root/blank/ /home/data/
推荐使用rsync,速度最快