Example #1
0
 public static function load()
 {
     require_once dirname(__FILE__) . '/Rules/Bbclone.php';
     Bouncer_Rules_Bbclone::load();
     require_once dirname(__FILE__) . '/Rules/Basic.php';
     Bouncer_Rules_Basic::load();
     require_once dirname(__FILE__) . '/Rules/Browser.php';
     Bouncer_Rules_Browser::load();
     require_once dirname(__FILE__) . '/Rules/Robot.php';
     Bouncer_Rules_Robot::load();
     require_once dirname(__FILE__) . '/Rules/Request.php';
     Bouncer_Rules_Request::load();
     require_once dirname(__FILE__) . '/Rules/Fingerprint.php';
     Bouncer_Rules_Fingerprint::load();
     require_once dirname(__FILE__) . '/Rules/Network.php';
     Bouncer_Rules_Network::load();
     require_once dirname(__FILE__) . '/Rules/Geoip.php';
     Bouncer_Rules_Geoip::load();
 }
Example #2
0
 public static function agent()
 {
     require_once dirname(__FILE__) . '/Rules/Network.php';
     require_once dirname(__FILE__) . '/Rules/Geoip.php';
     $id = $_GET['agent'];
     $identity = Bouncer::getIdentity($id);
     if (empty($identity)) {
         return;
     }
     list($identity, $result) = Bouncer::analyseIdentity($identity);
     list($status, $score, $details) = $result;
     echo '<table class="bouncer-table bouncer-table-agent">';
     echo '<tr>', '<th colspan="2">', 'Identity', '</th>', '</tr>';
     echo '<tr>', '<td>', 'Id', '</td>', '<td>', $identity['id'], '</td>', '</tr>';
     echo '<tr>', '<td>', 'Signature', '</td>', '<td>', '<a href="?filter=signature%3A' . $identity['signature'] . '">', $identity['signature'], '</a></td>', '</tr>';
     echo '<tr>', '<td>', 'Fingerprint', '</td>', '<td>', '<a href="?filter=fingerprint%3A' . $identity['fingerprint'] . '">', $identity['fingerprint'], '</a></td>', '</tr>';
     echo '<tr>', '<td>', 'Type', '</td>', '<td>', '<a href="?filter=type%3A' . $identity['type'] . '">', $identity['type'], '</a></td>', '</tr>';
     echo '<tr>', '<td>', 'Name', '</td>', '<td>', '<a href="?filter=name%3A' . $identity['name'] . '">', $identity['name'], '</a></td>', '</tr>';
     if (isset($identity['version'])) {
         echo '<tr>', '<td>', 'Version', '</td>', '<td>', $identity['version'], '</td>', '</tr>';
     }
     if (isset($identity['os'])) {
         $system = $identity['os'][0];
         echo '<tr>', '<td>', 'OS', '</td>', '<td>', '<a href="?filter=system%3A' . $system . '">', $system, '</a></td>', '</tr>';
     }
     echo '<tr>', '<td>', 'Addr', '</td>', '<td>', '<a href="?filter=addr%3A' . $identity['addr'] . '">', $identity['addr'], '</a></td>', '</tr>';
     echo '<tr>', '<td>', 'Host', '</td>', '<td>', $identity['host'], '</td>', '</tr>';
     echo '<tr>', '<td>', 'Extension', '</td>', '<td>', '<a href="?filter=extension%3A' . $identity['extension'] . '">', $identity['extension'], '</a></td>', '</tr>';
     if (self::$_detailed_ips) {
         echo '<tr>', '<td>', 'Http:BL', '</td>';
         echo '<td>';
         if (isset($identity['httpbl'])) {
             print_r($identity['httpbl']);
         }
         echo '</td>', '</tr>';
         echo '<tr>', '<td>', 'Reverse', '</td>', '<td>';
         $rev = preg_replace('/^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$/', '$4.$3.$2.$1', $identity['addr']);
         $ptrs = dns_get_record("{$rev}.in-addr.arpa.", DNS_PTR);
         print_r($ptrs);
         echo '</td>', '</tr>';
         echo '<tr>', '<td>', 'DNS', '</td>', '<td>';
         $dns = dns_get_record($identity['host'], DNS_A);
         print_r($dns);
         echo '</td>', '</tr>';
         echo '<tr>', '<td>', 'Network', '</td>', '<td>';
         print_r(Bouncer_Rules_Network::doPWLookupBulk(array($identity['addr'])));
         echo '</td>', '</tr>';
     } else {
         $lookup = Bouncer_Rules_Network::doPWLookupBulk(array($identity['addr']));
         $network = $lookup[$identity['addr']];
         echo '<tr>', '<td>', 'Network Org Name', '</td>', '<td>';
         echo $network['org-name'];
         echo '</td>', '</tr>';
         echo '<tr>', '<td>', 'Network Net Name', '</td>', '<td>';
         echo $network['net-name'];
         echo '</td>', '</tr>';
     }
     echo '<tr>', '<th colspan="2">', 'Agent HTTP Headers', '</th>', '</tr>';
     foreach ($identity['headers'] as $key => $value) {
         echo '<tr>', '<td>', $key, '</td>', '<td>', $value, '</td>', '</tr>';
     }
     if (self::$_detailed_score) {
         echo '<tr>', '<th>', 'Score', '</th>', '</tr>';
         foreach ($details as $detail) {
             list($value, $message) = $detail;
             echo '<tr>', '<td>', $message, '</td>', '<td>', $value, '</td>', '</tr>';
         }
         echo '<tr>', '<td>', 'Total', '</td>', '<td><b>', $score, '</b></td>', '</tr>';
     }
     echo '</table>';
     $connections = Bouncer::getAgentConnections($id, self::$_namespace);
     if (empty($connections)) {
         $connections = array();
     }
     self::_displayConnections($connections);
 }