Sample#

Uploading a sample#

The role SAMPLEDB-UPLOADER or higher is required to be able to upload samples.

To upload a sample file, the sample endpoint can be used with a POST operation, along with the raw file.

Upon success, the HTTP response will contain either a 201 or 200 status code, depending on whether the sample already exists or not.

The response body will be JSON formatted, and contain, among other things, the ID of the sample which will be the calculated sha256 hash of the file. This ID is used in all requests relating to a sample, like downloading a sample, adding an analysis, or submission.

curl -XPOST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/octet-stream" -d @./sample-file.exe https://api.mnemonic.no/sampledb/v2/sample

Tip

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Downloading a sample#

There are two ways of downloading a sample. Using the safe method will download a sample that has been zipped and password protected with the word infected. The unsafe method will download a raw sample without any form of protection.

Safe#

The role SAMPLEDB-VIEWER or higher is required to be able to download a safe, zipped sample. In addition, the customer needs to have access to at least one submission for the same sample.

The example below will download a sample and store it in a file named safe-sample.zip:

curl -X GET -H "Argus-API-Key: my/api/key" -o safe-sample.zip https://api.mnemonic.no/sampledb/v2/sample/<sample sha256 hash>/safe

Tip

For more detailed information, you can check out the Swagger API documentation.

Unsafe#

The role SAMPLEDB-VIEWER or higher is required to be able to download the raw sample. In addition, the customer needs to have access to at least one submission for the same sample.

The example below will download a sample and store it in a file named raw-sample:

curl -X GET -H "Argus-API-Key: my/api/key" -o raw-sample https://api.mnemonic.no/sampledb/v2/sample/<sample sha256 hash>/raw

Tip

For more detailed information, you can check out the Swagger API documentation.

Fetching sample metadata#

The role SAMPLEDB-VIEWER or higher is required to be able to fetch sample metadata. In addition, the customer needs to have access to at least one submission for the same sample.

To fetch metadata about a sample, the sample endpoint can be used with a GET operation along with the sample ID. The response body will be JSON formatted and contain information like size, and timestamp.

curl -X GET -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/sampledb/v2/sample/<sample sha256 hash>/

Tip

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Searching for samples#

The role SAMPLEDB-VIEWER or higher is required to be able to search for samples.