A Powerful Waf To Protect The Php Applications
Use the package manager
composer require abdal-security-agency/abdal-php-waf
Here's a basic usage example: Use in your main project file
//Call Abdal PHP WAF
require_once __DIR__ . '/example_address/vendor/autoload.php';
import Abdal PHP WAF to main file of your project
if (\ABDALPHPWAF\Request_Method_Protector::request_methods_only_allow('POST') == 'allow'){
echo "this HTTP request method is allowed";
}else{
echo "this HTTP request method is unauthorized";
}
Supported http method : GET,HEAD,POST,PUT,DELETE,OPTIONS,TRACE,PATCH
if (\ABDALPHPWAF\Anti_XSS::xss_detector($_SERVER['REQUEST_URI'])){
echo "XSS Attack Detected";
}
if (\ABDALPHPWAF\Anti_SQL_Injection::sql_injection_detector($_SERVER['REQUEST_URI'])){
echo "SQL Injection Attack Detected";
}
if (\ABDALPHPWAF\Dos_Protector::dos_detection()){
echo "DOS Attack Detected";
}
if (\ABDALPHPWAF\Anti_CRLF::crlf_detector($_SERVER['REQUEST_URI'])){
echo "CRLF Attack Detected";
}
if (\ABDALPHPWAF\Anti_RFI::rfi_detector($_SERVER['REQUEST_URI'])){
echo "RFI Attack Detected";
}
$get_parameter = $_GET['file'];
$white_list_extension = array("rar","7z","zip","apk","exe","mp3","wav","mp4","pdf","docx");
if (\ABDALPHPWAF\File_Download_Controller::extension_controller($get_parameter,$white_list_extension)){
echo "Access Denied";
}
if (\ABDALPHPWAF\PROXY_PROTECTION::proxy_detector()){
echo "Proxy Access Denied";
}
\ABDALPHPWAF\Header_Security::secure_x_powered_by();
\ABDALPHPWAF\Header_Security::secure_x_dns_prefetch_control();
\ABDALPHPWAF\Header_Security::secure_x_xss_protection();
\ABDALPHPWAF\Header_Security::secure_x_content_type_options();
\ABDALPHPWAF\Header_Security::secure_strict_transport_security();
\ABDALPHPWAF\Header_Security::secure_x_frame_options_set_deny();
# OR
\ABDALPHPWAF\Header_Security::secure_x_frame_options_set_sameorigin();
If you don’t want them to load data from your domain
\ABDALPHPWAF\Header_Security::secure_x_permitted_cross_domain_policies();
\ABDALPHPWAF\Header_Security::secure_cache_control();
\ABDALPHPWAF\Header_Security::secure_cross_origin_resource_sharing();
Ebrahim Shafiei (EbraSha) - (Ready to cooperate with international projects)
- Email : Prof.Shafiei@Gmail.com
Abdal Php Waf is open-source software licensed under the MIT license.