
Filechucker filter bypass Proof Of Concept
在 filechucker.cgi 5.09 版本和 filechucker_prefs.cgi 4.99e-free-e02 版本中,存在一个过滤器绕过漏洞,在上传时,如果用户上传恶意文件,可能导致远程代码执行。
当 filechucker 尝试过滤文件扩展名并与 filechucker_prefs 的不允许扩展名配置进行比对时,就会发生绕过:
$PREF{only_allow_these_file_extensions} = '';
$PREF{disallow_these_file_extensions} = '.exe .php .php3 .php4 .php5 .phtml .cgi .pl .sh .py .js .htaccess .htpasswd .cmd .bat .ftpquota';
$PREF{allow_files_without_extensions} = 'yes';
$PREF{disallow_these_strings_within_filenames} = '\.php \.asp \.cgi \.pl$ \.plx torrent dvdrip'; # can include regexes, so periods must be escaped. must be in single quotes.#
以上是首次下载时的默认配置。如您所见,某些文件扩展名是不允许的。当您在文件名后附加以下三种内容之一时,就会发生绕过:
.%%<EXT>.%<EX>%<T>%2E.%<EXT>第一种和第三种 并不总是有效,第二种几乎保证能成功。例如,如果我们有文件名 491f21bfbe8fc71eafc9ed76565b0bb4.%ph%p,经过上述过滤后,该文件名将被上传为 491f21bfbe8fc71eafc9ed76565b0bb4.php。
有几个 Google dorks 可以帮助您找到 filechucker.cgi 文件。
inurl:filechucker.cgiinurl:/cgi-bin/filechucker以下视频是在 encodables 网站(演示版)上录制的概念验证: