base/frameworks/software/main.bro
-
Software
This script provides the framework for software version detection and
parsing but doesn’t actually do any detection on it’s own. It relies on
other protocol specific scripts to parse out software from the protocols
that they analyze. The entry point for providing new software detections
to this framework is through the Software::found
function.
Detailed Interface
Runtime Options
-
Software::asset_tracking
-
Hosts whose software should be detected and tracked.
Choices are: LOCAL_HOSTS, REMOTE_HOSTS, ALL_HOSTS, NO_HOSTS.
State Variables
-
Software::alternate_names
-
{
["Flash Player"] = "Flash"
}
Sometimes software will expose itself on the network with
slight naming variations. This table provides a mechanism
for a piece of software to be renamed to a single name
even if it exposes itself with an alternate name. The
yielded string is the name that will be logged and generally
used for everything.
-
Software::tracked
-
The set of software associated with an address. Data expires from
this table after one day by default so that a detected piece of
software will be logged once each day. In a cluster, this table is
uniformly distributed among proxy nodes.
Types
-
Software::Info
Type: | record
- ts:
time &log &optional
The time at which the software was detected.
- host:
addr &log
The IP address detected running the software.
- host_p:
port &log &optional
The port on which the software is running. Only sensible for
server software.
- software_type:
Software::Type &log &default = Software::UNKNOWN &optional
The type of software detected (e.g. HTTP::SERVER ).
- name:
string &log &optional
Name of the software (e.g. Apache).
- version:
Software::Version &log &optional
Version of the software.
- unparsed_version:
string &log &optional
The full unparsed version string found because the version
parsing doesn’t always work reliably in all cases and this
acts as a fallback in the logs.
- force_log:
bool &default = F &optional
This can indicate that this software being detected should
definitely be sent onward to the logging framework. By
default, only software that is “interesting” due to a change
in version or it being currently unknown is sent to the
logging framework. This can be set to T to force the record
to be sent to the logging framework if some amount of this
tracking needs to happen in a specific way to the software.
- url:
string &optional &log
(present if policy/protocols/http/detect-webapps.bro is loaded)
Most root URL where the software was discovered.
|
The record type that is used for representing and logging software.
-
Software::SoftwareSet
-
Type to represent a collection of Software::Info
records.
It’s indexed with the name of a piece of software such as “Firefox”
and it yields a Software::Info
record with more
information about the software.
-
Software::Type
-
Scripts detecting new types of software need to redef this enum to add
their own specific software types which would then be used when they
create Software::Info
records.
-
Software::Version
-
A structure to represent the numeric version of software.
Events
-
Software::log_software
-
This event can be handled to access the Software::Info
record as it is sent on to the logging framework.
-
Software::register
-
This event is raised when software is about to be registered for
tracking in Software::tracked
.
-
Software::version_change
-
This event can be handled to access software information whenever it’s
version is found to have changed.
Functions
-
Software::cmp_versions
-
Compare two version records.
Returns: | -1 for v1 < v2, 0 for v1 == v2, 1 for v1 > v2.
If the numerical version numbers match, the addl string
is compared lexicographically. |
-
Software::found
-
Other scripts should call this function when they detect software.
Id: | The connection id where the software was discovered. |
Info: | A record representing the software discovered. |
Returns: | T if the software was logged, F otherwise. |