Accepts
WFAppContentItem, WFFolderContentItem, Files, Images, Media, PDFs, Rich Text and Text
COMMENT
VirusTotal Scan by Ormetis_Build on RoutineHub
This shortcut can be used to analyze any type of file and detect whether or not it’s malicious. The analysis will not work if the file is compressed AND is password protected.
If you have any problems with the shortcut, please contact me by e-mail (select all the text below then click on "New Mail message"):
mailto:compte26@orange.fr?subject=help: VirusTotal Scan shortcut
COMMENT
⤵️ SETUP HERE
==============
1. Create an account on VirusTotal: https://www.virustotal.com/gui/join-us
2. Retrieve your API key: https://www.virustotal.com/gui/my-apikey
3. Paste the key in the Text action below ⬇️
4. Run the shortcut once to enable notification and file upload to VirusTotal.
That's it, you can now run the shortcut and choose a file, or share a file and choose this shortcut!
TEXT
Text

Text
VARIABLES
Set variable
API-key
to
Texte
SCRIPTING
If
API-key
does not have any value
SCRIPTING
Show alert
Informational Message
SCRIPTING
Exit shortcut with
Result
SCRIPTING
End If

If Result
SCRIPTING
If
Shortcut Input
does not have any value
MISSING
file.select Under Construction
SCRIPTING
End If

If Result
DOCUMENTS
Get
File Size
from
Résultat de la condition

File Size
SCRIPTING
If
Taille du fichier
is greater than
<value>
NETWORK
Get contents of
https://www.virustotal.com/api/v3/files/upload_url
Options Under Construction

Contents of URL
SCRIPTING
Get
Value
for
data
in
Contenu de l’URL

Dictionary Value
VARIABLES
Set variable
request__url
to
URL_large-file
SCRIPTING
Otherwise
TEXT
https://www.virustotal.com/api/v3/files

Text
VARIABLES
Set variable
request__url
to
Texte
SCRIPTING
End If

If Result
SCRIPTING
Generate
MD5
hash of
Résultat de la condition

Hash
NETWORK
Get contents of
request__url
Options Under Construction

Contents of URL
SCRIPTING
Get
Value
for
data
in
Contenu de l’URL

Dictionary Value
SCRIPTING
Get
Value
for
id
in
Valeur du dictionnaire

Dictionary Value
VARIABLES
Set variable
file__id
to
Valeur du dictionnaire
NOTIFICATIONS
Show notification
Input
Options Under Construction
SCRIPTING
Repeat
12 times

Repeat Results
NETWORK
Get contents of
https://www.virustotal.com/api/v3/analyses/
file__id
Options Under Construction

Contents of URL
SCRIPTING
Get
Value
for
data
in
Contenu de l’URL

Dictionary Value
SCRIPTING
Get
Value
for
attributes
in
Dico data

Dictionary Value
SCRIPTING
Get
Value
for
status
in
Dico attributes

Dictionary Value
TEXT
Match
(queued|in-progress)
in
Valeur du dictionnaire

Matches
SCRIPTING
If
Correspondances
has any value
SCRIPTING
Wait
25 seconds
SCRIPTING
Otherwise
SCRIPTING
Get
Value
for
stats
in
Dico attributes

Dictionary Value
SCRIPTING
Get
Value
for
undetected
in
Dico stats

Dictionary Value
SCRIPTING
Get
Value
for
harmless
in
Dico stats

Dictionary Value
SCRIPTING
Get
Value
for
suspicious
in
Dico stats

Dictionary Value
SCRIPTING
Get
Value
for
malicious
in
Dico stats

Dictionary Value
TEXT
Undetected:
Valeur du dictionnaire
Harmless:
Valeur du dictionnaire
Suspicious:
Valeur du dictionnaire
Malicious:
Valeur du dictionnaire

Text
SCRIPTING
Show
Texte
SCRIPTING
Exit shortcut with
Result
SCRIPTING
End If

If Result
SCRIPTING
End Repeat

Repeat Results