@ThreadSafe public class VulnerableSoftware extends us.springett.parsers.cpe.Cpe implements Serializable
| Constructor and Description |
|---|
VulnerableSoftware(us.springett.parsers.cpe.values.Part part,
String vendor,
String product,
String version,
String update,
String edition,
String language,
String swEdition,
String targetSw,
String targetHw,
String other,
String versionEndExcluding,
String versionEndIncluding,
String versionStartExcluding,
String versionStartIncluding,
boolean vulnerable)
Constructs a new immutable VulnerableSoftware object that represents the
Well Form Named defined in the CPE 2.3 specification.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(@NotNull Object o) |
protected boolean |
compareVersionRange(String targetVersion)
Evaluates the target against the version and version range checks:
versionEndExcluding, versionStartExcluding versionEndIncluding, and
versionStartIncluding.
|
protected static boolean |
compareVersions(VulnerableSoftware vs,
String targetVersion)
Evaluates the target against the version and version range checks:
versionEndExcluding, versionStartExcluding versionEndIncluding, and
versionStartIncluding.
|
boolean |
equals(Object obj) |
String |
getVersionEndExcluding()
Returns the versionEndExcluding.
|
String |
getVersionEndIncluding()
Returns the versionEndIncluding.
|
String |
getVersionStartExcluding()
Returns the versionStartExcluding.
|
String |
getVersionStartIncluding()
Returns the versionStartIncluding.
|
int |
hashCode() |
boolean |
isVulnerable()
Returns the value of vulnerable.
|
boolean |
matchedBy(us.springett.parsers.cpe.ICpe target)
Determines if the target VulnerableSoftware matches the
VulnerableSoftware.
|
boolean |
matches(us.springett.parsers.cpe.ICpe target)
Determines if the VulnerableSoftware matches the given target
VulnerableSoftware.
|
static boolean |
testMatch(us.springett.parsers.cpe.ICpe left,
us.springett.parsers.cpe.ICpe right)
Tests if the left matches the right.
|
String |
toString() |
compareAttributes, compareAttributes, compareVersions, getEdition, getLanguage, getOther, getPart, getProduct, getSwEdition, getTargetHw, getTargetSw, getUpdate, getVendor, getVersion, getWellFormedEdition, getWellFormedLanguage, getWellFormedOther, getWellFormedProduct, getWellFormedSwEdition, getWellFormedTargetHw, getWellFormedTargetSw, getWellFormedUpdate, getWellFormedVendor, getWellFormedVersion, toCpe22Uri, toCpe23FSpublic VulnerableSoftware(us.springett.parsers.cpe.values.Part part,
String vendor,
String product,
String version,
String update,
String edition,
String language,
String swEdition,
String targetSw,
String targetHw,
String other,
String versionEndExcluding,
String versionEndIncluding,
String versionStartExcluding,
String versionStartIncluding,
boolean vulnerable)
throws us.springett.parsers.cpe.exceptions.CpeValidationException
null will be set to the default
LogicalValue.ANY. All values
passed in must be well formed (i.e. special characters quoted with a
backslash).part - the type of entry: application, operating system, or hardwarevendor - the vendor of the CPE entryproduct - the product of the CPE entryversion - the version of the CPE entryupdate - the update of the CPE entryedition - the edition of the CPE entrylanguage - the language of the CPE entryswEdition - the swEdition of the CPE entrytargetSw - the targetSw of the CPE entrytargetHw - the targetHw of the CPE entryother - the other of the CPE entryversionEndExcluding - the ending range, excluding the specified
version, for matching vulnerable softwareversionEndIncluding - the ending range, including the specified
version, for matching vulnerable softwareversionStartExcluding - the starting range, excluding the specified
version, for matching vulnerable softwareversionStartIncluding - the starting range, including the specified
version, for matching vulnerable softwarevulnerable - whether or not this represents a vulnerable software
itemus.springett.parsers.cpe.exceptions.CpeValidationException - thrown if one of the CPE entries is
invalidpublic int compareTo(@NotNull
@NotNull Object o)
compareTo in interface ComparablecompareTo in class us.springett.parsers.cpe.Cpepublic int hashCode()
hashCode in class us.springett.parsers.cpe.Cpepublic boolean equals(Object obj)
equals in class us.springett.parsers.cpe.Cpepublic boolean matches(us.springett.parsers.cpe.ICpe target)
Determines if the VulnerableSoftware matches the given target VulnerableSoftware. This does not follow the CPE 2.3 Specification exactly as there are cases where undefined comparisons will result in either true or false. For instance, 'ANY' will match 'm+wild cards' and NA will return false when the target has 'm+wild cards'.
For vulnerable software matching, the implementation also takes into account version ranges as specified within the NVD data feeds.
matches in interface us.springett.parsers.cpe.ICpematches in class us.springett.parsers.cpe.Cpetarget - the target CPE to evaluatetrue if the CPE matches the target; otherwise
falsepublic static boolean testMatch(us.springett.parsers.cpe.ICpe left,
us.springett.parsers.cpe.ICpe right)
left - the cpe to compareright - the cpe to checktrue if a match is found; otherwise
falsepublic boolean matchedBy(us.springett.parsers.cpe.ICpe target)
Determines if the target VulnerableSoftware matches the VulnerableSoftware. This does not follow the CPE 2.3 Specification exactly as there are cases where undefined comparisons will result in either true or false. For instance, 'ANY' will match 'm+wild cards' and NA will return false when the target has 'm+wild cards'.
For vulnerable software matching, the implementation also takes into account version ranges as specified within the NVD data feeds.
matchedBy in interface us.springett.parsers.cpe.ICpematchedBy in class us.springett.parsers.cpe.Cpetarget - the VulnerableSoftware to evaluatetrue if the target CPE matches CPE; otherwise
falseprotected boolean compareVersionRange(String targetVersion)
targetVersion - the version to comparetrue if the target version is matched; otherwise
falseprotected static boolean compareVersions(VulnerableSoftware vs, String targetVersion)
vs - a reference to the vulnerable software to comparetargetVersion - the version to comparetrue if the target version is matched; otherwise
falsepublic String getVersionEndExcluding()
public String getVersionEndIncluding()
public String getVersionStartExcluding()
public String getVersionStartIncluding()
public boolean isVulnerable()
public String toString()
toString in class us.springett.parsers.cpe.CpeCopyright © 2012–2020 OWASP. All rights reserved.