chasgrundy

PHP LDAP simple JSON web service

Jan 19th, 2014
1,188
0
Never
5
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.31 KB | None | 0 0
  1. <?php
  2. $q = strtolower(preg_replace('/[^0-9a-zA-Z@\.]/i','',$_GET['q']));
  3. $attribute = strtolower(preg_replace('/[^0-9a-zA-Z]/i','',$_GET['attribute']));
  4.  
  5. if (empty($q) || empty($attribute)){ echo "Missing parameter. Format should be index.php?q=XXXXXXX&attribute=YYYYYYY.\n\nq may be a NetID or email address.\nattribute may be any valid LDAP attribute (e.g., ndMail, telephoneNumber, or ndPrimaryAffiliation).\n\nAll values are case insensitive.\n\nSee eds.nd.edu for possible attributes and values."; die;}
  6.  
  7. $ds=ldap_connect("ldaps://ldap.nd.edu",636);  // must be a valid LDAP server!
  8.  
  9. if ($ds) {
  10.     $r=ldap_bind($ds);     // this is an "anonymous" bind, typically
  11.                            // read-only access
  12.  
  13.     if (strpos($q, '@')) {
  14.         $filter = "ndmail=".$q;
  15.     }
  16.     else {
  17.         $filter = "uid=".$q;
  18.     }
  19.  
  20.     $sr=ldap_search($ds, "o=University of Notre Dame,st=Indiana,c=US", $filter);  
  21.  
  22.     $info = ldap_get_entries($ds, $sr);
  23.  
  24.     echo "{\n   \"title\": \"LDAP\",\n      \"attributes\": {\n";
  25.  
  26.     for ($i=0; $i<$info["count"]; $i++) {
  27.         echo "         \"netid\": \"" . $info[$i]["uid"][0] . "\",\n";
  28.         echo "         \"".$attribute."\": \"" . $info[$i][$attribute][0] . "\"\n";
  29.     }
  30.  
  31.     ldap_close($ds);
  32.     echo "      }\n}";
  33.  
  34. } else {
  35.     echo "{ \"Unable to connect to LDAP server\" }";
  36. }
  37. ?>
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • Terjuxel
    20 days
    # CSS 0.85 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
  • User was banned
Add Comment
Please, Sign In to add comment