How to hide X Server Values

Oğuz~#>

Kıdemli Üye
5 Tem 2009
4,772
17
Bursa
X header information is included by default in several internet technologies. The header sends information to the browser, including information about the web services running. Many types of X-* headers are no threat to your security. The most common security related X header is the X-Powered-By header. Check the notes for each URL after a scan to see if this is in fact the X message you are seeing.
What are X Header values?

X header information is included by default in several internet technologies. The header sends information to the browser, including information about the web services running. Many types of X-* headers are no threat to your security. The most common security related X header is the X-Powered-By header. Check the notes for each URL after a scan to see if this is in fact the X message you are seeing.
The X-Powered-By header reveals information based on your version of PHP. Similar to other low-risk security vulnerabilities related to software version, this reveals data to an attacker or automated process which can be used to launch attacks known to work for your specific version. Removing this information decreases the likelihood of such attacks.
Another common header is the X-Pingback header used in many WordPress installations. This is an example of a header with no security implications, and can be safely ignored. There are many X-* headers around, and each result should be looked at to see if it relates version information about the site.

Why Should I Hide these Headers?

A dedicated attacker can find out this information in a variety of ways, most of which cannot be easily prevented. By itself, this information provides little value to an attacker.
The most common use of this kind of information is automated attacks which search on Google for specific configurations known to be vulnerable, or to automate attacks known to work against setups similar to what is found on the site. Removing these values form the server header will prevent these types of automated attacks from occurring.

Solutions - How to Disable X Headers

Although it is not necessarily possible to completely prevent this knowledge from being discovered, it is possible to make it significantly more difficult for attackers. The most commonly seen X header which we want to remove is the X-Powered-By header from PHP. Here is how to remove it.

  1. Navigate to your php.ini file. This is often located in /etc/php.ini or /usr/bin/php/php.ini
  2. If it is not here, you can try a locate command on Unix, or execute a phpinfo() within PHP to see the directory.
  3. Open the file using a text editor. On Unix systems, the most common one is vi (command: vi php.ini)
  4. Find the line including expose_php (if using vi, you can find this quickly by typing in /expose_php)
  5. Update it so that expose_php is set to off - expose_php = off
  6. Restart Apache (or other web server). For apache, this is generally httpd restart

Additional Resources

Apache Tips & Tricks: Hide PHP version (X-Powered-By)
 
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.