Exemple #1
0
 public function test(TargetInterface $target)
 {
     $results = $this->_em->getRepository('AppBundle:XSSAttack')->findAll();
     //put url with http form
     //$target->setUrl($this->addHttpString($target->getUrl()));
     $target->setUrl(self::addHttpString($target->getUrl()));
     foreach ($results as $result) {
         $response = $this->sendAttack($target, $result);
         //Check if still on page 200
         if (!self::checkStatusCodeWorks($response->getStatusCode())) {
             dump($result);
             dump($response);
             echo "XSS FAIL!";
             die;
         }
         //Check if the script is in the body
         if (self::findAttackInHtml($result->getMessage(), $response->getBody(true))) {
             echo "Script in the HTML ! Now we have to check if it's executed...";
             die;
         }
     }
 }