我已经实现了一个透明的 squid3 代理用于日志记录。
我不会进行 SSL 碰撞/HTTPS 解密,因为这对于在每个客户端上安装证书来说太多了。
但是,我想记录CONNECT传递给鱿鱼的URL 数据。出于某种原因,它甚至不会在 HTTPS 请求中记录根域,而这些请求肯定会命中鱿鱼。
有没有办法做到这一点?
我的/squid.conf:
http_port 192.168.15.225:3128
http_port 127.0.0.1:3128 intercept
icp_port 0
dns_v4_first off
pid_filename /var/run/squid/squid.pid
cache_effective_user squid
cache_effective_group proxy
error_default_language en
icon_directory /usr/local/etc/squid/icons
visible_hostname localhost
cache_mgr admin@localhost
logformat squid %ts.%03tu %tr %>a %>eui %>Hs %<st %rm %ru %un %<A %mt
access_log /var/squid/logs/access.mac.log squid
cache_log /var/squid/logs/cache.log
cache_store_log none
netdb_filename /var/squid/logs/netdb.state
pinger_enable on
pinger_program /usr/local/libexec/squid/pinger
logfile_rotate 0
debug_options rotate=0
shutdown_lifetime 3 seconds
acl localnet src 10.10.10.0/24 192.168.15.0/24
forwarded_for on
uri_whitespace strip
acl dynamic urlpath_regex cgi-bin \?
cache deny dynamic
cache_mem 64 MB
maximum_object_size_in_memory 256 KB
memory_replacement_policy heap GDSF
cache_replacement_policy heap LFUDA
minimum_object_size 0 KB
maximum_object_size 4 MB
cache_dir ufs /var/squid/cache 100 16 256
offline_mode off
cache_swap_low 90
cache_swap_high 95
cache allow all
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
acl allsrc src all
acl safeports port 21 70 80 210 280 443 488 563 591 631 777 901 3128 3129 1025-65535
acl sslports port 443 563
acl purge method PURGE
acl connect method CONNECT
acl HTTP proto HTTP
acl HTTPS proto HTTPS
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !safeports
http_access deny CONNECT !sslports
request_body_max_size 0 KB
delay_pools 1
delay_class 1 2
delay_parameters 1 -1/-1 -1/-1
delay_initial_bucket_level 100
delay_access 1 allow allsrc
http_access allow localnet
http_access deny allsrc
Run Code Online (Sandbox Code Playgroud)
您不能CONNECT在透明缓存上记录请求。如果您的浏览器已配置为代理,则连接请求只会发送到鱿鱼服务器。如果浏览器未配置为使用 squid 作为代理,它将尝试直接与目标协商 TLS 连接。
如果您重定向了该 TLS 连接,您要么需要 SSLBUMP,要么在浏览器中出现错误。
但是假设您将浏览器配置为使用鱿鱼。 你不会得到 URL。您将看到的只是托管网站的系统的 FQDN。URL 是 http 请求的一部分,在建立 TLS 连接后才会发送。
出于某种原因,它甚至不会在 HTTPS 请求中记录根域,而这些请求肯定会命中鱿鱼。
他们没有打鱿鱼。就像我上面说的,它根本不能那样工作。除非您的浏览器配置为使用代理,否则不会使用 CONNECT,并且您似乎声称已设置为透明代理。这几乎肯定意味着您的操作系统只是像任何其他流量一样路由请求。
| 归档时间: |
|
| 查看次数: |
3590 次 |
| 最近记录: |