Advertisement
Guest User

Screenshotlayer Parser fck csrf

a guest
Sep 4th, 2019
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * Created by PhpStorm.
  5.  * User: Chakratos
  6.  * Date: 04.06.2017
  7.  * Time: 19:11
  8.  */
  9. class ScreenshotlayerParser
  10. {
  11.     private $buildlink;
  12.  
  13.     /**
  14.      * @return mixed
  15.      */
  16.     public function getBuildlink()
  17.     {
  18.         return $this->buildlink;
  19.     }
  20.  
  21.     /**
  22.      * @param mixed $buildlink
  23.      */
  24.     public function setBuildlink($buildlink)
  25.     {
  26.         $this->buildlink = $buildlink;
  27.     }
  28.  
  29.     /**
  30.      * @return bool|string
  31.      */
  32.     public function getScreenshotLink()
  33.     {
  34.         $handle = curl_init('https://screenshotlayer.com/');
  35.         curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
  36.         curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, 0);
  37.         curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, 0);
  38.         $html = curl_exec($handle);
  39.         libxml_use_internal_errors(true); // Prevent HTML errors from displaying
  40.         $doc = new DOMDocument();
  41.         $doc->loadHTML($html);
  42.         $finder = new DomXPath($doc);
  43.         $name = "scl_request_secret";
  44.         $nodes = $finder->query("//input[contains(concat(' ', normalize-space(@name), ' '), ' $name ')]");
  45.  
  46.         $scl_request_secret = $nodes->item(0)->attributes->item(2)->nodeValue;
  47.         $hash = md5($this->buildlink . $scl_request_secret);
  48.         $api_query = "https://screenshotlayer.com/php_helper_scripts/scl_api.php?secret_key=" . $hash . "&url=" . urlencode($this->buildlink);
  49.         return $api_query;
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement