2010/04/16

Prevent php NULL byte or upload file security hole




====================================
-=[1]=- via .htaccess file
Put following in .htaccess and
put it in the appropriate directory
====================================
# Sample '.htaccess' file for 'pub' subdirectory

# Allow all access
Allow from all

# Deny people from looking at the index and running SSI and CGI
Options None

# If you have PHP4 or PHP5 installed make sure the directive
# below is enabled. If you do not have PHP installed you will
# need to comment out the directory below to avoid errors:
php_flag engine off

# If you have PHP3 installed make sure the directive below is
# enabled:
#php3_engine off

# This line will redefine the mime type for the most common
# types of scripts. It will also deliver HTML files as if they
# are text files:
AddType text/plain .html .htm .shtml .php .php3 .php5 .phtml .phtm .pl .py .cgi


===========================
-=[2]=- Via Directory directive
===========================


# Ignore .htaccess files
AllowOverride None

# Serve scripts as plaintext
AddType text/plain .html .htm .shtml .php .php3 .php5 .phtml .phtm .pl .py .cgi

# Don't run arbitrary PHP code.
php_admin_flag engine off



==========================
-=[3]=- Via Location directive
==========================


# Ignore .htaccess files
AllowOverride None

# Serve scripts as plaintext
AddType text/plain .html .htm .shtml .php .php3 .php5 .phtml .phtm .pl .py .cgi

# Don't run arbitrary PHP code.
php_admin_flag engine off

44 comments:

  1. Hi there! Nice material, do keep me posted when you post something like this again! I will visit this blog leaps and bounds for more quality posts like it. Thanks... Convert pdf to word

    ReplyDelete
  2. Hey, I am so thrilled I found your blog, I am here now and could just like to say thank for a tremendous post and all round interesting website. Please do keep up the great work. I cannot be without visiting your blog again and again. convert pdf to png

    ReplyDelete
  3. You re in point of fact a just right webmaster. The website loading speed is amazing. It kind of feels that you're doing any distinctive trick. Moreover, The contents are masterpiece. you have done a fantastic activity on this subject! https://www.miuiupdates.com/2021/05/sfilmywap.html

    ReplyDelete
  4. I am always looking for some free kinds of stuff over the internet. There are also some companies which give free samples. But after visiting your blog, I do not visit too many blogs. Thanks. 스포츠토토

    ReplyDelete
  5. I really like your writing style, great information, thankyou for posting. emotional support animal letter

    ReplyDelete
  6. Wonderful article. Fascinating to read. I love to read such an excellent article. Thanks! It has made my task more and extra easy. Keep rocking. Watergardens at Canberra

    ReplyDelete
  7. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. katmoviehd

    ReplyDelete
  8. Remarkable article, it is particularly useful! I quietly began in this, and I'm becoming more acquainted with it better! Delights, keep doing more and extra impressive! small capsule lift for home price in india

    ReplyDelete
  9. Your work is truly appreciated round the clock and the globe. It is incredibly a comprehensive and helpful blog. 안전놀이터

    ReplyDelete
  10. Thanks for providing recent updates regarding the concern, I look forward to read more. 88카

    ReplyDelete
  11. Liposuction should never be considered an alternative to a healthy lifestyle, it is one of the steps that can get you to a better version of yourself through fat reduction. go right here

    ReplyDelete
  12. RSJ is at the top of our game when it comes to tax-minimization strategies for asset growth, protection and transfer. We have always known that something was missing from traditional estate planning for high-net-worth families. Our site

    ReplyDelete
  13. Mecanica is built on more than thirty years of cumulative, professional experience of its principals. Having worked in the industry with major fleet and manufacturing companies with operations worldwide, Mecanica provides its clients the highest caliber of service. special info

    ReplyDelete
  14. Sports wagering can definitely provide extreme fun and excitement to those passionate about sports as well as the serious bettors finding a way to make smart money. Before one embarks on sports betting, it would be wise to understand the basic of sports betting. 먹튀검증

    ReplyDelete
  15. Very efficiently written information. It will be beneficial to anybody who utilizes it, including me. Keep up the good work. For sure i will check out more posts. This site seems to get a good amount of visitors. https://www.toryburchoutlet.org/

    ReplyDelete
  16. I have read your article couple of times because your views are on my own for the most part. It is great content for every reader. https://yesmovies.agency

    ReplyDelete
  17. Nice post. I was checking constantly this blog and I’m impressed! Extremely useful info specially the last part I care for such information a lot. I was seeking this certain info for a long time. Thank you and good luck. https://gomovies.group

    ReplyDelete
  18. Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include. https://solar-movies.one

    ReplyDelete
  19. I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. https://movieninja.live

    ReplyDelete
  20. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. https://primewirewebsite.site

    ReplyDelete
  21. Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon! https://la-123movies.one

    ReplyDelete
  22. The way you write, you are really a professional blogger. Cbd near me

    ReplyDelete
  23. The way you write, you are really a professional blogger. newprimewire

    ReplyDelete
  24. The website is looking bit flashy and it catches the visitors eyes. Design is pretty simple and a good user friendly interface. https://sites.google.com/view/buy-twitch-followers/

    ReplyDelete
  25. This is such an awesome asset, to the point that you are giving and you give it away for nothing.our article has piqued a lot of positive interest. raglan varsity jacket

    ReplyDelete
  26. The way you write, you are really a professional blogger. protechrise.com

    ReplyDelete
  27. Thanks for the best blog. it was very useful for me.keep sharing such ideas in the future as well. exactprinto.com

    ReplyDelete
  28. Regularly I tend not to make comments on websites, however I will need to point out that this blog post genuinely compelled me to take some action. Quite notable content. 스포츠중계

    ReplyDelete
  29. Regularly I tend not to make comments on websites, however I will need to point out that this blog post genuinely compelled me to take some action. Quite notable content. Wholesale Caluanie Mulear Oxide online usa

    ReplyDelete
  30. I respect this article for the very much investigated substance and magnificent wording. I got so included in this material that I couldn't quit perusing. I am awed with your work and aptitude. Much obliged to you to such an extent.Dermaroller 192 Micro Needle 0.75 mm

    ReplyDelete
  31. I think this is an informative post and it is very beneficial and knowledgeable. Therefore, I would like to thank you for the endeavors that you have made in writing this article. All the content is absolutely well-researched. Thanks. Taxi in Airdrie

    ReplyDelete
  32. Everything has its value. Thanks for sharing this informative information with us. GOOD works! start a credit card processing business

    ReplyDelete
  33. I understand this column. I realize You put a many of struggle to found this story. I admire your process. 사이트추천

    ReplyDelete
  34. Excellent read, I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch because I found it for him smile So let me rephrase that. Airdrie Cab

    ReplyDelete
  35. You have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you. North American Bancard ISO

    ReplyDelete
  36. Whenever I have some free time, I visit blogs to get some useful info. Today, I found your blog with the help of Google. Believe me; I found it one of the most informative blog. Selling Payment Processing

    ReplyDelete
  37. You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! crossfit necklace

    ReplyDelete
  38. i was just browsing along and came upon your blog. just wanted to say good blog and this article really helped me. new internet device

    ReplyDelete
  39. Mori Condo at Guillemard / Jalan Molek By Roxy-Pacific. Get Price, Brochure, Floor Plan, Price List & More. Hotline 61006226 Dentitox pro review

    ReplyDelete
  40. This content is written very well. Your use of formatting when making your points makes your observations very clear and easy to understand. Thank you. vidalista 40

    ReplyDelete
  41. This is actually the kind of information I have been trying to find. Thank you for writing this information. detectives infidelidades

    ReplyDelete
  42. Wow, What an Outstanding post. I found this too much informatics. It is what I was seeking for. I would like to recommend you that please keep sharing such type of info.If possible, Thanks. golden revive plus reviews

    ReplyDelete
  43. CapCut mod apk offers an excellent video editing experience with its user-friendly interface features. The mod version provides access to premium features for free, making it a great option for content creators looking to edit their videos on a budget. Highly recommended!. It's an Video Editor: For Android.

    ReplyDelete
  44. RealX Legacy is a fully compatible: MIUI theme that works just awesome on all Xiaomi Redmi and Poco devices.

    ReplyDelete