diff --git a/nselib/shortport.lua b/nselib/shortport.lua index e6b75bc29..bf2e69b75 100644 --- a/nselib/shortport.lua +++ b/nselib/shortport.lua @@ -150,3 +150,17 @@ version_port_or_service = function(ports, services, protos, states) and not(port_is_excluded(port.number, port.protocol)) end end + +--- +-- A portrule that matches likely HTTP services. +-- +-- @name http +-- @class function +-- @param host The host table to match against. +-- @param port The port table to match against. +-- @return true if the port is likely to be HTTP, +-- false otherwise. +-- @usage +-- portrule = shortport.http +http = shortport.port_or_service({80, 443, 631, 3872, 8080}, + {"http", "https", "ipp", "http-alt", "oem-agent"})