https://github.com/airbus-cert/mispy
Another MISP module for Python
https://github.com/airbus-cert/mispy
misp
Last synced: 6 months ago
JSON representation
Another MISP module for Python
- Host: GitHub
- URL: https://github.com/airbus-cert/mispy
- Owner: airbus-cert
- License: apache-2.0
- Created: 2015-11-06T12:27:14.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-02-17T11:57:36.000Z (over 6 years ago)
- Last Synced: 2026-01-03T02:50:07.539Z (6 months ago)
- Topics: misp
- Language: Python
- Size: 82 KB
- Stars: 18
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# python-misp
[](http://python-misp.readthedocs.org/en/latest/?badge=latest)
[](https://travis-ci.org/nbareil/python-misp)
A pythonic MISP module.
[API Documentation](https://python-misp.readthedocs.io/en/latest/)
and unit-tests are available.
## Examples
Get attributes and tags from an event:
```python
server = MispServer(url=URL, apikey=APIKEY)
event = server.events.get(42)
for attr in event.attributes:
print("%s %s %s" % (attr.category, attr.type, attr.value))
if attr.type == 'malware-sample':
server.download(attr)
for tag in event.tags:
print("%s" % tag.name)
```
Add a new attribute to an event
```python
server = MispServer(url=URL, apikey=APIKEY)
event = server.events.get(42)
new_attr = MispAttribute()
new_attr.value = "127.0.0.1"
new_attr.category = "Network activity"
new_attr.type = "ip-dst"
new_attr.comment = "Dope IOC"
new_attr.to_ids = True
event.attributes.add(new_attr)
server.events.update(event)
```
Search for an attribute
```python
server = MispServer(url=URL, apikey=APIKEY)
events = server.attributes.search(value="087bffa8a570079948310dc9731c5709")
for event in events:
print("%i - %s" % (event.id, event.info))
```
## Credits
Airbus Group CERT