大网数据广告活动
服务器运维问答

Linux HTTPS Header inspection

· 52CE 我爱测

I need to inspect a part of the HTTPS traffic passing through my Linux (CentOS 6.5) router. In particular I need to know which destination web site host is being requested by the user. The user can be a guest browser / device ove…

问题原文

原帖链接 · Dominik · CC BY-SA 3.0

I need to inspect a part of the HTTPS traffic passing through my Linux (CentOS 6.5) router. In particular I need to know which destination web site host is being requested by the user. The user can be a guest browser / device over which I have no control (i.e. can't deploy certificates). I don't care about the contents / payload, I just need to log the destination URL into a log file :-)

It's open in terms of technology, I'm not limited and can therefore use iptables, squid, or any other filter that runs on Linux (preferably not a commercial one - some of those are licensed by device). Or even a combination of the above.

I am pretty sure this can be done because if I can install Fiddler on my windows machine and browse HTTPS web sites using Chrome without certificate warnings and see the "host" in Fiddler.

I have spent some time searching to see how this can be done, but so far have hit limitations with certificates needing to be installed on client browsers. That, and I could only find string matching for iptables but from what I understand that won't work with HTTPS packets as they are encrypted (I wrongly thought that the destination would not be encrypted ?)

Any help with this would be appreciated, hope I've covered the requirements in enough details.

已采纳解答

原帖链接 · Dominik R · CC BY-SA 3.0

  1. Capture and cache DNS queries made by your users. Then you can match that with the IPs of outgoing port 443 connections
  2. tshark. You should be able to get SNI out of it somehow
  3. Google "p0f ssl". You can get the user-agent with this.

Please post if you get somethin running, am also interested in such a thing

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-01-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。