コード例 #1
0
ファイル: Poc.php プロジェクト: flyingwhale/poc
 public function start()
 {
     $this->pocDispatcher->dispatch(PocEventNames::FUNCTION_FETCHCACHE_BEGINNING, new BaseEvent($this));
     if ($this->filter->evaluate()) {
         if (!$this->fetchCache()) {
             $this->pocDispatcher->dispatch(PocEventNames::CAPTURE, new BaseEvent($this));
         }
     } else {
         $this->pocDispatcher->dispatch(PocEventNames::MONITOR, new BaseEvent($this));
     }
 }
コード例 #2
0
ファイル: PocTest.php プロジェクト: flyingwhale/poc
 public function testPocBlacklist()
 {
     $testAdapter = new NativeOutputHandlersTestCore();
     $blackList = new Filter();
     $blackList->addBlacklistCondition(false);
     $blackList->addBlacklistCondition(true);
     $blackList->addBlacklistCondition(false);
     $hasher = new Hasher();
     $hasher->addDistinguishVariable("testPocBlacklist" . rand());
     $poc1 = new Poc(array(Poc::PARAM_FILTER => $blackList, Poc::PARAM_TOOLSET => new HttpCapture(new TestOutput())));
     $testAdapter->pocBurner($poc1, rand());
     $poc2 = new Poc(array(Poc::PARAM_FILTER => $blackList, Poc::PARAM_TOOLSET => new HttpCapture(new TestOutput())));
     $testAdapter->pocBurner($poc2, '1');
     $poc3 = new Poc(array(Poc::PARAM_FILTER => $blackList, Poc::PARAM_TOOLSET => new HttpCapture(new TestOutput())));
     $testAdapter->pocBurner($poc3, self::NEEDLE);
     $output1 = $testAdapter->getOutput();
     $poc4 = new Poc(array(Poc::PARAM_FILTER => $blackList, Poc::PARAM_TOOLSET => new HttpCapture(new TestOutput())));
     $testAdapter->pocBurner($poc4, self::TESTSTRING2);
     $output2 = $testAdapter->getOutput();
     $this->assertTrue(!empty($output1));
     $this->assertTrue($output1 != $output2);
 }