This article is a mirror article of machine translation, please click here to jump to the original article.

View: 53942|Reply: 8

[Tips] C# determines whether the uploaded file is an image and prevents Trojan horse uploads

[Copy link]
Posted on 3/14/2019 5:26:59 PM | | |
Method 1: Use the image object to determine whether it is an image

Method 2: Judge the file header

It is said that method 2 is effective for conventional modification of Trojans, that is, directly modifying the extension, such as changing the .asp to .jpg. But it doesn't work for the kind of Trojan that is generated. I recommend everyone to use the first one.




Previous:The software cannot be used after recharging
Next:. Net memory overflow (System.OutOfMemoryException).
 Landlord| Posted on 3/14/2019 9:53:46 PM |


That's it. After verifying the header information of the file, of course, the production of the Trojan horse can also add the header information and still upload successfully, at this time it should be necessary for our server to control the permission to upload the file.


 Landlord| Posted on 3/21/2019 3:11:18 PM |
Posted on 7/17/2021 2:44:46 PM |
WeChat share link with small pictures to see
Posted on 1/24/2022 11:27:37 AM |
learned
Posted on 2/7/2022 9:05:09 AM |
Thank you for sharing and learning
Posted on 2/7/2022 10:00:51 AM |
Learn it, thank you
Posted on 9/13/2022 4:40:28 PM |
Learn to learn
Posted on 2/28/2023 12:33:09 PM |
Take a look, thank you for sharing
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com