Skip to content

Commit

Permalink
Added DNS resolved addresses in flow details (live traffic)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaderi committed Oct 31, 2024
1 parent ddd1c57 commit f9f78b6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 11 additions & 1 deletion scripts/lua/flow_details.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1699,14 +1699,24 @@ else
end

historicalProtoHostHref(ifid, flow["cli.ip"], flow["proto.l4"], flow["proto.ndpi_id"],
page_utils.safe_html(flow["protos.dns.last_query"] or ''))
page_utils.safe_html(flow["protos.dns.last_query"] or ''))

if (flow["category"] ~= nil) then
print(" " .. getCategoryIcon(flow["protos.dns.last_query"], flow["category"]))
end

printAddCustomHostRule(flow["protos.dns.last_query"])

if(flow["protos.dns.last_rsp"] ~= nil) then
local ips = split(flow["protos.dns.last_rsp"], ",")

-- print("<p>".. i18n("response") ..":<ul>")
for id = 1, #ips do
print("<li>"..ips[id].."</li>\n")
end
print("</ul>")
end

print("</td></tr>\n")
end

Expand Down
6 changes: 4 additions & 2 deletions src/Flow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7734,9 +7734,11 @@ void Flow::lua_get_dns_info(lua_State *vm) const {
lua_push_str_table_entry(vm, "protos.dns.last_query",
protos.dns.last_query);

if(protos.dns.last_rsp)
lua_push_str_table_entry(vm, "protos.dns.last_rsp", protos.dns.last_rsp);

if (hasInvalidDNSQueryChars())
lua_push_bool_table_entry(vm, "protos.dns.invalid_chars_in_query",
true);
lua_push_bool_table_entry(vm, "protos.dns.invalid_chars_in_query", true);
}
}
}
Expand Down

0 comments on commit f9f78b6

Please sign in to comment.