Breaking File Upload Filters with Trailing Dots or Spaces
攻击者利用Windows系统对文件名末尾的点或空格处理特性,上传恶意文件绕过扩展名验证。例如,将恶意文件命名为shell.php.后上传,系统会自动去除末尾的点并保存为shell.php,从而成功上传恶意代码。 2025-7-16 10:30:40 Author: infosecwriteups.com(查看原文) 阅读量:16 收藏

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--bug_bounty
如有侵权请联系:admin#unsafe.sh