entity:file itw:global-download.domainofyourchoice.com type:zip fs:2020-01-01+
entity:file itw:updates.tdesktop.com have:execution_parents
import requests
import json
import urllib
headers = {
"Accept": "application/json",
"x-apikey": '' # VT API key
}
def get_execution_parent(file_hash):
"""Returns file parents with more than 5 detections in VT.
Args:
file_hash: str, file to check.
"""
url = f'https://www.virustotal.com/api/v3/files/{file_hash}/execution_parents'
while url:
response = requests.get(url, headers=headers)
response.raise_for_status()
data = response.json()
for item in data['data']:
try:
positives = item['attributes']['last_analysis_stats']['malicious']
if int(positives) > 5:
print(f'{item["attributes"]["sha256"]} - {positives}')
Except KeyError:
continue
if 'links' in data and 'next' in data['links']:
url = data['links']['next']
else:
url = None
def get_files_with_execution_parent(target_domain):
"""files found itw in a given domain having execution parent.
target_domain: str, domain to check
url = 'https://www.virustotal.com/api/v3/intelligence/search'
response = requests.get(
url, headers=headers, params={
'query': f'entity: file have: execution_parents itw: {target_domain}'})
get_execution_parent(item['attributes']['sha256'])
target_domain = 'updates.tdesktop.com'
print(f'Checking suspicious execution parents for files downloaded from:{target_domain}')
print(f' [sha256] - [AV positives]')
get_files_with_execution_parent(target_domain)
main_icon_dhash:f09ea26161a2ccf0 p:2+
entity:url main_icon_dhash:e89e436964638ee8 AND NOT ( parent_domain:"tdesktop.com" OR parent_domain:"telegram.org" OR parent_domain:"telegram.me" OR parent_domain:"t.me" )
entity:domain fuzzy_domain:telegram.org AND NOT ( parent_domain:"tdesktop.com" OR parent_domain:"telegram.org" OR parent_domain:"telegram.me" OR parent_domain:"t.me" )
Si eres periodista, escribe a nuestro equipo de comunicación a: press-es@google.com. Para cualquier otra pregunta, consulta nuestras opciones de contacto.