PHP code example of shieldfy / waf-detector

1. Go to this page and download the library: Download shieldfy/waf-detector library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

shieldfy / waf-detector example snippets


$firewalls = [
    new \Shieldfy\Firewall\CloudFlare(),
    new \Shieldfy\Firewall\Incapsula(),
    new \Shieldfy\Firewall\ModSecurity(),
    new \Shieldfy\Firewall\Shieldfy(),
];

$detector = new \Shieldfy\Detector(... $firewalls);

foreach ( $detector->detect('http://www.example.com') as $firewall => $status ) {
    // do something, perhaps displaying the status ?
}

# php bin/waf-detector.php http://example.org