zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    [bzoj1613 Usaco2007 Jan]Running贝茜的晨练计划
    [bzoj1600][Usaco2008 Oct]建造栅栏
    [bzoj3208]花神的秒题计划I
    [vijos1011]滑雪
    [noip2007 pjt3] 守望者的逃离
    DP(1) 背包
    快速幂 模板及应用
    BZOJ1303: [CQOI2009]中位数图
    BZOJ1083: [SCOI2005]繁忙的都市
    Bzoj1084: [SCOI2005]最大子矩阵
  • 原文地址:https://www.cnblogs.com/superf0sh/p/5703055.html
Copyright © 2011-2022 走看看