X
X
XenK2015-06-16 20:26:52
PHP
XenK, 2015-06-16 20:26:52

Shell via upload form?

The site has a form that uploads files with the .pdf extension to the hosting. Can an unscrupulous person upload a shell using this form?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Optimus, 2015-06-16
Pyan @marrk2

1. Forbid the execution of files in this folder (disable php execution, etc.)
2. Check not only the extension but also the mime-type
Then you are safe ;)

C
Chvalov, 2015-06-16
@Chvalov

Prohibit execution of scripts in the directory where *.pdf files are stored.
For Apache, this can be done simply
with .htaccess

php_flag engine 0
AddType "text/html" .php .cgi .pl .fcgi .fpl .phtml .shtml .php2 .php3 .php4 .php5 .asp .jsp

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question