Advertisement
bug7sec

TP-LINK

Sep 3rd, 2016
549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.08 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. $isx =1;
  4. for ($i=0; $i <$isx; $i++) {
  5.     $ch = curl_init();
  6.     curl_setopt($ch, CURLOPT_URL,"10.222.34.115/userRpm/popupSiteSurveyExRpm.htm?region=40");
  7.     curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
  8.     curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  9.     curl_setopt($ch, CURLOPT_REFERER, "http://10.222.34.115/userRpm/WzdWlanExPreRpm.htm");
  10.     curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
  11.     curl_setopt($ch, CURLOPT_USERPWD, "admin:admin");
  12.     $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);   //get status code
  13.     $result=curl_exec ($ch);
  14.     curl_close ($ch);
  15.     $re = "/Array((.*?));/s";
  16.     preg_match_all($re, $result, $matches);
  17.     $res = "/\"(.*?)\",(.*?),(.*?),0,0,0,/";
  18.     preg_match_all($res, $matches[2][1], $matchess);
  19.     foreach ($matchess[2] as $key => $value) {
  20.         $ex = explode(",", $matchess[3][$key]);
  21.         if(count($ex) == 2){
  22.             if(strtolower(str_replace('"', "", $value)) != ""){
  23.                 $db = explode(",", $matchess[3][$key]);
  24.                 echo "-> ".strtolower(str_replace('"', "", $value))." ( ".$db[0]." Db )\r\n";
  25.             }
  26.         }
  27.     }
  28.     $isx++;
  29. }
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement