Package com.h3xstream.retirejs.repo
Class VulnerabilitiesRepository
- java.lang.Object
-
- com.h3xstream.retirejs.repo.VulnerabilitiesRepository
-
public class VulnerabilitiesRepository extends java.lang.ObjectClass that hold the definition of all the libraries.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<JsLibrary>jsLibrares
-
Constructor Summary
Constructors Constructor Description VulnerabilitiesRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLibrary(JsLibrary lib)java.util.List<JsLibraryResult>findByFileContent(java.lang.String scriptContent)This search mode will look for literal string specific to the vulnerable libraries.java.util.List<JsLibraryResult>findByFilename(java.lang.String filename)This search mode will identify the library by there filename.java.util.List<JsLibraryResult>findByFunction(java.lang.String scriptContent)This search mode will load the script in a sandbox and look for the presence of specific function.java.util.List<JsLibraryResult>findByHash(java.lang.String hash)java.util.List<JsLibraryResult>findByUri(java.lang.String uri)This search mode will identify the vulnerable library base on the full uri.
-
-
-
Field Detail
-
jsLibrares
protected java.util.List<JsLibrary> jsLibrares
-
-
Method Detail
-
addLibrary
public void addLibrary(JsLibrary lib)
-
findByUri
public java.util.List<JsLibraryResult> findByUri(java.lang.String uri)
This search mode will identify the vulnerable library base on the full uri.- Parameters:
uri- URI taken from a HTTP request- Returns:
- The list of vulnerable libraries found
-
findByFilename
public java.util.List<JsLibraryResult> findByFilename(java.lang.String filename)
This search mode will identify the library by there filename. (official distribution filename)- Parameters:
filename- Filename taken from an URI- Returns:
- The list of vulnerable libraries found
-
findByFileContent
public java.util.List<JsLibraryResult> findByFileContent(java.lang.String scriptContent)
This search mode will look for literal string specific to the vulnerable libraries.- Parameters:
scriptContent- Complete content of the script- Returns:
- The list of vulnerable libraries found
-
findByHash
public java.util.List<JsLibraryResult> findByHash(java.lang.String hash)
- Parameters:
hash- Hash of the file to search- Returns:
- The list of vulnerable libraries found
-
findByFunction
public java.util.List<JsLibraryResult> findByFunction(java.lang.String scriptContent)
This search mode will load the script in a sandbox and look for the presence of specific function. NOT IMPLEMENTED- Parameters:
scriptContent- Complete content of the script- Returns:
- The list of vulnerable libraries found
-
-