📜  Misp 设置 - Shell-Bash (1)

📅  最后修改于: 2023-12-03 14:44:19.071000             🧑  作者: Mango

Misp 设置 - Shell-Bash

MISP, which stands for Malware Information Sharing Platform, is an open source platform for sharing, storing and correlating Indicators of Compromise (IOC) of targeted attacks. MISP is written in PHP and can be installed on various operating systems such as Linux, Windows, and Mac OS X.

In this article, we will discuss the MISP settings for Shell-Bash, which will allow you to interact with MISP through a command line.

Installing Required Dependencies

Before we can get started, we need to install some dependencies, including jq, curl, zip. These dependencies are required to interact with MISP from the command line. The following command can be used to install them:

sudo apt-get install jq curl zip
Configuring the API credentials

Once we have the required dependencies installed, we can configure the API credentials. MISP API credentials are required to access the MISP instances. Here is how you can obtain MISP API access:

  1. Log in to your MISP instance, and navigate to the Event Actions tab.
  2. Select API from the dropdown and click on list all API keys.
  3. Click on the New API key button to generate an API key.

To configure the API credentials on the command line-level, execute the following command, substituting your own values:

echo export MISP_URL=\"https://misp-instance.org\" >> ~/.bashrc
echo export MISP_AUTH_KEY=\"YOUR_API_KEY\" >> ~/.bashrc
Interacting with MISP from Shell-Bash

Once we have set up the API credentials on the command line, we can begin to interact with MISP from the command line. Here are some useful tips:

Retrieving Events

The following command allows fetching events from the MISP instance:

#!/bin/bash
curl "$MISP_URL/events/index.json?auth=$MISP_AUTH_KEY"|jq ".response.data[].Event.info" -r

This script will output a list of event IDs along with their associated information.

Consult the API Documentation

The MISP API provides a wide range of functionalities that you can implement in your Shell-Bash scripts. To learn more about the API, we can consult the official MISP API documentation using the following command:

curl -k https://misp-instance.org/elements/miscfiles/files/MISP-doc-latest.pdf --output MISP_API.pdf

This will download the latest version of the MISP API documentation and save it to the current working directory.

Conclusion

In conclusion, using Shell-Bash to interact with MISP is a powerful way to automate certain tasks and incorporate MISP data into your scripts. By setting up the API credentials on the command line and using the MISP API documentation as a reference, you can achieve a lot of things from the command line.