willysec_id

Mass Set File and Directory Permissions

Jul 11th, 2024
886
0
Never
8
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.90 KB | Cybersecurity | 0 0
  1. <!-- This tools usefull when terminal or cmd function is disabled -->
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5.     <meta charset="UTF-8">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.     <title>Bulk Set Directory Permissions</title>
  8. </head>
  9. <body>
  10.     <h1>Mass Set File and Directory Permissions</h1>
  11.     <form method="post" action="">
  12.         <label for="directory">Master Path:</label>
  13.         <input type="text" id="directory" name="directory" placeholder="/home/willygoid/public_html" required>
  14.         <label for="permission">Permission:</label>
  15.         <input type="number" id="permission" name="permission" value="0777" required>
  16.         <button type="submit">Set Permissions</button>
  17.     </form>
  18. </body>
  19. </html>
  20.  
  21. <?php
  22.     if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  23.         $directory = $_POST['directory'];
  24.         $permission = $_POST['permission'];
  25.  
  26.         function setPermissions($dir) {
  27.             if (!is_dir($dir)) {
  28.                 throw new Exception("The provided path is not a directory");
  29.             }
  30.  
  31.             $iterator = new RecursiveIteratorIterator(
  32.                 new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS),
  33.                 RecursiveIteratorIterator::SELF_FIRST
  34.             );
  35.  
  36.             foreach ($iterator as $item) {
  37.                 if ($item->isDir()) {
  38.                     chmod($item, $permission);
  39.                 } else {
  40.                     chmod($item, $permission);
  41.                 }
  42.             }
  43.  
  44.             // Finally, set the top-level directory permissions
  45.             chmod($dir, $permission);
  46.         }
  47.  
  48.         try {
  49.             setPermissions($directory);
  50.             echo "<p>Permissions set to $permission for all files and directories in $directory</p>";
  51.         } catch (Exception $e) {
  52.             echo "<p>Error: " . $e->getMessage() . "</p>";
  53.         }
  54.     }
  55.     ?>
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Gelpadorn
    81 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).
  • Sarzeitoz
    75 days
    # CSS 0.06 KB | 0 0
    1. We just shared HQ data on our channel: https://t.me/theprotocolone
Add Comment
Please, Sign In to add comment