Skip to main content
Skip table of contents

Extract Hashes from Array of JSON Objects

Extracts Hashes text from Array of JSON Object into a Hashes List

Implementation

System

Command Category

Cyber Utility

Tags

ARTIFACT CONDITION HASH

Inputs

Parameter Name

Required/Optional

Description

Sample Data

Input

Optional

JSON Object to extract Hashes text from

CODE
[
    {
        "String": "D3security",
        "Hash": "bc9c7a6bbd00010d2de8812ec73c5c79",
        "SHA256Hash": "6AF39D89988346A398604FEB5BA5BE28CE4C2D5951358AA09B964C58764E6E23",
        "SHA1Hash": "ec53ba1cfc093c0ee96f7c39e5cc612b7f4a233d"
    },
    {
        "SHA256Hash": "a00430e6bd78b575bf10e8553b41785e1b3ec43601fb7eee983854c8f4c5b115"
    }
]

Output

Return Data

The returned result of this command. If some required parameters are not defined, this returned data could be empty. The returned result can be passed down directly to a subsequent command in playbooks.

SAMPLE DATA

JSON
{
    "Status": "Successful",
    "Data": {
        "MD5Hash": [],
        "SHA256Hash": [
            "6AF39D89988346A398604FEB5BA5BE28CE4C2D5951358AA09B964C58764E6E23",
            "a00430e6bd78b575bf10e8553b41785e1b3ec43601fb7eee983854c8f4c5b115"
        ],
        "SHA1Hash": [
            "ec53ba1cfc093c0ee96f7c39e5cc612b7f4a233d"
        ],
        "CombinedHash": [
            "6AF39D89988346A398604FEB5BA5BE28CE4C2D5951358AA09B964C58764E6E23",
            "ec53ba1cfc093c0ee96f7c39e5cc612b7f4a233d",
            "a00430e6bd78b575bf10e8553b41785e1b3ec43601fb7eee983854c8f4c5b115"
        ]
    }
}

Remote Command API

The D3 command API allows you to send requests to D3 SOAR to execute this utility command via REST API.

Request

POST

CODE
https:/{base_url}/{api_namespace}/api/Command/GetHashesFromJSONObject

Headers

Please refer to the page Webhook Configuration Guide - Authentication Method: API Keys for more details.

Request Body

JSON
{
  "Username": <Username here>,
  "Site": <Site here>,
  "CommandParams": {
    "Input": <JSON Object to extract Hashes text from>
  }
}

Body Parameters

Parameter Name

Type

Required/Optional

Description

Username

String

Required

The username of your D3 SOAR account.

Site

String

Required

The D3 SOAR site to run the remote command.

Input

JSON Array

Optional

JSON Object to extract Hashes text from

Sample Request

SAMPLE DATA

JSON
{
  "Username": "Admin",
  "Site": "Security Operations",
  "CommandParams": {
    "Input": [
      {
        "String": "D3security",
        "Hash": "bc9c7a6bbd00010d2de8812ec73c5c79",
        "SHA256Hash": "6AF39D89988346A398604FEB5BA5BE28CE4C2D5951358AA09B964C58764E6E23",
        "SHA1Hash": "ec53ba1cfc093c0ee96f7c39e5cc612b7f4a233d"
      },
      {
        "SHA256Hash": "a00430e6bd78b575bf10e8553b41785e1b3ec43601fb7eee983854c8f4c5b115"
      }
    ]
  }
}

Response

Response Fields

Field Name

Type

Description

error

String

The error message if the API request has failed.

returnData

JSON Object

The return data from the API request.

Sample Response

JSON
{
    "error": "",
    "returnData": {
    "Status": "Successful",
    "Data": {
        "MD5Hash": [],
        "SHA256Hash": [
            "6AF39D89988346A398604FEB5BA5BE28CE4C2D5951358AA09B964C58764E6E23",
            "a00430e6bd78b575bf10e8553b41785e1b3ec43601fb7eee983854c8f4c5b115"
        ],
        "SHA1Hash": [
            "ec53ba1cfc093c0ee96f7c39e5cc612b7f4a233d"
        ],
        "CombinedHash": [
            "6AF39D89988346A398604FEB5BA5BE28CE4C2D5951358AA09B964C58764E6E23",
            "ec53ba1cfc093c0ee96f7c39e5cc612b7f4a233d",
            "a00430e6bd78b575bf10e8553b41785e1b3ec43601fb7eee983854c8f4c5b115"
        ]
    }
}
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.