Automatisierung des SOC-Workflows mit Python und VirusTotal

import requests
import json

API_KEY= "YOUR_API_KEY"

IP_ADDR = ["147.78.47.250",
           "94.102.61.28",                               
            "94.102.61.6",
            "8.8.8.8"]

for x in IP_ADDR:

    res = f"https://www.virustotal.com/api/v3/ip_addresses/{x}"
    headers = {"accept": "application/json",
               "x-apikey":API_KEY}

    response = requests.get(res, headers=headers)
    response_data = json.loads(response.text)

    # Check if the IP address is malicious
    if "data" in response_data and "attributes" in response_data["data"] and "last_analysis_stats" in response_data["data"]["attributes"] and response_data["data"]["attributes"]["last_analysis_stats"]["malicious"] > 0:
        print(f"The IP address {x} is malicious with a score of {response_data['data']['attributes']['last_analysis_stats']['malicious']}")
    else:
        print(f"The IP address {x} is not malicious")
#Output
The IP address 147.78.47.250 is malicious with a score of 11
The IP address 94.102.61.28 is malicious with a score of 8
The IP address 94.102.61.6 is malicious with a score of 4
The IP address 8.8.8.8 is malicious with a score of 2

import requests
import json

# Replace YOUR_API_KEY with your actual API key
API_KEY = "YOUR_API_KEY"

# Domains to look up
domains = [
"zn.squeamarundo.com",
"fr.talerselrage.com",
"gw.dummiedkhodja.com",
"cpanel.genixcares.com",
"as.mailsyntec.com",
"replacestuntissue.com",
"7B85A160-A4D9-43BD-8B32-295B3F23E62E.server-77.beshopbooks.com,"
"tl.corkeextatic.com",
"so.ohoycaline.com",
"erdeallyighab.com",
"ih.ijorecepous.com",
"trendvidaa.com",
"version.ffmax.purplevioleto.com",
"rg.trotletekphore.com",
"server13.mydomelem.com",
"oxodigital.tv",
"serhatyolacan.com",
"dc.forkedtrizoic.com",
"gf.tummingfass.com",
"jz.dunnedemicant.com",
"topservicepool.com"]

for x in domains:
    url = "https://www.virustotal.com/api/v3/domains/{}".format(x)

    headers = {
        "x-apikey": API_KEY,
        "Accept": "application/json"
    }

    params = {
        "include": "last_analysis_stats"
    }
    response = requests.get(url, headers=headers, params=params)
    response_data = json.loads(response.text)
    try:
        if "last_analysis_stats" in response_data["data"]["attributes"] and response_data["data"]["attributes"]["last_analysis_stats"]["malicious"] > 0:
            malicious_score = response_data["data"]["attributes"]["last_analysis_stats"]["malicious"]
            print(f"The domain {x} has a malicious score of {malicious_score}.")
        else:
            print(f"The domain {x} is not detected as malicious by VirusTotal.")    
    except KeyError:
        print("The domain {} not found by VirusTotal.".format(x))
#Output

The domain zn.squeamarundo.com is not detected as malicious by VirusTotal.
The domain fr.talerselrage.com is not detected as malicious by VirusTotal.
The domain gw.dummiedkhodja.com is not detected as malicious by VirusTotal.
The domain cpanel.genixcares.com is not detected as malicious by VirusTotal.
The domain as.mailsyntec.com is not detected as malicious by VirusTotal.
The domain replacestuntissue.com has a malicious score of 6.
The domain 7B85A160-A4D9-43BD-8B32-295B3F23E62E.server-77.beshopbooks.com,tl.corkeextatic.com not found by VirusTotal.
The domain so.ohoycaline.com is not detected as malicious by VirusTotal.
The domain erdeallyighab.com is not detected as malicious by VirusTotal.
The domain ih.ijorecepous.com is not detected as malicious by VirusTotal

Suggested posts

Dieses Bedrohungsarchiv: Band 7 Black Basta

Dieses Bedrohungsarchiv: Band 7 Black Basta

In der heutigen vernetzten Welt ist die Bedrohung durch Cyberangriffe größer denn je. Cyberkriminelle und nationalstaatliche Akteure versuchen ständig, Schwachstellen auszunutzen und wertvolle Daten zu stehlen, was ein erhebliches Risiko für Unternehmen jeder Größe darstellt.

So führen Sie ChatGPT-Plugins kostenlos mit Langchain aus

So führen Sie ChatGPT-Plugins kostenlos mit Langchain aus

Sie haben sicher schon von allen neuen leistungsstarken ChatGPT-Plugins wie Browser, Code Interpreter usw. gehört. Es gibt jedoch ein Problem: Der Zugriff auf Plugins ist auf eine Warteliste beschränkt und viele haben daher keinen Zugriff darauf.

Related posts

Was macht einen Podcast einflussreich?

Was macht einen Podcast einflussreich?

Letzte Woche fiel mir eine Pressemitteilung auf, die über PressGazette (eine britische Nachrichten-Website für Medien) verschickt wurde. In dem Artikel wurde angekündigt, dass Acast, das skandinavische Podcast-Hosting- und Werbeunternehmen, ein Konsortium der „wahrscheinlich einflussreichsten“ Verlage im Podcasting leiten werde.

Der Mord an Jordan Neely und das Problem des „patriotischen“ Rassismus

Können die USA den entscheidenden Schritt tun, rassistisches Verhalten nicht mit der Identität eines guten Amerikaners gleichzusetzen?

Der Mord an Jordan Neely und das Problem des „patriotischen“ Rassismus

[Alarm auslösen: Dieser Aufsatz enthält Screenshots von Menschen, die den Mörder von Jordan Neely loben.] Polizeibeamte haben endlich – und vielleicht widerstrebend – Daniel Penny, den Mann, der Jordan Neely bis zu seinem Tod gewürgt hat, wegen dieses Mordes angeklagt.

Finanzierung der CO2-Entfernung im Geschäftsjahr 24

Die Aufschlüsselung der Mittelanträge von Carbon180 nach Pfaden

Finanzierung der CO2-Entfernung im Geschäftsjahr 24

Von Alyson Lee, geschäftsführende Beraterin für Regierungsangelegenheiten Der jährliche Bewilligungsprozess der Bundesregierung ist von zentraler Bedeutung für unsere Bemühungen zur Finanzierung der Kohlendioxidentfernung (CDR). Jedes Jahr reicht Carbon180 Anfragen an verschiedene Kongressbüros ein, um zu bestimmen, wohin die Dollars im nächsten Jahr fließen werden.

Pronomen sind super gruselig

Es fällt mir plötzlich auf, wie so oft. Es ist wieder die Mitte. <Nein, nicht die im Pazifik, du Schlappschwanz, die auf dem Jahrmarkt> Jede Schlagzeile laut…..