Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- [+] Simple & Useful :)
- [+] By: xSecurity
- [+] Home: www.sec4ever.com
- => www.is-sec.com
- => www.dev-point.com
- [+] Skype: xSecur1ty
- */
- echo "<form method='POST'>
- <title>[Protect] Folder Via Htaccess =) | By: xSecurity</title>
- <center>
- <br><br>\<font face='Tahoma' size='5'><b><font color='red'>Protect</font> Folder Via Htaccess</b></font><font face='Tahoma' size='2'>/xSecurity</font><br><br>
- <font face='Tahoma' size='2'>Path: <input type='text' name='path' value='/home/".@get_current_user()."/' size='50'><br>
- <input type='text' name='username' placeholder='Username'>
- <input type='text' name='password' placeholder='Password'>
- <input type='submit' value='Generate Protection' name='submit'></font></form></center>";
- # POSTS
- $username = $_POST['username'];
- $password = $_POST['password'];
- $path = $_POST['path'];
- # htaccess
- $htaccess = "IyBHZW5lcmF0ZWQgQnkgeFNlY3VyaXR5IAojIERlVi1Qb2luVC5Db00KCkF1dGhUeXBlIEJhc2ljCkF1dGhOYW1lICJQcm90ZWN0ZWRbeFNlY3VyaXR5XSIKQXV0aFVzZXJGaWxlICN4c2VjdXJpdHkjLy5odHBhc3N3ZApSZXF1aXJlIHZhbGlkLXVzZXI=";
- $b0x = str_replace("#xsecurity#" ,$path ,base64_decode($htaccess));
- $crypt = crypt($password, base64_encode($password));
- # Create
- if($_POST['submit'])
- {
- $htpasswd = fopen($path.'.htpasswd', 'w');
- if($htpasswd)
- {
- $s = $username.":".$crypt;
- $x = fwrite($htpasswd,$s);
- if($x)
- {
- print "<center><font face='Tahoma' size='2'>[+] <b>.htpasswd</b> Created </center></font>";
- }
- }
- $htx = fopen('.htaccess','w');
- if($htx)
- {
- $xx = fwrite($htx, $b0x);
- if($xx)
- {
- print "<center><font face='Tahoma' size='2'>[+] <b>.htaccess</b> Created</font>";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement