mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
HTTP CONNECT proxy support.
- The HTTP analyzer now supports handling HTTP CONNECT proxies same as the SOCKS analyzer handles proxying.
This commit is contained in:
parent
f45bd84f4c
commit
dd0856a57f
10 changed files with 102 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
@load base/utils/numbers
|
||||
@load base/utils/files
|
||||
@load base/frameworks/tunnels
|
||||
|
||||
module HTTP;
|
||||
|
||||
|
@ -217,6 +218,16 @@ event http_reply(c: connection, version: string, code: count, reason: string) &p
|
|||
c$http$info_code = code;
|
||||
c$http$info_msg = reason;
|
||||
}
|
||||
|
||||
if ( c$http?$method && c$http$method == "CONNECT" && code == 200 )
|
||||
{
|
||||
# Copy this conn_id and set the orig_p to zero because in the case of CONNECT proxies there will
|
||||
# be potentially many source ports since a new proxy connection is established for each
|
||||
# proxied connection. We treat this as a singular "tunnel".
|
||||
local tid = copy(c$id);
|
||||
tid$orig_p = 0/tcp;
|
||||
Tunnel::register([$cid=tid, $tunnel_type=Tunnel::HTTP]);
|
||||
}
|
||||
}
|
||||
|
||||
event http_header(c: connection, is_orig: bool, name: string, value: string) &priority=5
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue