コード例 #1
0
ファイル: View.php プロジェクト: googlecode-mirror/brawler
 /**
  * Renders the view
  *
  * @return void
  */
 public function render()
 {
     ob_start();
     $this->view();
     $output = ob_get_contents();
     ob_end_clean();
     Brawler_Console_Output::output($output);
 }
コード例 #2
0
ファイル: Input.php プロジェクト: googlecode-mirror/brawler
 /**
  * Retrieves input
  * 
  * @param $msg Query message
  * @param $stripEnter Strip trailing Linebreak
  * @return String
  */
 public static function get($msg, $stripEnter = true)
 {
     Brawler_Console_Output::output($msg);
     do {
         $return = fgets(self::_getStream());
     } while (!self::_validate($return));
     if ($stripEnter) {
         $return = substr($return, 0, strlen($return) - 1);
     }
     return $return;
 }
コード例 #3
0
ファイル: Index.php プロジェクト: googlecode-mirror/brawler
 public function indexAction()
 {
     Brawler_Console_Output::output('Index');
 }
コード例 #4
0
ファイル: Grid.php プロジェクト: googlecode-mirror/brawler
 /**
  * Renders a single line
  * 
  * @param ArrayObject $row
  * @return void
  */
 protected function _renderline($row)
 {
     if (!$this->_columnwidth) {
         $this->_determineColumnWidth();
     }
     $row = (array) $row;
     $i = 0;
     $print = '';
     foreach ($row as $value) {
         $fillcount = $this->_columnwidth[$i] - strlen($value) + $this->_padding;
         $print .= $value . str_repeat(' ', $fillcount);
         $i++;
     }
     Brawler_Console_Output::output($print);
 }
コード例 #5
0
ファイル: Scan.php プロジェクト: googlecode-mirror/brawler
 /**
  * Recursive method
  * 
  * @param String $url
  * @param Int $level
  * @param Int $maxlevel
  * @return void
  */
 protected function _scanRecursively($url, $level, $maxlevel)
 {
     Brawler_Console_Output::output('Scanning: ' . $url);
     // Checking for Vulns
     $this->_checkVulnerabilites($url);
     // fetch urls
     $urls = $this->_client->request($url)->getUrls();
     $urls = array_unique($urls);
     $urls = $this->_filterKnownUrls($urls);
     $urls = $this->_filterForeignHostUrls($urls);
     Brawler_Console_Output::output('Found ' . count($urls) . ' new resources.');
     $this->_urls = array_merge($urls, $this->_urls);
     // scan newly found urls
     if ($level < $maxlevel) {
         foreach ($urls as $newUrl) {
             $this->_scanRecursively($newUrl, $level + 1, $maxlevel);
         }
     }
 }
コード例 #6
0
ファイル: Output.php プロジェクト: googlecode-mirror/brawler
 /**
  * Inits the output streams
  * 
  * @return void
  */
 protected static function _init()
 {
     self::$_stdout = fopen('php://stdout', 'w');
     self::$_stderr = fopen('php://stderr', 'w');
 }