php的一些不安全函数,禁止php函数列表,禁用不安全的PHP函数

66ec243e79d17b72a44828e5aab3e59e.png

欢迎登录清源教育官网http://www.doczj.com/doc/42390660f01dc281e43af017.html查看更多视频教程

禁止php函数列表,禁用不安全的PHP函数

禁用不安全的PHP函数,有些php函数是不够安全的,我们必须要加强安全配置,如果做虚拟主机,建议禁止php函数列表如下:

代码如下:

disable_functions = 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_ac cept, 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,pos ix_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 PHP.ini 里面的 disable_functions 开关选项可关闭一些危险的函数,比如system,exec 等,比如: disable_functions = phpinfo , 如果在文件中调用 phpinfo() 函数,那么在 error_reporting 开启的情况下,会提示如下错误:

Warning: phpinfo() has been disabled for security reasons

目前发现万网主机是屏蔽此函数的。

利用 google: inurl:phpinfo.php 就可查看大量的主机信息,一般为管理员进行调试的时候放上未删除的文件。禁用不安全的PHP函数,这是必须的

如果你在免费的空间内,使用自己写的网站,此时你就需要如下的方法见

但是如果你没有更改PHP.ini 的权限时,可以直接注释被禁止的代码.

来源:清源教育

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值