Revamped host categorization and moved to Google Safe Browsing for detecting safe and malware sites

This commit is contained in:
Luca Deri 2015-05-27 17:58:26 +02:00
parent 258aa76714
commit e2b04d128f
15 changed files with 192 additions and 423 deletions

View file

@ -330,10 +330,6 @@ for key, value in pairs(flows_stats) do
else
vkey = postfix
end
elseif(sortColumn == "column_category") then
c = flows_stats[key]["category"]
if(c == nil) then c = "" end
vkey = c..postfix
elseif(sortColumn == "column_duration") then
vkey = flows_stats[key]["duration"]+postfix
elseif(sortColumn == "column_thpt") then
@ -469,10 +465,8 @@ for _key, _value in pairsByKeys(vals, funct) do
print("\", \"column_vlan\" : \"\"")
end
if(value["category"] ~= nil) then print (", \"column_category\" : \"" .. getCategory(value["category"])) else print (",") end
-- if (debug) then io.write(value["category"].."[" .. getCategory(value["category"]).. "]\n") end
print ("\"column_proto_l4\" : \"")
-- if(value["category"] ~= nil) then print (", \"column_category\" : \"" .. value["category"] .. "\", ") else print (",") end
print (", \"column_proto_l4\" : \"")
if(value["tcp.seq_problems"] == true) then
print("<font color=#B94A48>"..value["proto.l4"].."</font>")
@ -527,7 +521,13 @@ for _key, _value in pairsByKeys(vals, funct) do
cli2srv = round((value["cli2srv.bytes"] * 100) / value["bytes"], 0)
print (", \"column_breakdown\" : \"<div class='progress'><div class='progress-bar progress-bar-warning' style='width: " .. cli2srv .."%;'>Client</div><div class='progress-bar progress-bar-info' style='width: " .. (100-cli2srv) .. "%;'>Server</div></div>")
print ("\", \"column_info\" : \"".. value["info"] .. "\" }\n")
print ("\", \"column_info\" : \"".. value["info"])
if(value["category"] ~= "") then
print(" ".. getCategoryIcon(value["info"], value["category"]))
end
print(" \" }\n")
num = num + 1
end