代理服务器泄露客户ip和服务器信息的解决

发表于:2007-07-04来源:作者:点击数: 标签:
HTTP_X_FORWARDED_FOR , HTTP_VIA , IP 在局域网通过透明代理访问外部的web 服务器 时, 在web服务器端, 通过header HTTP_X_FORWARDED_FOR 可以知道代理服务器的服务器名以及端口, 通过 HTTP_VIA 可以知道客户的内部ip,这会带来一些 安全 问题,并且某些论坛会

HTTP_X_FORWARDED_FOR , HTTP_VIA , IP

在局域网通过透明代理访问外部的web服务器时,
在web服务器端,
通过header  HTTP_X_FORWARDED_FOR 可以知道代理服务器的服务器名以及端口,
通过HTTP_VIA可以知道客户的内部ip,这会带来一些安全问题,并且某些论坛会发现用的是代理访问,怎么让squid隐藏这些信息呢.
通过研究squid的源代码,发现在/etc/squid/squid.conf中添加2行:
       header_aclearcase/" target="_blank" >ccess Via deny all
       header_access X-Forwarded-For deny all
就可以把它关闭

要去掉其他的header,也可以照此操作:

 

AcceptHTTP_ACCEPT
Accept-CharsetHTTP_ACCEPT-CHARSET
Accept-EncodingHTTP_ACCEPT-ENCODING
Accept-LanguageHTTP_ACCEPT-LANGUAGE
Accept-RangesHTTP_ACCEPT-RANGES
AgeHTTP_AGE
AllowHTTP_ALLOW
AuthorizationHTTP_AUTHORIZATION
Cache-ControlHTTP_CACHE-CONTROL
ConnectionHTTP_CONNECTION
Content-BaseHTTP_CONTENT-BASE
Content-DispositionHTTP_CONTENT-DISPOSITION
Content-EncodingHTTP_CONTENT-ENCODING
Content-LanguageHTTP_CONTENT-LANGUAGE
Content-LengthHTTP_CONTENT-LENGTH
Content-LocationHTTP_CONTENT-LOCATION
Content-MD5HTTP_CONTENT-MD5
Content-RangeHTTP_CONTENT-RANGE
Content-TypeHTTP_CONTENT-TYPE
CookieHTTP_COOKIE
DateHTTP_DATE
ETagHTTP_ETAG
ExpiresHTTP_EXPIRES
FromHTTP_FROM
HostHTTP_HOST
If-MatchHTTP_IF-MATCH
If-Modified-SinceHTTP_IF-MODIFIED-SINCE
If-None-MatchHTTP_IF-NONE-MATCH
If-RangeHTTP_IF-RANGE
Last-ModifiedHTTP_LAST-MODIFIED
LinkHTTP_LINK
LocationHTTP_LOCATION
Max-ForwardsHTTP_MAX-FORWARDS
Mime-VersionHTTP_MIME-VERSION
PragmaHTTP_PRAGMA
Proxy-AuthenticateHTTP_PROXY-AUTHENTICATE
Proxy-Authentication-InfoHTTP_PROXY-AUTHENTICATION-INFO
Proxy-AuthorizationHTTP_PROXY-AUTHORIZATION
Proxy-ConnectionHTTP_PROXY-CONNECTION
PublicHTTP_PUBLIC
RangeHTTP_RANGE
RefererHTTP_REFERER
Request-RangeHTTP_REQUEST-RANGE
Retry-AfterHTTP_RETRY-AFTER
ServerHTTP_SERVER
Set-CookieHTTP_SET-COOKIE
TitleHTTP_TITLE
Transfer-EncodingHTTP_TRANSFER-ENCODING
UpgradeHTTP_UPGRADE
User-AgentHTTP_USER-AGENT
VaryHTTP_VARY
ViaHTTP_VIA
WarningHTTP_WARNING
WWW-AuthenticateHTTP_WWW-AUTHENTICATE
Authentication-InfoHTTP_AUTHENTICATION-INFO
X-CacheHTTP_X-CACHE
X-Cache-LookupHTTP_X-CACHE-LOOKUP
X-Forwarded-ForHTTP_X-FORWARDED-FOR
X-Request-URIHTTP_X-REQUEST-URI
X-Squid-ErrorHTTP_X-SQUID-ERROR
NegotiateHTTP_NEGOTIATE
X-Accelerator-VaryHTTP_X-ACCELERATOR-VARY
Other:HTTP_OTHER:

原文转自:http://www.ltesting.net