Skip to main content
Skip table of contents

Extract Artifacts from Text File

LAST UPDATED: AUG 07, 2024

Extracts artifacts from a text file with File ID. Artifacts include IP, Domain, URL, File Hash, Email Address etc.

Implementation

System

Command Category

Cyber Utility

Tags

ARITIFACT CONDITION

Inputs

Parameter Name

Required/Optional

Description

Sample Data

Files

Required

The Text files to extract artifact

CODE
[

    {

        "FileName": "96296_2011021835400000---art1.txt",

        "FileId": 10742,

        "FileType": "text/plain",

        "FileExtension": ".txt",

        "FileDescription": "This file contains artifacts from events"

    }

]

File Source

Required

File source.

Artifact File

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
Succeed
Context Data

The response data from the utility command.

SAMPLE DATA

JSON
{
    "ip": [
        "192.168.1.128"
    ],
    "url": [
        "http://192.168.1.128",
        "https://www.d3security.com"
    ],
    "domain": [
        "www.d3security.com"
    ],
    "md5": [],
    "sha256": [
        "2548884526E8FBC5781F5B3B2972E9B20CC16DD86BDE93D2E888023F6919F5A2"
    ],
    "sha1": [],
    "emailaddress": [
        "mye@d3security.com"
    ]
}

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/ExtractArtifactsFromTextFile

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": {
    "Files": <Files here>,
    "File Source": <File Source here>
  }
}

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.

Files

array<JSON Object>

Required

The Text files

File Source

string

Required

File source.

Sample Request

SAMPLE DATA

JSON
{
  "Username": "Admin",
  "Site": "Security Operations",
  "CommandParams": {
    "Files": [
      {
        "FileName": "96296_2011021835400000---art1.txt",
        "FileId": 10742,
        "FileType": "text/plain",
        "FileExtension": ".txt",
        "FileDescription": "This file contains artifacts from events"
      }
    ],
    "File Source": "Artifact File"
  }
}

Response

Response Fields

Field Name

Type

Description

error

string

The error message if the API request has failed.

returnData

string

The return data from the API request.

contextData

JSON Object

The context data from the API request.

Sample Response

JSON
{
    "error": "",
    "returnData": "Succeed",
    "contextData": {
      "ip": [
          "192.168.1.128"
      ],
      "url": [
          "http://192.168.1.128",
          "https://www.d3security.com"
      ],
      "domain": [
          "www.d3security.com"
      ],
      "md5": [],
      "sha256": [
          "2548884526E8FBC5781F5B3B2972E9B20CC16DD86BDE93D2E888023F6919F5A2"
      ],
      "sha1": [],
      "emailaddress": [
          "mye@d3security.com"
      ]
    }
}
JavaScript errors detected

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

If this problem persists, please contact our support.