Guest User

Untitled

a guest
May 23rd, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. function decryptpass($pass){
  2. $url = "api.php"; # URL to API file
  3. $username = "apiuser"; # Admin username goes here
  4. $password = "password"; # Admin password goes here
  5.  
  6. $postfields["username"] = $username;
  7. $postfields["password"] = md5($password);
  8. $postfields["action"] = "decryptpassword";
  9. $postfields["password2"] = $pass;
  10.  
  11. $ch = curl_init();
  12. curl_setopt($ch, CURLOPT_URL, $url);
  13. curl_setopt($ch, CURLOPT_POST, 1);
  14. curl_setopt($ch, CURLOPT_TIMEOUT, 100);
  15. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  16. curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
  17. $data = curl_exec($ch);
  18. curl_close($ch);
  19.  
  20. $data = explode(";",$data);
  21. foreach ($data AS $temp) {
  22. $temp = explode("=",$temp);
  23. $results[$temp[0]] = $temp[1];
  24. }
  25.  
  26. if ($results["result"]=="success") {
  27. echo $results["password"];
  28. } else {
  29. # An error occured
  30. echo "The following error occured: ".$results["message"];
  31. }
  32. }
Add Comment
Please, Sign In to add comment