Skip to content

MetaMask/menpo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Menpo

Overview

DeFi Incidents in STIX 2.1.

Menpo Research Whitepaper

Menpo Presentation at DeFi Security Summit - 15.JUL.2023

Using Python to generate STIX objects

Installing

cd python-scripts
python3 -m venv menpo_env
source menpo_env/bin/activate
pip3 install -r requirements.txt # If first time

Generate and store STIX objects from a script

cd python-scripts/data-input
python3 <stix2 python script>

Example

cd python-scripts/data-input
source menpo_env/bin/activate

python3 22.09.01.kyberswap.py

Accessing the database

Getting a list of all the reports in the DB

import json

from stix2 import FileSystemSource, Filter
from stix2.base import STIXJSONEncoder

fs = FileSystemSource("../../db")

# Do the query
filt = Filter('type', '=', 'report')
reports = fs.query([filt])

# Convert the Python objects to JSON and print them
json_str = json.dumps(reports, indent=4, cls=STIXJSONEncoder)
print(json_str)

# Or, if you don't like json, we can give you a more compact one
sorted_reports = sorted(reports, key=lambda x: x["published"])

print("Reports in the DB:", len(sorted_reports), "\n")

for report in sorted_reports:
  print("-", report.name)

Generate a json report and render it on the STIX visualizer

# TODO

About

DeFi Incident Database

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages