컴퓨터.IT/우분투(ubuntu)
우분투(Ubuntu) 디렉토리 리스팅(Directory Traversal) 막기
www.woobi.org
2019. 3. 19. 09:43
디렉토리 리스팅은 서버내의 디렉토리 경로를 입력하면 디렉토리내의 파일을 모두 보여준다.
이를 방지하기 위해서 우분투에서 다음과 같이 수정해주면 어느정도는 방지할 수 있다.
우분투의 /etc/apache2/apache2.conf 의 파일을 수정해 준다.
$ vi /etc/apache2/apache2.conf |
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
위 항목에서 Indexes를 삭제하고 저장해 준다. (:wq)
수정후
<Directory /var/www/>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
그리고
$ /etc/init.d/apache2 restart |
아파치를 재시작해준다.