Walks

网络安全爱好者

文件上传漏洞(个人总结)

前言:

一次对文件上传漏洞的总结,希望在学习知识的同时可以帮助到其他人。


目录:

0x01:前端验证

0x02:后端验证未严格化

0x03:解析漏洞

0x04:如何防护



前端验证

前端验证其实没必要多说,就是上传的时候上传文件的类型,后缀都是由前端JS验证的,而我们只要BurpSuite抓一下包就可以绕过客户端的这个验证。


后端验证未严格化

这主要产生在后端验证为黑名单,或者只验证了Content-Type : image/gif,又或者只是验证了文件头为GIF89a

当后端验证为黑名单时:我们可以找一下是否有文件后缀黑名单内未包括,但是解释器却把这个后缀解释为执行语言。(jsp jspx jspf asp asa cer aspx php php php3 php4 exe exee

只验证了Content-Type:这时我们只要修改Content-Type:image/gif即可。

只是验证了文件头:可以随意找一个图片文件,直接右键文本打开,然后写入一句话即可。


解析漏洞

Apache,IIS,Nginx

Apache:Apache识别文件的规则是从右向左,所以当我们上传一个名为xxx.php.bywalks的文件时,Apache无法识别bywalks这个文件后缀就往前识别,所以解释为php代码

IIS7.0/7.5:由于配置不当,IIS会把http://www.bywalks.com/123.jpg/123.php这种形式的当做php文件来解析。

Nginx:与IIS同理。


如何防护

1:后端验证需要严格。

2:要考虑到apache,iis,nginx这些中间件和windows,linux这些操作系统的特性。

3:上传后的文件名需要随机化


点赞
  1. nike huarache说道:

    A lot of thanks for all your valuable hard work on this web page. Gloria takes pleasure in engaging in investigations and it's obvious why. A lot of people know all about the compelling medium you provide important solutions through this web blog and as well inspire response from other ones on the matter plus my princess is in fact learning a great deal. Take advantage of the rest of the new year. You are carrying out a remarkable job.

  2. Thank you for your entire effort on this blog. My mum delights in working on internet research and it is simple to grasp why. My spouse and i notice all concerning the lively tactic you convey simple strategies on your blog and even encourage participation from people on the issue so our daughter is without question starting to learn so much. Take pleasure in the remaining portion of the new year. Your carrying out a great job.

  3. golden goose说道:

    I am also commenting to make you understand what a fine encounter my cousin's princess developed studying your web page. She discovered so many things, which included how it is like to have an ideal coaching character to get a number of people easily learn several extremely tough subject areas. You really exceeded our desires. I appreciate you for churning out such warm and friendly, dependable, educational and as well as unique tips about this topic to Ethel.

  4. My husband and i have been quite contented Emmanuel managed to conclude his basic research through the ideas he discovered through your site. It is now and again perplexing to just happen to be handing out things which usually others might have been making money from. And we do know we've got the website owner to thank because of that. The specific illustrations you've made, the easy site navigation, the relationships you assist to instill - it is all extraordinary, and it's really making our son and the family do think this subject is brilliant, and that's exceedingly mandatory. Thank you for the whole lot!

  5. lebron 15说道:

    I simply wanted to jot down a brief remark to be able to appreciate you for all of the great items you are writing on this website. My extensive internet research has now been honored with brilliant content to write about with my friends and classmates. I would claim that most of us visitors are very endowed to be in a very good community with very many marvellous individuals with very beneficial ideas. I feel pretty blessed to have encountered the web site and look forward to plenty of more entertaining moments reading here. Thank you again for a lot of things.

  6. I simply wished to thank you very much again. I am not sure what I could possibly have created in the absence of the actual pointers revealed by you on that field. Certainly was an absolute hard circumstance in my circumstances, but spending time with this specialized strategy you managed it forced me to leap over gladness. I'm just thankful for this advice and even hope you really know what a great job that you are getting into instructing many others via your blog post. More than likely you haven't come across any of us.

  7. tory burch shoes说道:

    Thanks a lot for providing individuals with such a memorable opportunity to read critical reviews from this website. It's usually very kind and as well , jam-packed with fun for me and my office mates to search your site at a minimum thrice weekly to find out the new tips you will have. Of course, I'm also actually fulfilled with your dazzling things you serve. Selected 3 points in this post are completely the most suitable I have ever had.

  8. air jordan 4说道:

    I am commenting to make you know of the great discovery my cousin's daughter undergone going through your web page. She even learned some things, most notably what it's like to have an awesome giving character to get men and women completely learn about some specialized matters. You truly did more than readers' desires. Thank you for imparting the warm and helpful, healthy, educational and in addition fun guidance on this topic to Julie.

  9. I just wanted to post a note to be able to appreciate you for all the awesome recommendations you are giving out at this site. My particularly long internet lookup has at the end been recognized with useful tips to talk about with my relatives. I would mention that most of us site visitors are really blessed to be in a perfect community with many awesome people with good plans. I feel really lucky to have encountered the web site and look forward to tons of more cool moments reading here. Thanks a lot once more for a lot of things.

  10. lacoste outlet说道:

    I simply had to say thanks yet again. I'm not certain what I would've carried out without the type of aspects discussed by you over such question. It was actually a fearsome difficulty in my view, but spending time with the very specialised way you resolved it made me to leap with joy. Extremely happy for your work and then pray you know what a great job you're getting into training some other people through the use of your site. Most probably you've never encountered all of us.

  11. My spouse and i got more than happy when Michael managed to finish off his investigation using the precious recommendations he was given in your site. It is now and again perplexing to just always be offering strategies that the rest may have been making money from. And we also already know we've got the website owner to appreciate for that. The type of illustrations you've made, the simple web site menu, the relationships you will help engender - it is mostly fabulous, and it is making our son and us feel that that concept is exciting, and that's wonderfully fundamental. Thanks for the whole lot!

  12. I really wanted to jot down a quick message so as to thank you for all the unique strategies you are showing here. My prolonged internet lookup has finally been recognized with reliable strategies to exchange with my co-workers. I would repeat that many of us site visitors actually are undoubtedly lucky to live in a great community with many outstanding people with very beneficial tips. I feel rather privileged to have come across the web site and look forward to many more fabulous times reading here. Thanks a lot once more for all the details.

  13. adidas nmd说道:

    I precisely wished to thank you so much once more. I do not know the things I would've tried without these smart ideas documented by you concerning this subject. Completely was a very difficult crisis for me, nevertheless discovering this well-written fashion you dealt with it took me to cry for gladness. I am just grateful for the information as well as have high hopes you are aware of a powerful job you're undertaking teaching many people thru your blog. Most probably you haven't met any of us.

  14. I wanted to write you this little bit of word to help give many thanks yet again for those nice tactics you have contributed in this article. It was quite seriously open-handed of people like you to provide unreservedly exactly what most of us could have advertised as an e book to get some cash for their own end, chiefly seeing that you might well have done it in case you wanted. Those concepts additionally worked like a fantastic way to know that other individuals have a similar passion similar to mine to learn way more around this issue. I am certain there are numerous more enjoyable situations up front for individuals that look over your website.

  15. A lot of thanks for every one of your effort on this website. Gloria delights in engaging in research and it's really easy to understand why. I learn all relating to the lively medium you render very important strategies by means of the web site and even cause participation from people on that point so our girl has been studying a lot of things. Enjoy the remaining portion of the year. You are always conducting a glorious job.

  16. kyrie 4说道:

    I needed to put you one little word to say thanks a lot once again about the pleasing suggestions you have provided at this time. This has been quite incredibly open-handed with people like you to provide unhampered all numerous people would've sold for an ebook to make some profit for themselves, most importantly seeing that you could possibly have done it if you ever wanted. These solutions also worked like a fantastic way to be sure that many people have a similar desire like mine to know the truth great deal more regarding this issue. I am sure there are a lot more pleasant situations in the future for folks who find out your blog.

  17. nike sneakers说道:

    I have to show thanks to this writer for bailing me out of this circumstance. As a result of browsing throughout the the web and getting advice which were not helpful, I believed my entire life was well over. Existing without the presence of strategies to the difficulties you've resolved through the site is a serious case, as well as those which might have adversely damaged my entire career if I had not noticed your web site. Your personal competence and kindness in maneuvering almost everything was vital. I don't know what I would've done if I hadn't discovered such a point like this. I am able to now relish my future. Thanks for your time very much for your professional and effective guide. I won't think twice to refer the blog to any individual who should have assistance about this issue.

  18. Needed to write you that very little remark in order to say thanks a lot again for the extraordinary pointers you've provided on this site. It is really pretty generous with you giving unreservedly precisely what many people might have offered for sale as an electronic book to end up making some cash on their own, certainly now that you could have done it if you ever desired. Those good ideas additionally acted as a great way to realize that someone else have the identical dream really like my own to know very much more when considering this matter. I am certain there are many more pleasurable instances ahead for many who view your website.

  19. nike react说道:

    Thanks for all of the effort on this website. Debby delights in managing internet research and it's really easy to see why. All of us learn all relating to the compelling manner you make insightful guidelines through the web blog and therefore recommend response from the others on the issue and our princess is always discovering a great deal. Take pleasure in the remaining portion of the new year. Your performing a powerful job.

  20. Thanks a lot for giving everyone a very wonderful chance to read from this blog. It is usually very nice and jam-packed with a great time for me personally and my office peers to visit your web site no less than 3 times per week to find out the latest stuff you will have. And definitely, we're usually fulfilled for the good secrets you give. Certain 2 points in this article are absolutely the most beneficial we've had.

  21. Thanks for your own hard work on this website. My mom takes pleasure in doing investigations and it's really easy to understand why. Almost all know all concerning the lively means you create both useful and interesting thoughts through this website and therefore inspire contribution from some other people about this concern plus our own daughter is certainly studying a lot of things. Take pleasure in the remaining portion of the new year. You are always carrying out a brilliant job.

  22. My husband and i got really contented that Chris could carry out his research from your ideas he discovered through your web site. It is now and again perplexing to simply always be making a gift of concepts others may have been trying to sell. So we remember we have the blog owner to give thanks to for that. The type of explanations you made, the simple blog menu, the friendships you will give support to foster - it's got mostly unbelievable, and it's really facilitating our son in addition to our family imagine that this concept is thrilling, which is really important. Thanks for the whole thing!

  23. air jordan 13说道:

    I and my pals ended up reading through the good guides from your web blog then at once got a horrible feeling I never thanked the web blog owner for those strategies. All of the women ended up certainly glad to read them and have in effect definitely been tapping into these things. We appreciate you really being simply thoughtful and then for making a choice on variety of remarkable topics millions of individuals are really wanting to be aware of. Our own sincere regret for not expressing appreciation to you sooner.

  24. yeezy boost说道:

    My wife and i have been quite more than happy that Jordan could conclude his studies with the ideas he received through your web pages. It is now and again perplexing just to always be giving for free solutions which people today could have been trying to sell. So we know we have got the blog owner to give thanks to for that. The entire illustrations you made, the straightforward web site menu, the relationships you will make it possible to foster - it's got everything powerful, and it's really letting our son in addition to our family do think the article is thrilling, which is certainly quite fundamental. Many thanks for all!

  25. michael kors说道:

    I intended to post you this bit of remark to help thank you so much the moment again for these spectacular pointers you've shown above. It is extremely generous with you to grant openly what exactly many individuals could have distributed for an electronic book to end up making some dough for themselves, mostly given that you might have tried it in the event you considered necessary. Those pointers in addition worked as a fantastic way to comprehend some people have a similar keenness just like my very own to know the truth very much more with regards to this matter. I'm certain there are many more enjoyable instances in the future for individuals that start reading your website.

  26. I would like to point out my admiration for your kind-heartedness for individuals that have the need for assistance with in this situation. Your special dedication to getting the message throughout appeared to be unbelievably functional and has always made others just like me to get to their dreams. Your amazing valuable guideline denotes so much a person like me and extremely more to my peers. Thanks a ton; from all of us.

  27. I am writing to make you know of the terrific encounter our girl went through visiting the blog. She even learned several things, including what it's like to possess an incredible helping spirit to make many others just thoroughly grasp specific extremely tough subject areas. You really did more than her expected results. Many thanks for giving these productive, healthy, revealing and easy thoughts on that topic to Gloria.

  28. I am also commenting to make you be aware of of the useful experience my cousin's child obtained going through your web site. She noticed numerous issues, including how it is like to have an amazing giving mood to make other people completely know various problematic issues. You undoubtedly exceeded my expected results. Thank you for showing the valuable, trusted, informative not to mention unique tips about that topic to Evelyn.

  29. curry 4说道:

    I needed to create you a very little observation to finally give many thanks yet again for your personal gorgeous knowledge you have provided on this page. It's certainly seriously generous of you in giving publicly what a few people would've advertised for an e book to earn some money on their own, especially considering that you might well have tried it if you decided. The inspiring ideas also served to become a fantastic way to realize that other people online have similar passion the same as mine to understand a great deal more pertaining to this matter. I am sure there are lots of more pleasurable situations in the future for many who view your blog post.

  30. I and also my guys have been going through the excellent suggestions from the blog and then got a terrible feeling I had not thanked the site owner for those secrets. My women were definitely for this reason stimulated to read through them and now have simply been taking pleasure in them. Many thanks for turning out to be well accommodating as well as for opting for some ideal information most people are really desirous to be informed on. My sincere regret for not saying thanks to you sooner.

  31. adidas yeezy说道:

    I have to show appreciation to the writer just for bailing me out of this incident. Just after searching through the world wide web and meeting tips which are not productive, I assumed my entire life was gone. Being alive minus the solutions to the difficulties you've sorted out by way of your posting is a serious case, and ones that could have badly damaged my entire career if I hadn't encountered your web page. Your personal understanding and kindness in touching a lot of things was invaluable. I don't know what I would've done if I had not come across such a point like this. I'm able to at this moment look ahead to my future. Thanks very much for your skilled and effective guide. I won't hesitate to recommend your web sites to anyone who will need guidance on this subject matter.

  32. I must point out my affection for your kindness supporting persons who need help on this important matter. Your real dedication to getting the message around became certainly helpful and has really empowered ladies like me to arrive at their dreams. Your entire helpful help signifies much a person like me and further more to my office colleagues. Warm regards; from each one of us.

  33. Thank you for every other helpful blog. Where altogether different could I purchase that type of information printed in a real excellent technique? I've a challenge i'm at the moment working on, so i are actually for the glimpse outside with regard to such information.. koleksi vlogger terbaru

  34. hermes bags说道:

    I simply wanted to say thanks yet again. I'm not certain what I would have made to happen without those thoughts shared by you concerning this industry. It became a fearsome case in my circumstances, nevertheless looking at the well-written approach you resolved it took me to leap for fulfillment. Extremely happy for this assistance and believe you recognize what a powerful job you are accomplishing training others all through your web page. I am sure you have never come across all of us.

  35. jordan retro说道:

    I not to mention my buddies were viewing the excellent recommendations located on your web site while all of the sudden I got a terrible feeling I never thanked the web site owner for those strategies. All of the boys are actually absolutely passionate to see all of them and already have very much been loving these things. We appreciate you turning out to be very considerate and for making a decision on this kind of perfect subject matter most people are really desirous to be informed on. My very own sincere apologies for not saying thanks to you earlier.

  36. adidas nmd说道:

    I in addition to my buddies were actually examining the good suggestions found on your website then unexpectedly developed a terrible suspicion I had not thanked the site owner for them. These boys became happy to read through all of them and have now in actuality been using them. Many thanks for truly being considerably helpful as well as for opting for this form of smart subjects most people are really desirous to learn about. My sincere regret for not expressing appreciation to earlier.

  37. I must express my affection for your generosity for persons that must have help on in this concept. Your special commitment to getting the solution all around became definitely advantageous and has surely permitted employees like me to achieve their goals. Your own warm and friendly guide indicates this much to me and much more to my colleagues. Thanks a lot; from each one of us.

  38. yeezy sneakers说道:

    I in addition to my pals ended up taking note of the excellent things located on your website then then developed an awful suspicion I had not thanked the blog owner for those secrets. Most of the boys were definitely for this reason happy to read all of them and already have clearly been taking advantage of these things. Thanks for genuinely well helpful as well as for using this form of ideal subjects millions of individuals are really needing to discover. My personal honest regret for not expressing gratitude to you earlier.

  39. Thank you a lot for giving everyone an extraordinarily splendid chance to discover important secrets from here. It is always very sweet plus jam-packed with amusement for me and my office colleagues to visit your website particularly 3 times per week to read the fresh issues you have got. Of course, I am also actually pleased considering the astounding secrets you give. Certain 2 ideas in this posting are absolutely the most effective we've ever had.

  40. cheap jordans说道:

    I wish to express appreciation to the writer just for bailing me out of such a difficulty. Right after searching through the world-wide-web and coming across methods which were not powerful, I was thinking my life was done. Being alive without the strategies to the issues you've resolved as a result of the short post is a critical case, and the kind that might have badly affected my career if I hadn't come across the blog. Your main natural talent and kindness in touching a lot of things was excellent. I am not sure what I would have done if I had not discovered such a thing like this. I can at this point relish my future. Thank you so much for this expert and results-oriented help. I will not think twice to suggest your web page to any person who needs to have tips on this matter.

  41. Your blog on ???????????????????????????????????? - Walks's Blog is awesome. We hope u can continue writing many lot blog . Be prosperous http://www.bywalks.com

  42. I want to point out my admiration for your kindness for those individuals that have the need for help with in this topic. Your very own dedication to getting the message across appeared to be certainly practical and has regularly made somebody much like me to attain their targets. Your entire important key points denotes much to me and even more to my colleagues. Best wishes; from everyone of us.

  43. Balenciaga UK说道:

    Jordan 12 Gym Red 2018http://www.jordan12gymred.us.com/
    Nike Outlet satorehttp://www.nikefactoryoutletstoreonline.com/
    nike factory outlethttp://www.nikefactoryoutletstoreonline.us/
    Nike Outlet satorehttp://www.nikestores.us.com/
    retro jordan 33http://www.jordan33.us/
    Yeezyshttp://www.cheapjerseysfromchina.us/
    custom nfl jerseyshttp://www.customnfljerseys.us/
    jordan 11 concord 2018http://www.jordan11concord.us.com/
    Jordan 12 Gym Red 2018http://www.jordan12gymred.us/
    Red Jordan 12http://www.redjordan12.us/
    Yeezyshttp://www.yeezy.com.co/
    Yeezyshttp://www.yeezys.us.com/
    Yeezy Shoeshttp://www.yeezysupply.us.com/
    Yeezy Boost 350http://www.yeezy-shoes.us.com/
    Yeezy Boost 350http://www.yeezy-boost350.com/
    Yeezy Boost 350http://www.yeezyboost350.us.com/
    Yeezy Shoeshttp://www.yeezybluetint.com/
    Yeezy 500http://www.yeezy500utilityblack.com/
    Yeezy 500http://www.yeezy500utilityblack.us/
    Nike Air VaporMaxhttp://www.vapor-max.org.uk/
    Salomonhttp://www.salomon-shoes.org.uk/
    Salomon Shoeshttp://www.salomons.me.uk/
    Salomon UKhttp://www.salomonspeedcross4.org.uk/
    Off White Jordan 1http://www.offwhitejordan1.com/
    Nike Air VaporMaxhttp://www.nikevapormax.org.uk/
    React Element 87http://www.nikereactelement87.us.com/
    Nike Element 87http://www.nikereactelement87.us/
    Nike Plushttp://www.nikeplus.us/
    Nike Outlet Storehttp://www.nike--outlet.us/
    Nike Outlet Storehttp://www.nikeoutletstoreonlineshopping.us/
    Nike Outlethttp://www.nikeoutletonlineshopping.us/
    NBA Jerseyshttp://www.nikenbajerseys.us/
    Air Max 97http://www.nikeairmax.us/
    Air Max Nikehttp://www.max2017.us/
    Jordan Shoeshttp://www.jordan-com.com/
    Jordan 11 Concordhttp://www.jordan11-concord.com/
    Cheap Yeezy Shoeshttp://www.cs7boots1.com/
    Wholesale Cheap NBA Jerseyshttp://www.cheapnba-jerseys.us/
    Birkenstock Sandals UKhttp://www.birkenstocksandalsuk.me.uk/
    NBA Jerseyshttp://www.basketball-jersey.us/
    Balenciagahttp://www.balenciaga.me.uk/
    Balenciaga UKhttp://www.balenciagauk.org.uk/
    Balenciaga UKhttp://www.balenciagatriples.org.uk/
    Balenciagahttp://www.birkenstocks.me.uk/
    Balenciaga Trainershttp://www.balenciagatrainers.org.uk/
    Nike Air Maxhttp://www.airmax270.org.uk/
    Adidas Yeezyshttp://www.adidasyeezyshoes.org.uk/
    Adidas Yeezyhttp://www.adidasyeezyshoes.org.uk/

  44. yeezy boost说道:

    I would like to show my love for your kindness in support of men who really want help with this particular concern. Your personal commitment to getting the solution around has been definitely helpful and has constantly permitted many people just like me to realize their ambitions. Your new warm and helpful hints and tips entails a whole lot a person like me and somewhat more to my mates. Thanks a ton; from everyone of us.

  45. That is definitely extremely appealing, You happen to be a great too much qualified writer. I have registered your rss and grow in place regarding seeking extra of this amazing write-up. In addition, We've distributed your internet-site around my internet sites

  46. adidas nmd说道:

    I wish to convey my admiration for your generosity supporting all those that really want help on this particular theme. Your special commitment to passing the solution along had been particularly valuable and has continuously allowed regular people just like me to achieve their ambitions. Your entire warm and friendly recommendations signifies so much a person like me and far more to my fellow workers. Thanks a ton; from all of us.

发表评论

电子邮件地址不会被公开。 必填项已用*标注