我在 Linux 机器上运行了启用了网关的 CNTLM。同一网络上的许多其他机器都配置为使用此代理。
我在 Ubuntu 中搜索cntlm.log
但找不到这样的文件。
我怎样才能看到通过 CNTLM 的所有请求的日志(拦截请求)?
答案1
如果您在启动时将 cntlm 作为系统服务启动,您可以调用sudo service cntlm status
来查看当前状态并查看最后十条连接消息,它们看起来应该像这样:
sschneid@sschneidschnee ~ $ sudo service cntlm status
● cntlm.service - LSB: Authenticating HTTP accelerator for NTLM secured proxies
Loaded: loaded (/etc/init.d/cntlm; bad; vendor preset: enabled)
Active: active (running) since Mi 2018-04-04 08:29:25 CEST; 2h 7min ago
Docs: man:systemd-sysv-generator(8)
Process: 1483 ExecStart=/etc/init.d/cntlm start (code=exited, status=0/SUCCESS)
Tasks: 11
Memory: 3.1M
CPU: 1.670s
CGroup: /system.slice/cntlm.service
└─1620 /usr/sbin/cntlm -U cntlm -P /var/run/cntlm/cntlm.pid
Apr 04 10:35:06 M0024 cntlm[1620]: 127.0.0.1 CONNECT media-cdn.ubuntu-de.org:443
Apr 04 10:35:06 M0024 cntlm[1620]: 127.0.0.1 CONNECT media-cdn.ubuntu-de.org:443
Apr 04 10:35:06 M0024 cntlm[1620]: 127.0.0.1 CONNECT media-cdn.ubuntu-de.org:443
Apr 04 10:36:18 M0024 cntlm[1620]: 127.0.0.1 CONNECT krebsonsecurity.com:443
Apr 04 10:36:19 M0024 cntlm[1620]: 127.0.0.1 CONNECT www.youtube.com:443
Apr 04 10:36:20 M0024 cntlm[1620]: 127.0.0.1 CONNECT www.google.com:443
Apr 04 10:36:21 M0024 cntlm[1620]: 127.0.0.1 CONNECT i.ytimg.com:443
Apr 04 10:36:21 M0024 cntlm[1620]: 127.0.0.1 POST http://ocsp.pki.goog/GTSGIAG3
Apr 04 10:36:33 M0024 cntlm[1620]: 127.0.0.1 CONNECT tiles.services.mozilla.com:443
Apr 04 10:36:34 M0024 cntlm[1620]: 127.0.0.1 CONNECT img-getpocket.cdn.mozilla.net:443
通常,CNTLM 会记录到 SYSLOG,因此这将是搜索记录信息的另一个位置。
答案2
此外 @施奈德您可以使用以下答案journalctl
并按单位进行过滤-u
:
[14:15:16][root@host]:~# journalctl -u cntlm.service
-- Logs begin at Fri 2018-06-22 13:42:39 CEST, end at Fri 2018-06-29 13:20:30 CEST. --
Jun 28 14:07:08 host.example.com systemd[1]: Starting CNTLM HTTP Accelerator For NTLM Secured Proxies Authenticator...
Jun 28 14:07:08 host.example.com systemd[1]: Started CNTLM HTTP Accelerator For NTLM Secured Proxies Authenticator.
Jun 28 14:07:08 host.example.com cntlm[45762]: Daemon ready
Jun 28 14:07:08 host.example.com cntlm[45762]: Changing uid:gid to 1000:1000 - Success
Jun 28 14:08:32 host.example.com cntlm[45762]: Using proxy proxy.example.com:8080
Jun 28 14:09:37 host.example.com cntlm[45762]: 127.0.0.1 GET http://www.example.com/
Jun 28 14:09:37 host.example.com cntlm[45762]: 127.0.0.1 CONNECT www.example.com:80
Jun 28 14:10:10 host.example.com systemd[1]: Stopping CNTLM HTTP Accelerator For NTLM Secured Proxies Authenticator...
Jun 28 14:10:10 host.example.com systemd[1]: Stopped CNTLM HTTP Accelerator For NTLM Secured Proxies Authenticator.