omerfdmrl/security

v2.1.11 2021-11-06 16:32 UTC

This package is auto-updated.

Last update: 2024-09-30 17:03:15 UTC


README

针对 Php 的高级安全类

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

特性

  • 安全防护 XSS、CSRF、SQL 注入、BASE64、RFI、LFI、命令注入、阻止可疑请求方法、阻止可疑用户代理和请求
  • 阻止 exec、passthru、shell_exec、system、proc_open、popen、curl_exec、curl_multi_exec、parse_ini_file、show_source 函数
  • 高级加密-解密
  • 不可解密加密
  • 高级 WAF 系统

安装

直接运行以下命令。

$ composer require omerfdmrl/security

示例用法

include 'vendor/autoload.php';

use Omerfdmrl\Security\Security;

$security = new Security;

// Default is: AES-128-ECB
$security->set_cipher('AES-128-ECB');

// Default is: md5(your-domain)
$security->set_key('My Secure Key');

// Default is: ['jpg','png','gif'] | Default refused extensions is: ['php','bat','']
$security->set_allowedExtension(array('jpg','png','gif'));

// Default is: _token
$security->set_tokenName('_token');

// Default is: getcwd() . '/.htaccess'
$security->set_htaccessPath(__DIR__ . '.htaccess');

// Default is: True,True,True,True,True | You must call waf() function
// postControl, getControl, fileControl, csrfControl, writeHtaccess
$security->waf(True,True,True,True,True);

文档

文档页面: Security Docs

许可证

MIT 许可证

贡献

  1. 分支它 ( https://github.com/omerfdmrl/security/fork )
  2. 创建您的功能分支 (git checkout -b my-new-feature)
  3. 提交您的更改 (git commit -am '添加一些特性')
  4. 推送到分支 (git push origin my-new-feature)
  5. 创建新的 Pull Request

贡献者

  • omerfdmrl Ömer Faruk Demirel - 创建者,维护者