Breaking File Upload Filters with Trailing Dots or Spaces
利用文件名末尾的点或空格绕过Windows服务器的文件上传验证机制,操作系统自动去除这些字符后导致恶意脚本成功上传。 2025-7-16 10:30:40 Author: infosecwriteups.com(查看原文) 阅读量:12 收藏

Bypassing Extension Validation to Upload Malicious Files on Windows Servers

Monika sharma

File upload features are everywhere — profile picture uploads, document attachments, media managers.

Now imagine you upload a file called shell.php. and the system lets it through, even though .php files are supposed to be blocked.

Why? Because of a sneaky trick involving trailing dots and spaces.

On Windows systems, a filename like shell.php. (with a dot at the end) gets saved as shell.php. The trailing dot is silently removed by the operating system. That means the app might think it’s a harmless file — but you just uploaded a real .php script.

In this article, we’ll explore how this bypass works, how to find it, and how to exploit it effectively. Perfect for beginners diving into bug bounty or application pentesting!

Why This Works: The OS is Helping You (as an Attacker)

On Windows (NTFS) file systems:

  • A filename like shell.php. is saved as shell.php

shell.jpg becomes shell.jpg

  • The trailing dot (.) or space ( )

文章来源: https://infosecwriteups.com/breaking-file-upload-filters-with-trailing-dots-or-spaces-b0b1d118eaf5?source=rss----7b722bfd1b8d---4
如有侵权请联系:admin#unsafe.sh