
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로 업로드됩니다.
filechucker.cgi 파일을 찾을 수 있는 몇 가지 Google dork가 있습니다.
inurl:filechucker.cgiinurl:/cgi-bin/filechucker아래 동영상은 encodables 웹사이트(데모)에서 촬영한 개념 증명입니다: