mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Fix host header normalization in intel framework.
The way we were splitting off ports from host names could fail for IPv6 addresses. Closes #1844.
This commit is contained in:
parent
a7427e95bf
commit
07045ec254
1 changed files with 2 additions and 2 deletions
|
@ -9,8 +9,8 @@ event http_header(c: connection, is_orig: bool, name: string, value: string)
|
||||||
switch ( name )
|
switch ( name )
|
||||||
{
|
{
|
||||||
case "HOST":
|
case "HOST":
|
||||||
# The split is done to remove the occasional port value that shows up here (see also base script)
|
# Remove the occasional port value that shows up here.
|
||||||
local host = split_string1(value, /:/)[0];
|
local host = gsub(value, /:[[:digit:]]+$/, "");
|
||||||
if ( is_valid_ip(host) )
|
if ( is_valid_ip(host) )
|
||||||
Intel::seen([$host=to_addr(host),
|
Intel::seen([$host=to_addr(host),
|
||||||
$indicator_type=Intel::ADDR,
|
$indicator_type=Intel::ADDR,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue