• PHP Taint


    Taint扩展PHP开发环境中用于检测XSS代码(污染的字符串),SQL注入漏洞,shell注入,等。目前支持PHP 7.1。Windows平台下提供线程安全和非线程安全两个版本,各支持64位和32位。本文选择非线程安全

    Windows平台

    下载非线程安全版本

    wget  http://windows.php.net/downloads/pecl/releases/taint/2.0.2/php_taint-2.0.2-7.0-nts-vc14-x86.zip

    安装php_taint.dll文件到下述目录下 

    ...phpext

    修改php.ini配置文件

    display_errors = On
    error_reporting = E_ALL & ~E_DEPRECATED

    extension=php_taint.dll
    taint.enable=1

    重启web、php服务器,查看phpinfo(),检查模块是否安装上。

    Linux平台

    下载安装taint

    wget http://pecl.php.net/get/taint-2.0.2.tgz
    
    tar zxvf taint-2.0.2.tgz 
    
    cd taint-2.0.2
    phpize(如果找不到该命令,需要apt-get install php7-dev)
    ./configure
    make
    make install

    修改php.ini配置文件

    display_errors = On
    error_reporting = E_ALL & ~E_DEPRECATED
    
    extension=taint.so
    taint.enable=1

    日常开发运行过程中的请重点检查Warning部分 Tainted提示信息

    安全函数

    addslashes    
    addcslashes    
    htmlspecialchars    
    htmlentities    
    escapeshellcmd    
    mysql_escape_string    
    mysql_real_escape_string    
    mysqli_escape_string/MySQLi::escape_string    
    mysqli_real_escape_string/MySQLi::real_escape_string    
    sqlite_escape_string/SqliteDataBase::escapeString    
    PDO::quote

    参考:

    http://php.net/manual/en/book.taint.php
    http://www.cnblogs.com/k1988/archive/2011/01/26/2165616.html
    https://blog.ianli.site/2013/09/build-php-and-extension-for-windows
  • 相关阅读:
    表操作
    mysql表的完整性约束
    mysql支持的数据类型
    数据库存储引擎
    Navicat工具、pymysql模块、数据备份
    数据库一
    IO模型
    协成
    线程
    进程
  • 原文地址:https://www.cnblogs.com/superf0sh/p/5703055.html
Copyright © 2020-2023  润新知