File tree 2 files changed +33
-0
lines changed 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 15
15
16
16
after_build :
17
17
- Installer\MakeSetup.bat
18
+ - bash.exe %APPVEYOR_BUILD_FOLDER%\virustotal_upload %APPVEYOR_BUILD_FOLDER%\Installer\OpennessWebView2.exe %APPVEYOR_BUILD_FOLDER%\Installer\virustotal_report.json
18
19
19
20
artifacts :
20
21
- path : BrowserProxy\$(configuration)\OpennessWebView2.dll
21
22
- path : Installer\OpennessWebView2.exe
23
+ - path : Installer\virustotal_report.json
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ #
3
+ # Upload a sample to VirusTotal and print the report.
4
+ # Modified from https://gist.github.com/luca-m/c6837cb0f8656714b7ff.
5
+ #
6
+ # Dependencies:
7
+ #
8
+ # * curl
9
+ # * VirusTotal API key
10
+ #
11
+
12
+ echo " Uploading $1 to VirusTotal"
13
+
14
+ vt_hash=$( curl -\# -X POST ' https://www.virustotal.com/vtapi/v2/file/scan' \
15
+ --form apikey=" $VIRUSTOTAL_API_KEY " \
16
+ --form file=@" $1 " | grep -o ' "[0-9|a-f]\{64\}"' | head -1 | sed ' s/"//g' )
17
+
18
+ echo " SHA256:${vt_hash} - waiting for report.."
19
+
20
+ while [[ " $vt_hash " != " " ]] do
21
+ sleep 10
22
+ response=$( curl -sX POST ' https://www.virustotal.com/vtapi/v2/file/report' \
23
+ --form apikey=" $VIRUSTOTAL_API_KEY " \
24
+ --form resource=" $vt_hash " )
25
+
26
+ if (echo -n " $response " | grep -q ' Scan finished' ); then
27
+ echo " $response " | tee " $2 "
28
+ break ;
29
+ fi
30
+ date
31
+ done
You can’t perform that action at this time.
0 commit comments