Python 및 VirusTotal로 SOC 워크플로우 자동화

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

그 위협 아카이브: Vol 7 블랙 바스타

그 위협 아카이브: Vol 7 블랙 바스타

오늘날의 상호 연결된 세계에서 사이버 공격의 위협은 그 어느 때보다 만연해 있습니다. 사이버 범죄자와 국가 행위자는 지속적으로 취약점을 악용하고 귀중한 데이터를 도용하여 모든 규모의 조직에 상당한 위험을 초래합니다.

Langchain을 사용하여 ChatGPT 플러그인을 무료로 실행하는 방법

Langchain을 사용하여 ChatGPT 플러그인을 무료로 실행하는 방법

브라우저, 코드 해석기 등과 같은 새롭고 강력한 ChatGPT 플러그인에 대해 들어보셨을 것입니다. 그러나 문제가 있습니다. 플러그인에 대한 액세스는 대기자 명단으로 제한되어 있으므로 많은 사람들이 액세스할 수 없습니다.

Related posts

카우보이의 거짓말

거대 기업이 미국인에게 강력한 거짓을 판매하는 방법

카우보이의 거짓말

햇빛의 첫 번째 광선이 평원의 서리가 내린 풀을 비추는 서쪽 언덕의 눈부신 황금빛 아침입니다. 온화하고 거대한 새까만 앵거스 소 떼가 일출을 배경으로 윤곽을 그리며 다져진 길을 따라 모두가 잘 아는 지역으로 향합니다. 조식 바.

조던 닐리의 살인과 "애국적" 인종차별의 문제

미국은 인종차별적 행동을 좋은 미국인이 되는 것과 동일시하지 않는 필수적인 조치를 취할 수 있습니까?

조던 닐리의 살인과 "애국적" 인종차별의 문제

[방아쇠 경고: 이 에세이에는 Jordan Neely의 살인자를 칭찬하는 사람들의 스크린 샷이 포함되어 있습니다.] 법 집행관은 마침내 그리고 아마도 마지못해 죽을 때까지 Jordan Neely를 질식시킨 사람인 Daniel Penny를 살인 혐의로 기소했습니다.

도메인 이름에 대한 정보 찾기

Brian P. Hogan의 Small, Sharp 소프트웨어 도구에서 발췌

도메인 이름에 대한 정보 찾기

facebook.com에 요청하면 컴퓨터가 도메인 이름을 조회하여 해당 도메인 이름을 IP 주소로 변환하므로 컴퓨터가 해당 연결을 만들 수 있습니다.

위험한 대화

위험한 대화

우리가 이 행성에서 계속 번성하고 싶다면 위험한 대화를 해야 할 것입니다. 우리가 한 것, 우리가 하고 있는 것, 그리고 현재 우리가 계속하기로 설정한 것(또는 할 계획인 것)에 도전하는 것들.