2017-04-17 91 views
0

在我的虛擬主機文件,我已經讓所有的主機主機頭攻擊漏洞

<VirtualHost *:80> 
DocumentRoot "C:/xampp/htdocs" 
ServerName localhost 
</VirtualHost> 

<VirtualHost *:80> 
DocumentRoot "C:/xampp/htdocs/example" 
ServerName example.dev 
ServerAlias www.example.dev 
<Directory "c:/xampp/htdocs/example"> 
Order allow,deny 
Allow from all 
</Directory> 

</VirtualHost> 

<VirtualHost *:80> 
DocumentRoot "C:/xampp/htdocs/example" 
ServerName example.dev 
ServerAlias www.example.dev 
<Directory "c:/xampp/htdocs/example"> 
AllowOverride All 
Require all Granted 
</Directory> 
</VirtualHost> 

,當我打了飽嗝軟件請求的URL www.example.dev會顯示類似下面 enter image description here

更改主機名

enter image description here

其顯示的響應

enter image description here

我想,如果有人試圖改變主機的名稱,然後它會重定向到錯誤信息頁面

+1

我不明白你爲什麼需要這個?網絡服務器將讀取主機,並檢查它是否是其知道如何服務的虛擬主機之一,如果不是,將使用默認主機進行響應。如果需要,您可以將默認主機設置爲404頁面。 – apokryfos

+0

我需要這個,因爲雖然審計,安全的人給我這個漏洞解決這個其他明智有安全問題 –

+0

你能告訴我如何解決這個如果任何人改變主機之間的請求,那麼它應該重定向到錯誤頁面 –

回答

0

這也正是我的問題,推薦的解決方案是將HTTP_HOST更改爲SERVER_NAME,但尚未解決問題。