MalShare is a free initiative for researchers to share malware samples for research purposes, which can be accessed via the website and via the API. Before open-sourcing this API client, there was no publicly supported Java library. The code can be found on Github. Below, more information on the usage is given, as well as a rationale on the code.
Table of contents
The API client is contained within a single class that has several dependencies, as can be seen in the project’s pom.xml file.
Building it as a JAR that includes the dependencies can be done using the command that is given below.
mvn clean compile assembly:single
Alternatively, one can simply copy the Java class into the project that one wishes to use it in, assuming the dependencies are also correctly linked.
The MalShareApi object requires the API key in the constructor. The public functions of the class expose the API endpoints. The private functions, such as get and post, are used internally for the network connection.
Below, links are given to the blogs that contain the version specific release notes. The most recent release is the first link in the list.
- Version 1.1-stable [TBA]
- Version 1.0-stable [8th of August 2020]