You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the last few versions we should automatically look for and use the VT key from settings - so you don't need to get it manually (I think our example notebook still does this - I will try to create some proper docs and update this)
# Get API key from mscticpyconfig, comment if you use the variable abovevt_key=get_provider_settings("TIProviders")["VirusTotal"].args["AuthKey"]
# Instantiate vt_lookup objectvt_lookup=VTLookupV3(vt_key)
We also do this in the init of VTLookupV3 if you're running in notebook so it shouldn't be needed
nest_asyncio.apply()
You should be able to use our IoCExtract module to do this
# Regexvalidip="^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$"validdomain="^((?!-)[A-Za-z0-9-]"+"{1,63}(?<!-)\\.)"+"+[A-Za-z]{2,6}"validurl=r"(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’]))"# Compile the ReGexdomain=re.compile(validdomain)
ip=re.compile(validip)
url=re.compile(validurl)
print("[+] Searching VT samples that have relationship with: "+keyword.value)
ifre.search(ip, keyword.value):
domain_relation=vt_lookup.lookup_io....
Using IoCExtract
frommsticpy.sectools.ioc_extractimportIoCExtract# note this location will change in MP V2.0 to msticpy.transform.ioc_extractioc_extract=IoCExtract()
ifioc_extract.validate(keyword.value, "ipv4"):
domain_relation=vt_lookup.lookup_io....
ifioc_extract.validate(keyword.value, "dns"):
domain_relation=vt_lookup.lookup_io....'
ifioc_extract.validate(keyword.value, "url"):
domain_relation=vt_lookup.lookup_io....'
IoCExtract and VT relations also support file hashes for domain relationships.
(you can use "file_hash" generically or a specific type: "md5_hash", "sha1_hash", "sha256_hash")
We also expose getting these relationships with some pivot functions:
Again, this not yet well documented but I hope to get to this soon. :-)
Also - the notebook display is being messed up - prob due to an html error. I've seen this before in notebooks on Github, which seems less tolerant of html errors.
I noticed these two lines have malformed closing tags, could be that.
display(HTML("<h2>Samples Hunting on domain/ip/url Relationship</h2"))
display(HTML("<h3>Usage: </h3"))
The text was updated successfully, but these errors were encountered:
For the last few versions we should automatically look for and use the VT key from settings - so you don't need to get it manually (I think our example notebook still does this - I will try to create some proper docs and update this)
We also do this in the init of VTLookupV3 if you're running in notebook so it shouldn't be needed
You should be able to use our IoCExtract module to do this
Using IoCExtract
IoCExtract and VT relations also support file hashes for domain relationships.
(you can use "file_hash" generically or a specific type: "md5_hash", "sha1_hash", "sha256_hash")
We also expose getting these relationships with some pivot functions:
Again, this not yet well documented but I hope to get to this soon. :-)
Also - the notebook display is being messed up - prob due to an html error. I've seen this before in notebooks on Github, which seems less tolerant of html errors.
I noticed these two lines have malformed closing tags, could be that.
The text was updated successfully, but these errors were encountered: