-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathVTTL.vbs
13795 lines (12344 loc) · 625 KB
/
VTTL.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'Vendor Threat Triage Lookup (VTTL) script 'VTTL v 8.3.1.7 - Antivirus hates VBScript. Guess that is why Microsoft is deprecating it.
'origin - https://github.com/RandomRhythm/Vendor-Threat-Triage-Lookup
'Copyright (c) 2024 Ryan Boyle randomrhythm@rhythmengineering.com.
'This program is free software: you can redistribute it and/or modify
'it under the terms of the GNU General Public License as published by
'the Free Software Foundation, either version 3 of the License, or
'(at your option) any later version.
'This program is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'GNU General Public License for more details.
'You should have received a copy of the GNU General Public License
'along with this program. If not, see <http://www.gnu.org/licenses/>.
'/s Run silently
'/e Create Spreadsheet in Excel. Default is CSV output
'/g Perform queries against CSV output from Sysinternals SigCheck and Carbon Black hash dump script.
'/a Perform queries against EnCase tab separated value output or NetAMP CSV (Item Path, Logical Size, MD5, File Name, SHA256, Size (KB))
'/dcb Disable Carbon Black
'/dms Disable MalShare
'/dtc Disable Threat Crowd lookups
'/det Disable Proofpoint Emerging Threats Intelligence
'/dtg Disable ThreatGRID
'filepath If you provide a file path that file will be used as sigcheck input. Also "starting lookups" prompt will be bypassed
'For importing IP/domain CSV output into SQL you need to set the Spamhaus ZEN RBL, reverse DNS, Hosted Domains, WHOIS, Detection Name[#], URL Watch List columns to text stream [DT_TEXT]
'Data utilized from the following projects/locations:
'https://raw.githubusercontent.com/malicialab/avclass/master/data/default.aliases
'https://github.com/malicialab/avclass/blob/master/data/default.generics
'https://db-ip.com/db/lite.php - IP Geolocation by DB-IP
'https://tranco-list.eu/
'http://data.iana.org/TLD/tlds-alpha-by-domain.txt
'http://mirror2.malwaredomains.com/files/dynamic_dns.txt
'(others noted in code)
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateTrue = -1
Const TristateFalse = 0
Const adChar = 129
Const adCmdStoredProc = 4
Const adParamInput = 1
Dim BoolEchoLog
Dim strresponseText
Dim strTmpURLs
Dim strScanDataInfo
Dim strVT_APIurl
Dim inLoopCounter
Dim strOptionalParameter
Dim strDataType
Dim strFullAPIURL
Dim strTmpVendorDetectionName
Dim StrTmpVendorDetectionURL
Dim DicScannedItems: Set DicScannedItems = CreateObject("Scripting.Dictionary")
Dim DicPendingItems: Set DicPendingItems = CreateObject("Scripting.Dictionary")
Dim boolPendingItems
Dim intCountPendItems
Dim strDebugPath
Dim strIPreportsPath
Dim strDomainreportsPath
Dim strURLreportsPath
Dim strHashReportsPath
Dim strAlienVaultreportsPath
DIm boolRescan
Dim BoolMetascan
Dim strAPIKey
Dim strMetaAPIkey
Dim strTempAPIKey
Dim strAPIproduct
Dim BoolDebugTrace
Dim intCountVendors
Dim intCountArrayIP
Dim strScannedItems
Dim strThisScanResults
Dim StrWebScanResults
Dim strDomainFromURL
Dim strTIScanResults
Dim strIPlinks
Dim strDomainLinks
Dim strMetaReportsPath
Dim strTempEncryptedAPIKey
Dim StrProcessedMetaScanIPreturn
Dim strThreatGRID_Output
Dim strTmpReturnedMetaScanIPData
Dim arrayTmpMetaScanIPResults
Dim StrIPMetaScanFormatted
Dim StrRBL_Results
DIm strMetaScanOnlineAssessments
Dim strMetaScanOnlineGeoIP
DIm strRandom
Dim BoolRunSilent
Dim boolsubmitVT
Dim dictNoSubmit: Set dictNoSubmit = CreateObject("Scripting.Dictionary")'stuff not to submit to VT if not already there
Dim dictNoDomainSubmit: set dictNoDomainSubmit = CreateObject("Scripting.Dictionary")'stuff not to submit to VT if not already there
Dim dictIPreported: set dictIPreported = CreateObject("Scripting.Dictionary")'IP addresses reported on already
Dim dictTLD: set dictTLD = CreateObject("Scripting.Dictionary")'Top Level Domains for Whois parent domain identification
Dim dictFileExt: Set dictFileExt = CreateObject("Scripting.Dictionary")
Dim DictHashAssociation: set DictHashAssociation = CreateObject("Scripting.Dictionary")'hash correalation
Dim BoolReportWebScan
Dim BoolUseThreatGRID
Dim BoolUseThreatGRID_IP'Manual setting
DIm BoolUseCIF
Dim strTGAPIkey
Dim strCIF_APIkey
Dim StrTmpRBLOutput
Dim strCIFoutput
Dim intTGpageLimit
Dim BoolDNS_BLchecks
Dim intTabCounter
Dim intWriteRowCounter
Dim strTmpSSline 'temporary spreadsheet line
Dim strTmpVTTIlineE 'temporary line item for spreadsheet
Dim strTmpCBLlineE 'temporary line item for spreadsheet
Dim strTmpCudalineE 'temporary line item for spreadsheet
Dim strTmpZENlineE 'temporary line item for spreadsheet
Dim strDomainListOut 'temporary line item for spreadsheet
Dim strDFSlineE 'temporary line item for spreadsheet
Dim strTmpURIBLlineE
Dim enableSURBL
Dim strTmpSURbLineE
Dim strTmpZDBLlineE
Dim strTmpTGlineE
Dim strTmpCIFlineE
Dim strTmpMSOlineE
Dim strTmpCNlineE: strTmpCNlineE = "|"
Dim strTmpCClineE: strTmpCClineE = "|"
Dim strTmpRNlineE
Dim strTmpRClineE
Dim strTmpCITlineE
Dim strTmpWCO_CClineE
Dim strTmpIPContactLineE
Dim strTmpVTPositvLineE 'greatest value for positive detections
Dim strTmpIPlineE
Dim strTmpCacheLineE 'Was a cached lookup CacheLookup. For domains this will contain LastUpDate from SQLite
Dim strTmpMalShareLineE
Dim strTmpPulsediveLineE
Dim BoolNoScanning
Dim strRevDNS
Dim BoolDisableVTlookup
Dim BooWhoIsIPLookup
Dim BoolNSRLLookup
Dim Dictripe: Set Dictripe = CreateObject("Scripting.Dictionary")
Dim DicDomainIPmatch: Set DicDomainIPmatch = CreateObject("Scripting.Dictionary")
Dim DictArin: Set DictArin = CreateObject("Scripting.Dictionary")
Dim DictAPNIC: Set DictAPNIC = CreateObject("Scripting.Dictionary")
Dim DictLACNIC: Set DictLACNIC = CreateObject("Scripting.Dictionary")
Dim DictAFRINIC: Set DictAFRINIC = CreateObject("Scripting.Dictionary")
Dim DictDDNS: Set DictDDNS = CreateObject("Scripting.Dictionary")
Dim DictCC: Set DictCC = CreateObject("Scripting.Dictionary")
Dim DictRevCC: Set DictRevCC = CreateObject("Scripting.Dictionary")
Dim strDDNS_Output
Dim strDDNSLineE
Dim BoolDDNS_Checks
Dim boolUseThreatCrowd
Dim boolUseAlienVault
Dim BoolUseETIntelligence: BoolUseETIntelligence = False 'automatically set to true if API key is loaded
DIm strTCrowd_Output 'Threat Crowd
Dim strTMPTCrowdLine 'Threat Crowd
Dim strPPoint_Output
Dim intVTListDataType' 0=unknown, 1 domain/IP, 2=hash, 3=hash/domain/ip
Dim intHashDetectionsLineE 'VirusTotal hash positive detections
Dim DictMicrosoftEncyclopedia: Set DictMicrosoftEncyclopedia = CreateObject("Scripting.Dictionary")
Dim DictTrendMicroEncyclopedia: Set DictTrendMicroEncyclopedia = CreateObject("Scripting.Dictionary")
Dim DictMcAfeeEncyclopedia: Set DictMcAfeeEncyclopedia = CreateObject("Scripting.Dictionary")
Dim DictSophosEncyclopedia: Set DictSophosEncyclopedia = CreateObject("Scripting.Dictionary")
Dim DictSymantecEncyclopedia: Set DictSymantecEncyclopedia = CreateObject("Scripting.Dictionary")
Dim DictESETEncyclopedia: Set DictESETEncyclopedia = CreateObject("Scripting.Dictionary")
Dim DictAviraEncyclopedia: Set DictAviraEncyclopedia = CreateObject("Scripting.Dictionary")
Dim DictDrWebEncyclopedia: Set DictDrWebEncyclopedia = CreateObject("Scripting.Dictionary")
Dim DictFSecureEncyclopedia: Set DictFSecureEncyclopedia = CreateObject("Scripting.Dictionary")
Dim DictPandaEncyclopedia: Set DictPandaEncyclopedia = CreateObject("Scripting.Dictionary")
Dim DictBitdefenderEncyclopedia: Set DictBitdefenderEncyclopedia = CreateObject("Scripting.Dictionary")
DIm dictEncyclopediaNegative: Set dictEncyclopediaNegative = CreateObject("Scripting.Dictionary")
Dim dictCountDomains: Set dictCountDomains = CreateObject("Scripting.Dictionary")
Dim intTmpMalScore
Dim IntTmpPUA_Score
Dim IntTmpGenericScore
Dim IntTmpAdjustedMalScore
Dim strTrendMicroLineE
Dim strMicrosoftLineE
Dim strMcAfeeLineE
Dim strSophoslineE
Dim strSymanteclineE
Dim strESETlineE
Dim strAviralineE
Dim strDrWeblineE
Dim boolCheckFSecure
Dim boolCheckPanda
Dim strPandaLineE
Dim strFSecurelineE
Dim strBitdefenderlineE
DIm BoolCreateSpreadsheet
Dim strDateTimeLineE
Dim strDetectNameLineE
Dim strPassiveTotal 'spreadsheet output
Dim DictPUANames: Set DictPUANames = CreateObject("Scripting.Dictionary")
Dim DicTmpDnames: Set DicTmpDnames = CreateObject("Scripting.Dictionary")
Dim DictHktlNames: Set DictHktlNames = CreateObject("Scripting.Dictionary")
Dim DictTypeNames: Set DictTypeNames = CreateObject("Scripting.Dictionary")
Dim DictDSigNames: Set DictDSigNames = CreateObject("Scripting.Dictionary")
Dim DictMalDSigNames: Set DictMalDSigNames = CreateObject("Scripting.Dictionary")
Dim DictPUADSigNames: Set DictPUADSigNames = CreateObject("Scripting.Dictionary")
Dim DictGrayDSigNames: Set DictGrayDSigNames = CreateObject("Scripting.Dictionary")
Dim DictWhiteDSigNames: Set DictWhiteDSigNames = CreateObject("Scripting.Dictionary")
Dim DictPathVendorStat: Set DictPathVendorStat = CreateObject("Scripting.Dictionary")
Dim DictMalHash: set DictMalHash = CreateObject("Scripting.Dictionary")
Dim DictWhiteHash: set DictWhiteHash = CreateObject("Scripting.Dictionary")
Dim DictOrgWhois: Set DictOrgWhois = CreateObject("Scripting.Dictionary")
Dim DictWhois: Set DictWhois = CreateObject("Scripting.Dictionary")
Dim DictAlpabet: Set DictAlpabet = CreateObject("Scripting.Dictionary")
Dim IntTmpHkTlScore
Dim StrDetectionTypeLineE ' VirusTotal and Cuckoo
Dim strTmpSinkHole 'domain has been sinkholed
Dim BoolWhoisDebug: BoolWhoisDebug = False 'value is loaded from ini
Dim BoolForceWhoisLocationLookup 'VirusTotal doesn't always list location data such as the country code in their whois data.
Dim BoolDisableCacheLookup
Dim BoolDisableCaching
Dim intCIFlog
Dim BoolUseExcel
Dim strSSfilePath
Dim intVTErrorCount: intVTErrorCount = 0
Dim BoolUseCarbonBlack: BoolUseCarbonBlack = False
Dim BoolLimitCBQueries 'if a custom CSV export was feed to the script don't lookup API for known CSV items and rely on CSV data
Dim BoolEnableCarbonBlack
Dim StrBaseCBURL
Dim StrBaseCBCURL
Dim strCBfilePath 'CB File Path
Dim strCBdigSig 'CB Digital Sig
Dim strCBcompanyName 'CB Company Name
Dim strCBproductName 'Product Name
Dim strCBprevalence: strCBprevalence = 0 'Carbon Black Host Count
Dim strSiblingsCount: strSiblingsCount = 0 'domain/ip sibling count provided by import SS
Dim strCBFileSize ' Carbon Black file size
DIm strCarBlackAPIKey
Dim BoolEnableThreatGRID
Dim BoolEnableCIF
dim BoolEnableMetascan
Dim boolEnableMalShare
Dim BoolDisableCBCachLookup
Dim intPublisherLoc: intPublisherLoc = -1
Dim intCompanyLoc: intCompanyLoc = -1
Dim intMD5Loc
Dim intDomainLoc
Dim intHostLocation
Dim inthfPathLoc: inthfPathLoc = -1
Dim dateTimeLoc: dateTimeLoc = -1
Dim inthfProductLoc: inthfProductLoc = -1
Dim inthfSizeLoc: inthfSizeLoc = -1
Dim inthfPrevalenceLoc: inthfPrevalenceLoc = -1
Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim BoolHeaderLocSet: BoolHeaderLocSet = False
Dim intCSVRowLocation
Dim dicHashLoc: Set dicHashLoc = CreateObject("Scripting.Dictionary")'Hash location in CSV import - is used for all hash values (MD5, SHA1, SHA256)
Dim ArraySigCheckData()
Dim BoolSigCheckLookup
Dim BoolEnCaseLookup: BoolEnCaseLookup = False
Dim BoolRecordVendorPathStats 'Record vendor match to path statistics
Dim int_CBFP_Location
Dim intCBDS_Location
Dim intCBCN_Location
Dim strStatsOutput
Dim BoolAddStats 'Add Digital Signature Prevalence and Path Vendor Prevalence to CSV/spreadsheet output.
Dim boolSHA256csvLookup 'perform lookups against CSV input for SHA256 hashes. Required for NetAMP
Dim intVTpositiveDetections 'Number of VirusTotal positive detections
Dim boolEchoError
Dim boolNetAMPCSV 'Is a CSV export from NetAMP being used
Dim boolEnableCuckoo
Dim strCuckooScore
Dim strCuckooIPAddress
Dim strSigCheckFilePath
Dim strQueueParameters
Dim strDateLookupTrack 'track how long processing takes and subtract that time from the sleep lookup regulator
Dim boolSQLcache
DIm intRealMD5Loc
Dim intSHA256Loc
Dim intSHA1Loc
Dim intIMPLoc
Dim strFileMD5
Dim strFileSHA256
Dim strFileSHA1
Dim strFileIMP
Dim strCachePath
Dim strTLDPath
Dim strTmpPPointLine
Dim strETIntelligenceAPIKey
Dim strSQL_Intelligence_Output
Dim boolUseMySQL
Dim boolMySQLcache
Dim oCNCT_MySQL
Dim boolOutputHosts
Dim boolEnablePassiveTotal
Dim strPTAPIuser 'user name for PassiveTotal API
Dim strPTAPIkey 'PassiveTotal API key
Dim BoolUsePassiveTotal
Dim strPTdateTrack 'Date of last 15 PassiveTotal lookups
Dim strCategoryLineE
dim strWAPIkey
Dim boolEnableWhoAPI
Dim strWAPIdateTrack 'time tracking to comply with the WhoAPI one lookup a minute API limit
Dim BoolDebugDomainSQL: BoolDebugDomainSQL = False
Dim intWhoAPILimit
Dim strPE_TimeStamp
Dim StrYARALineE
Dim strFileTypeLineE
Dim strMimeTypeLineE
Dim intTGerrorCount
Dim boolTGwasEnabled
Dim intDelayBetweenLookups
Dim intPTlookupCount: intPTlookupCount = 0 ' count of PassiveTotal lookups
Dim intPTDailyLimit
Dim boolCheckDrWeb
Dim boolCheckAvira
Dim boolCheckSymantec
Dim strPPidsLineE
Dim DetectionNameSSlineE
Const dictKey = 1
Const dictItem = 2
Dim intDetectionNameCount
Dim intDetectionCategory
Dim intHashlookupCount'tracks number of hask lookups for detection name association with IP/domain
Dim intaddDNameCount 'amplification for number of columns for hash IP/domain association
Dim dictDnameWatchList: set dictDnameWatchList = CreateObject("Scripting.Dictionary")
Dim dictKWordWatchList: set dictKWordWatchList = CreateObject("Scripting.Dictionary") 'key words used for AlienVault text search
Dim strDnameWatchLineE
Dim intHashPositiveThreashold 'used to limit hash lookups for hash IP/domain association where there are less detections than this number
Dim dictURLWatchList: set dictURLWatchList = CreateObject("Scripting.Dictionary")
Dim strURLWatchLineE
Dim BoolURLWatchLlistRegex
Dim dictIPdomainWatchList: set dictIPdomainWatchList = CreateObject("Scripting.Dictionary") 'used in function MatchIpDwatchLIst
Dim strIpDwatchLineE
dim ArrayDnameLineE()'dim array used for storing detection names associated with domain/IP
Dim strWhoAPIRUL: strWhoAPIRUL = "http://api.whoapi.com/?"
Dim BoolEnableDomainAPI
Dim strDomainAPIURL: strDomainAPIURL = "http://api.freedomainapi.com/?"
Dim BoolEnableTIA
Dim strTIAkey
Dim boolCheckBitdefender
dim tmpArrayPointer()
Dim strtmpVendQueue 'contains the list of TIA items to look up
Dim boolEnableTIAqueue
DIm boolPendingTIAItems
Dim dictUrlOut: Set dictUrlOut = CreateObject("Scripting.Dictionary") 'used to track TIA lookups and output URLs to strThisScanResults
Dim BoolSkipedVTlookup 'If true a cached VT result was pulled
Dim sleepOnSkippedVT 'Set to true to sleep when a VT result was skipped
DIm boolCheckSophos
Dim boolCHeckMcAfee
Dim boolCheckMicrosoft
Dim BoolCheckTrendMicro
Dim boolCheckESET
Dim AlienVaultPulseLine
Dim AlienVaultValidation
Dim AlienVaultHashCount
Dim boolCacheVTNoExist
Dim cudaDNS
Dim zenDNS
Dim uriblDNS
Dim surbl
Dim abuseatDNS
Dim boolDisableDomain_BLchecks
Dim boolDisableAlienVaultWhoIs
Dim useAlienVapiKey: useAlienVapiKey = True
Dim strAlienVaultkey
DIm enableZEN
Dim enableSORBS
Dim strSORBSlineE
Dim enableURIBL
Dim EnableCBL
Dim boolEnableZDBL
Dim EnableBarracuda
Dim CIFurl
Dim boolAlienVaultPassiveDNS
Dim strQuad9DNS
Dim boolUseQuad9
Dim boolAlienVaultNIDS
Dim boolAlienVaultMalware
Dim boolIncludeAVHashCount
Dim AlienNIDS
Dim AlienNIDScount
Dim AlienNIDSCat
Dim dictNIDScategory: set dictNIDScategory = CreateObject("Scripting.Dictionary")
Dim dictNIDSsigName: set dictNIDSsigName = CreateObject("Scripting.Dictionary")
Dim dictNIDStmpCategory: set dictNIDStmpCategory = CreateObject("Scripting.Dictionary")
Dim dictGenericLabel: set dictGenericLabel = CreateObject("Scripting.Dictionary")
Dim dictTrancoList: set dictTrancoList = CreateObject("Scripting.Dictionary")
Dim DictBlank: Set DictBlank = CreateObject("Scripting.Dictionary") 'blank dictionary
Dim dictCSVFeed: Set dictCSVFeed = CreateObject("Scripting.Dictionary")
Dim boolUseTrancoList
Dim boolSkipOnTrancoHit
Dim boolSkipDomain: boolSkipDomain = False 'skip lookups when domain matched Tranco list
Dim boolSigCheckDebug: boolSigCheckDebug = false
Dim SorbsDNS
Dim enableFreeGeoIP
Dim boolIniNotify: boolIniNotify = True 'Only notify once of ini not existing
Dim strTmpKeyWordWatchList 'Watch list for AlienVault keyword search
Dim strCIFconfidence
Dim boolAlienHostCheck
Dim DisplayVendor 'Vendor name to output all detection names for
Dim strDiplayVendDname 'Output string for Diplay vendor detection name
Dim dictFamilyNames: set dictFamilyNames = CreateObject("Scripting.Dictionary") 'Tracking of known family names
Dim intClippingLevel 'clipping level score for detection name output in IP/Domain mode
Dim BoolCacheRelatedHashLookups 'domain and IP address associated hashes
Dim boolDisableSQL_IQ: boolDisableSQL_IQ = True 'Unimplemented feature SQL_Intelligence_Query
Dim boolUseRIPE
dim boolUseARIN
Dim SignatureDateCheck
Dim intSigDateRange
Dim strCAPEport
Dim UniqueString
Dim boolLogURLs 'Output URLs associated with the lookup items.
Dim boolLogReferenceURLs 'Out URLs to reference material
Dim boolLogIPs 'Output IP addresses associated with the lookup items.
Dim boolLogIOCs 'Log potential IOCs
Dim boolEnableCuckooV2 'Perform API queries for hashes against Cuckoo v2
Dim strCuckooV2IPAddress 'Cuckoo v2 host or IP address
Dim strCuckooPort 'Cuckoo v2 port
Dim boolLogHashes 'Output hashes associated with the lookup items.
Dim enableIP_DB 'Use internal IP-DB for GeoIP
Dim strReportsPath
Dim boolTrancoSQL: boolTrancoSQL = True
Dim sysinternalsWhois 'Use command line sysinternals whois tool for whois lookups
Dim boolWhoisCache 'Cache whois results
Dim boolVTuseV3 'Use v3 of VirusTotal API
Dim boolVT_V3 'internal setting used to track VT JSON version
Dim etHashLookedUp 'have we looked up hash on Proofpoint ET
Dim tcHashLookedUp 'have we looked up hash on ThreatCrowd
Dim boolCacheDomain 'Database caching for domain lookups
Dim DicIP_Context: Set DicIP_Context = CreateObject("Scripting.Dictionary") 'Seclytics IP Address context
Dim DicFile_Context: Set DicFile_Context = CreateObject("Scripting.Dictionary") 'Seclytics File context
Dim boolPulsedive
Dim PulsediveAPIprompt
Dim BoolSeclytics 'set to true to use Seclytics
Dim sslOrg 'Pulsedive
Dim sslSubject 'Pulsedive
Dim boolIncludeIP_GTMPDNS ' When querying Seclytics for an IP address include GTMPDNS IP addresses. Default value: False
Dim boolOutputPulses ' AlienVault OTX pulse output
Dim inthfSiblingLoc: inthfSiblingLoc = -1
Dim boolDNScom: boolDNScom = True 'use COM object DnsClient
Dim boolStaticIntel: boolStaticIntel = True 'use static intel from https://github.com/stamparm/maltrail
Dim boolProxyFeed
Dim boolMultiFeed
Dim boolAttackerFeed
Dim boolMalwareFeed
Dim boolAddURLsToWatchlistFromIntel
Dim objDnsClient 'COM object for DNS lookups
Dim AddIpResolutionsToQueue 'Passive DNS can provide IP addresses for the domain that can also be looked up. Set to False to only lookup what was provided in vtlist.txt
Dim TrustedBinary: TrustedBinary = false 'boolean for Microsoft Software Catalogue and other trusted sources (VirusTotal only right now)
Dim boolOutputUnicode
Dim intIntelAge 'how far the intel should go back. Different than refresh time period
Dim boolReverseDNS'Perform reverse DNS lookups
Dim strReverseDNS ' Reverse DNS server IP address to use for the lookup
Dim boolDeepIOCmatch ' Perform IOC matching against indirect but related IOCs (Domain hosted at same IP had intel hits)
Dim boolTruncateVTsigner ' Truncate the digital signature provided by VirusTotal to match signers with VTTL known reputation. Truncate the following at the semicolon to be "McAfee, Inc." instead of "McAfee, Inc.; VeriSign Class 3 Code Signing 2010 CA; VeriSign"
Dim cellTruncateLength
Dim strSignTimeStamp
Dim boolShodan
Dim cpesLineE
Dim openPortsLineE
Dim ShodanTags
Dim ShodanVulns
Dim dictCIDR: Set dictCIDR = CreateObject("Scripting.Dictionary") 'used to convert CIDR subnet to dotted quad
Dim dictIPrange: Set dictIPrange = CreateObject("Scripting.Dictionary") 'stores the IP ranges for watchlist (should not be used if we get this into a SQLite table)
Dim dictFeedEnabled: set dictFeedEnabled = CreateObject("Scripting.Dictionary")
Dim base32check: base32check = True
'LevelUp
Dim dictAllTLD: set dictAllTLD = CreateObject("Scripting.Dictionary")
Dim dictSLD: set dictSLD = CreateObject("Scripting.Dictionary")
Dim dictPrev: set DictPrev = CreateObject("scripting.Dictionary")
Dim SecondLevelDict: Set SecondLevelDict = CreateObject("Scripting.Dictionary")
Dim ThirdLevelDict: Set ThirdLevelDict = CreateObject("Scripting.Dictionary")
Dim inputFile
Dim boolNext
Dim boolInvalid
'end LevelUp
'--- Config items
BoolReportOnly = False 'Don't submit to VirusTotal. Report data will come from VirusTotal cache only.
BoolNoScanning = True 'Don't scan anything with VirusTotal. Scanning something provides the scanned item publicly. Default is True preventing scanning.
BoolDisableVTlookup = False 'Don't perform VirusTotal lookups. Default is False. Setting to True breaks some functionality
sleepOnSkippedVT = True 'Default value is True. Set to False if only VirusTotal API is being used. Set to true to sleep when a VirusTotal result was pulled from cache. Setting True prevents overwhelming other APIs.
intDelayBetweenLookups = 15052 'miliseconds to wait between each lookup (default 15052 one lookup every 15 seconds), 4052 AlienVault with API Key
boolCacheVTNoExist = False 'Cache VirusTotal has does not exist results. Default value is False
BoolDisableCacheLookup = False 'Do not query cache for lookups
BoolDisableCaching = False ' Do not write cache items
boolCacheDomain = false 'Cache domain lookups
intHashCacheThreashold = 900 'number of days to use a cached return before refreshing. Anything older than this will not be refreshed. Default set to same as intCacheRefreshLimit
intCacheRefreshLimit = 900 'number of days back that a refresh is allowed. Anything older than this will not be refreshed.
intRefreshAge = -1 'Number of days from fist time seeing the hash that you want to refresh the cache data (get updated results) for processed items. Default value is 10
BoolRecordVendorPathStats = True 'Record vendor match to path statistics. Set to False to prevent recording unwanted statistics
BoolAddStats = True 'Adds statistics for processed hashes. Default value is True
BoolCreateSpreadsheet = True 'creates CSV output. Default is True
BoolUseExcel = False 'Default value is false to disable the use of Excel.
BoolAddStats = True 'Add Digital Signature Prevalence and Path Vendor Prevalence to CSV/spreadsheet output. Must have recorded data \cache\digsig.dat and \cache\pathvend.dat
BoolUseSQLite = True 'Store data in SQLite vs the file system.
boolUseMySQL = False 'This was a test feature. Do not enable
strDatabasePath = "vttl.db" 'Default is vttl.db which will exist in current directory.
boolOutputHosts = False 'Set to True to have the script import/export Carbon Black host names associated with a hash
boolNoCrLf = True 'Remove carriage return and line feed from cell entries.
boolLogURLs = True 'Log URLs associated with an IP/Domain
boolLogReferenceURLs = True 'Log reference URLs
boolLogIOCs = True 'Log associated IOCs
boolLogHashes = True 'Output URLs and hashes associated with the lookup items. (outputs from VirusTotal and Seclytics)
boolLogIPs = True 'Output IP addresses associated with the lookup items.
AddIpResolutionsToQueue = True 'Passive DNS can provide IP addresses for the domain that can also be looked up. Set to False to only lookup what was provided in vtlist.txt
boolOutputUnicode = False 'Default output encoding is ANSI. You may need utf-16 depending on what data gets imported into the script
boolDeepIOCmatch = True 'Perform IOC matching against indirect but related IOCs (Domain hosted at same IP had intel hits)
boolTruncateVTsigner = True ' Truncate the digital signature provided by VirusTotal to match signers with VTTL known reputation. Truncate the following at the semicolon to be "McAfee, Inc." instead of "McAfee, Inc.; VeriSign Class 3 Code Signing 2010 CA; VeriSign"
cellTruncateLength = 8000 'Truncate cell value length. Default 8000. Max 32767
'--- Intenal checks
BoolURLWatchLlistRegex = True 'set to true to enable regex for URL watch list. False will match the string
BoolDDNS_Checks = True 'Dynamic DNS check
boolUseTrancoList = True 'Check domains against https://tranco-list.eu
boolSkipOnTrancoHit = True 'Skip VirusTotal lookups when domain match against https://tranco-list.eu
sysinternalsWhois = False 'Use command line sysinternals whois tool for whois lookups
BooWhoIsIPLookup = True 'Use NirSoft whosip external lookup tool
boolWhoisCache = False 'Cache whois results
boolReverseDNS = True 'Perform reverse DNS lookups
strReverseDNS = "" ' Reverse DNS server IP address to use for the lookup. Set to empty string to use default DNS server
staticIntelPath = "\static" 'path to static intelligence https://github.com/stamparm/maltrail
'--- VirusTotal custom checks
intDetectionNameCount = 1 'Set greater than zero to enable reporting on detection names associated with domain/IP. set to zero to disable.
intDetectionCategory = 2 'associated with domain/IP category to use: detected_downloaded_samples=0, detected_referrer_samples=1, detected_communicating_samples=2
intHashPositiveThreashold = 9 'Positive detection threshold to perform hash lookups for IP/domain association. Will only report on detections above the threshold.
boolVTuseV3 = True
'--- DNS vendor checks
enableZEN = True
enableURIBL = True
EnableCBL = True
boolEnableZDBL = True
EnableBarracuda = True
enableSURBL = True
enableSORBS = True
boolUseQuad9 = True
BoolDNS_BLchecks = True 'Perform DNS block list checks
boolDisableDomain_BLchecks = False 'Disables uribl and surbl. Default value is True
cudaDNS = ""
zenDNS = ""
uriblDNS = ""
surblDNS = ""
abuseatDNS = ""
'--- Feed vendors
boolProxyFeed = false
boolMultiFeed = false
boolAttackerFeed = false
boolMalwareFeed = False
boolAddURLsToWatchlistFromIntel = False
intIntelAge = 30 'Days how far the intel should go back. 1, 7, 30, or use zero to grab most recent. Default is 30. Use 31 or greater to grab lists that are no longer updated. Different than refresh time period
'--- API vendor lookup config section
boolUseRIPE = True ' Réseaux IP Européens (RIPE NCC) API
boolUseARIN = True 'American Registry for Internet Numbers (ARIN) API
boolEnableCuckoo = False 'Perform API queries for hashes against CAPE
strCuckooIPAddress = "" 'CAPE host or IP address
strCAPEport = "" 'CAPE port
boolEnableCuckooV2 = False'Perform API queries for hashes against Cuckoo v2
strCuckooV2IPAddress = "" 'Cuckoo v2 host or IP address
strCuckooPort = "" 'Cuckoo v2 port
BoolUseThreatGRID_IP = False 'Perform ThreatGRID IP address lookup
intTGpageLimit = 10 'Default seemed to be giving 10,000 pages of data / hundreds of MB of data so restrict this with a low number
boolUseThreatCrowd = True 'Threat Crowd threshold is six lookups a minute.
boolUseAlienVault = True 'AlienVault lookups
boolDisableAlienVaultWhoIs = False 'Disable whois lookups with AlienVault OTX. Default is False.
boolAlienVaultPassiveDNS = True 'Use AlienVault passive DNS lookup API. Default is True
boolAlienVaultNIDS = True ' Use AlienVault NIDS API. Requires API Key
boolAlienVaultMalware = True 'Malware samples related to a domain or IP address
boolIncludeAVHashCount = True 'Count of hashes
boolAlienHostCheck = True ' Use AlienVault to get host names
boolOutputPulses = True ' Log pulse name and description
boolEnableETIntelligence = False 'Emerging threats from Proofpoint
BoolForceWhoisLocationLookup = True 'disable this if domain whois location information is not required. Domain location information is populated by whois and IP address location data is populated by GeoIP.
intCIFlog = "1" 'set to 1 to disable CIF logging the query. Set to 0 to enable CIF logging the query.
strCIFconfidence = "0" 'lowest CIF rated confidence to return.
strCIFurl = "" ' URL to use for CIF requests (supports v2 currently) example: https://domain.com/indicators
BoolEnableCIF = True 'Perform queries against CIF. Disabled if no API key provided
BoolEnableCarbonBlack = True 'Perform queries for md5 against Carbon Black. Disabled if no API key and URL provided
BoolEnableCBenterpriseEDR = True 'Perform API queries against SHA256 values in Carbon Black Enterprise EDR
BoolDisableCBCachLookup = True 'Default value is True. Prevents getting CB results from cache
BoolLimitCBQueries = True 'Default is True. If a custom CSV export was feed to the script; rely on CSV data and don't lookup API for known CSV items. Set to False to perform queries against CB regardless of CSV data.
BoolEnableThreatGRID = True 'Perform queries against ThreatGRID. Disabled if no API key provided
BoolEnableMetascan = False 'Disabled due to API changes. Disabled if no API key provided
boolEnableMalShare = True 'Perform queries against malshare.com. Disabled if no API key provided
boolEnablePassiveTotal = True 'Perform queries for publisher on PassiveTotal.
intPTDailyLimit = 100 'Number of PassiveTotal queries allowed in a day. Default is 100.
enableFreeGeoIP = False 'Run SubmitGIP
enableIP_DB = True 'Use internal IP-DB for GeoIP
boolEnableWhoAPI = False 'Enable WhoAPI whois lookups
BoolEnableDomainAPI = True 'Enable freedomainapi.com
intWhoAPILimit = 60 'Number of seconds to wait between lookups. Set to 60 for one lookup a minute. 30 for two lookups a minute.
boolCheckProofpointIDS = False 'Check for ET IDS signatures related to the lookups
BoolEnableTIA = True 'Use Threat Intelligence Aggregator
boolEnableTIAqueue = False 'Queue output rows where TIA lookups did not have results available yet. Enabling ensures all detection name results are given from TIA. One side effect is row output may not be in the same order as the provided hash list. May have issues if missing required .net component.
SignatureDateCheck = True 'Alert if any dates from TIA for signature are within intSigDateRange
intSigDateRange = 3 'Date range in days to alert on signature dates from TIA
boolCheckFSecure = True 'Lookup F-Secure write-ups via Threat Intelligence Aggregator
boolCheckBitdefender = True 'Lookup Bitdefender write-ups via Threat Intelligence Aggregator
boolCheckPanda = True 'Lookup Panda write-ups via Threat Intelligence Aggregator
boolCheckSophos = True 'Lookup write-ups via Threat Intelligence Aggregator
boolCHeckMcAfee = True 'Lookup write-ups via Threat Intelligence Aggregator
boolCheckMicrosoft = True 'Lookup write-ups via Threat Intelligence Aggregator
BoolCheckTrendMicro = True 'Lookup write-ups via Threat Intelligence Aggregator
boolCheckDrWeb = True 'Check for Dr Web write-up (requires TIA API)
boolCheckAvira = True 'Check for Avira write-up (requires TIA API)
boolCheckSymantec = True 'Check for Symantec write-up (requires TIA API)
boolCheckESET = True 'Lookup write-ups via Threat Intelligence Aggregator
BoolNSRLLookup = False 'Public service is for demo purposes only. Need to stand up your own server and modify to query it.
BoolSeclytics = False 'set to true to use Seclytics
boolPulsedive = False 'Set to true to use Pulsedive
PulsediveAPIprompt = True 'Prompt for Pulsedive API key
SeclytRepReason = "" 'Seclytics Reputation and Reason
SeclytFileRep = "" 'Seclytics Associated File Metadata
SeclytFileCount = "" 'Seclytics File Count"
boolIncludeIP_GTMPDNS = False ' When querying Seclytics for an IP address include GTMPDNS IP addresses. Default value: False
DisplayVendor = "" 'Add column to display all of this vendor's detection names. Example: BitDefender
intClippingLevel = 2 'Domain/IP reporting for detection name will report on name label with score greater than this
BoolCacheRelatedHashLookups = True
boolSiblings = True
boolShodan = True
'--- End config items
'----------------reconfigure
intDelayBetweenLookups = ValueFromINI("vttl.ini", "main", "time_between_lookups", intDelayBetweenLookups) 'load value from INI
if isnumeric(intDelayBetweenLookups) = False then 'check value from INI
msgbox "intDelayBetweenLookups must be a numeric value:" & intDelayBetweenLookups
wscript.quit (22)
end if
if intDelayBetweenLookups < 10000 then
boolUseThreatCrowd = False 'disable when beyond vendor provided threshold
boolEnableMalShare = False 'only provides threshold for downloads but disabling to be safe
end if
BoolDisableCaching = ValueFromINI("vttl.ini", "main", "disable_CacheWrite", BoolDisableCaching) ' Do not write cache items
BoolDisableCacheLookup = ValueFromINI("vttl.ini", "main", "disable_CacheRead", BoolDisableCacheLookup) 'Do not query cache for lookups
boolWhoisCache = ValueFromINI("vttl.ini", "main", "whoisCache", boolWhoisCache) 'Cache whois data for domains
boolCacheDomain = ValueFromINI("vttl.ini", "main", "DomainCache", boolCacheDomain) 'Cache domain lookups
BoolUseExcel = ValueFromINI("vttl.ini", "main", "enable_Excel", BoolUseExcel) 'load value from INI
sleepOnSkippedVT = ValueFromINI("vttl.ini", "main", "SleepOnCachedLookup", sleepOnSkippedVT) 'load value from INI to sleep if VirusTotal results came from cache
intRefreshAge = ValueFromINI("vttl.ini", "main", "HashRefresh", intRefreshAge) 'Number of days from first time seeing the hash that you want to refresh the cache data (get updated results) for processed items. Default value is 10
intIntelAge = ValueFromINI("vttl.ini", "main", "FeedAgeLimit", intIntelAge) 'Days how far the intel should go back. 1, 7, 30, or use zero to grab most recent. Default is 30. Use 31 or greater to grab lists that are no longer updated. Different than refresh time period
strDatabasePath = ValueFromINI("vttl.ini", "main", "database_location", strDatabasePath) 'Path to VTTL database
boolOutputUnicode = ValueFromINI("vttl.ini", "main", "output_unicode", boolOutputUnicode) 'Encoding to use for log/file output
boolReverseDNS = ValueFromINI("vttl.ini", "main", "reverseDNS", boolReverseDNS) 'Perform reverse DNS lookups
boolDeepIOCmatch = ValueFromINI("vttl.ini", "main", "deepIOCmatch", boolDeepIOCmatch)
staticIntelPath = ValueFromINI("vttl.ini", "main", "StaticIntelPath", staticIntelPath)
BoolDisableVTlookup = ValueFromINI("vttl.ini", "vendor", "disable_VirusTotal", BoolDisableVTlookup) 'load value from INI
boolShodan = ValueFromINI("vttl.ini", "vendor", "enable_Shodan", boolShodan) 'load value from INI
boolUseAlienVault = ValueFromINI("vttl.ini", "vendor", "enable_AlienVault", boolUseAlienVault)
boolProxyFeed = ValueFromINI("vttl.ini", "vendor", "ProxyFeed", boolProxyFeed) 'load value from INI
boolMultiFeed = ValueFromINI("vttl.ini", "vendor", "MultiFeed", boolMultiFeed) 'load value from INI
boolAttackerFeed = ValueFromINI("vttl.ini", "vendor", "AttackerFeed", boolAttackerFeed) 'load value from INI
boolMalwareFeed = ValueFromINI("vttl.ini", "vendor", "MalwareFeed", boolMalwareFeed) 'load value from INI
boolAddURLsToWatchlistFromIntel = ValueFromINI("vttl.ini", "vendor", "WatchIntelURLs", boolAddURLsToWatchlistFromIntel) 'load value from INI
boolStaticIntel = ValueFromINI("vttl.ini", "vendor", "StaticIntel", boolStaticIntel ) 'use static intel from https://github.com/stamparm/maltrail
boolDisableAlienVaultWhoIs = ValueFromINI("vttl.ini", "vendor_AlienVault", "disable_whois", boolDisableAlienVaultWhoIs) 'Disable whois lookups with AlienVault OTX. Default is False.
boolAlienVaultPassiveDNS = ValueFromINI("vttl.ini", "vendor_AlienVault", "enable_passiveDNS", boolAlienVaultPassiveDNS) 'Use AlienVault passive DNS lookup API. Default is True. populates hosted domain column
boolIncludeAVHashCount = ValueFromINI("vttl.ini", "vendor_AlienVault", "enable_HashCount", boolIncludeAVHashCount) 'Add CSV output column for hash count
boolAlienVaultMalware = ValueFromINI("vttl.ini", "vendor_AlienVault", "enable_MalwareReporting", boolAlienVaultMalware) 'Output hashes to IOCs CSV
boolAlienVaultNIDS = ValueFromINI("vttl.ini", "vendor_AlienVault", "enable_NIDS", boolAlienVaultNIDS) ' Use AlienVault NIDS API. Requires API Key
useAlienVapiKey = ValueFromINI("vttl.ini", "vendor_AlienVault", "use_AlienVaultAPIkey", useAlienVapiKey) ' Prompt for and use AlienVault API Key
boolAlienHostCheck = ValueFromINI("vttl.ini", "vendor_AlienVault", "enable_HostDetection", boolAlienHostCheck) ' Use AlienVault to populate hosted domain column (has hosts passive DNS does not)
BoolEnableTIA = ValueFromINI("vttl.ini", "vendor", "enable_TIA", BoolEnableTIA) 'Use Threat Intelligence Aggregator (TIA)
SignatureDateCheck = ValueFromINI("vttl.ini", "vendor", "TIA_DateCheck", SignatureDateCheck)'Alert if any dates from TIA for signature are within intSigDateRange
intSigDateRange = ValueFromINI("vttl.ini", "vendor", "TIA_DateRange", intSigDateRange) 'Date range in days to alert on signature dates from TIA
BoolEnableCarbonBlack = ValueFromINI("vttl.ini", "vendor", "enable_CarbonBlack", BoolEnableCarbonBlack)
BoolEnableCBenterpriseEDR = ValueFromINI("vttl.ini", "vendor", "enable_CarbonBlackEnterprise", BoolEnableCBenterpriseEDR)
CBCorgKey = ValueFromINI("vttl.ini", "vendor", "CarbonBlackOrgKey", CBCorgKey)
BoolEnableThreatGRID = ValueFromINI("vttl.ini", "vendor", "enable_ThreatGRID", BoolEnableThreatGRID)
enableZEN = ValueFromINI("vttl.ini", "vendor", "enable_ZEN", enableZEN)
enableURIBL = ValueFromINI("vttl.ini", "vendor", "enable_URIBL", enableURIBL)
boolEnableZDBL = ValueFromINI("vttl.ini", "vendor", "enable_ZDBL", boolEnableZDBL)
EnableBarracuda = ValueFromINI("vttl.ini", "vendor", "enable_Barracuda", EnableBarracuda)
enableSURBL = ValueFromINI("vttl.ini", "vendor", "enable_SURBL", enableSURBL)
enableSORBS = ValueFromINI("vttl.ini", "vendor", "enable_SORBS", enableSORBS)
boolUseQuad9 = ValueFromINI("vttl.ini", "vendor", "enable_Quad9", boolUseQuad9)
boolEnableMalShare = ValueFromINI("vttl.ini", "vendor", "enable_MalShare", boolEnableMalShare)
boolEnableWhoAPI = ValueFromINI("vttl.ini", "vendor", "EnableWhoAPI", boolEnableWhoAPI)
BoolEnableDomainAPI = ValueFromINI("vttl.ini", "vendor", "EnableDomainAPI", BoolEnableDomainAPI)
boolEnablePassiveTotal = ValueFromINI("vttl.ini", "vendor", "EnablePassiveTotal", boolEnablePassiveTotal)
boolEnableETIntelligence = ValueFromINI("vttl.ini", "vendor", "UseETIntelligence", boolEnableETIntelligence)
BoolUseCIF = ValueFromINI("vttl.ini", "vendor", "UseCIF", BoolUseCIF)
sysinternalsWhois = ValueFromINI("vttl.ini", "vendor", "SysinternalsWhois", sysinternalsWhois)
BooWhoIsIPLookup = ValueFromINI("vttl.ini", "vendor", "NirSoft_WhosIP", BooWhoIsIPLookup)
BoolDNS_BLchecks = ValueFromINI("vttl.ini", "vendor", "enable_BlockLists", BoolDNS_BLchecks) 'Perform DNS block list checks
boolDisableDomain_BLchecks = ValueFromINI("vttl.ini", "vendor", "disable_DomainBlockLists", boolDisableDomain_BLchecks) 'Disables uribl and surbl. Default value is True
cudaDNS = ValueFromINI("vttl.ini", "DNS_Server", "Barracuda", cudaDNS)
zenDNS = ValueFromINI("vttl.ini", "DNS_Server", "zen", zenDNS)
uriblDNS = ValueFromINI("vttl.ini", "DNS_Server", "uribl", uriblDNS)
surblDNS = ValueFromINI("vttl.ini", "DNS_Server", "surbl", surblDNS)
abuseatDNS = ValueFromINI("vttl.ini", "DNS_Server", "abuseat", abuseatDNS)'cbl.abuseat.org
SorbsDNS = ValueFromINI("vttl.ini", "DNS_Server", "SORBS", "")
EnableCBL = ValueFromINI("vttl.ini", "vendor", "enable_CBL", EnableCBL)
BoolEnableCIF = ValueFromINI("vttl.ini", "vendor", "enable_CIF", BoolEnableCIF)
strCIFurl = ValueFromINI("vttl.ini", "vendor", "CIF_URL", strCIFurl)
boolEnableCuckoo = ValueFromINI("vttl.ini", "vendor", "enable_CAPE", boolEnableCuckoo)
strCuckooIPAddress = ValueFromINI("vttl.ini", "vendor", "CAPE_Address", strCuckooIPAddress)
strCAPEport = ValueFromINI("vttl.ini", "vendor", "CAPE_Port", strCAPEport)
boolEnableCuckooV2 = ValueFromINI("vttl.ini", "vendor", "enable_Cuckoo", boolEnableCuckooV2)
strCuckooV2IPAddress = ValueFromINI("vttl.ini", "vendor", "Cuckoo_Address", strCuckooV2IPAddress)
strCuckooPort = ValueFromINI("vttl.ini", "vendor", "Cuckoo_Port", strCuckooPort)
DisplayVendor = ValueFromINI("vttl.ini", "VirusTotal", "DisplayVendor", DisplayVendor) '
boolUseRIPE = ValueFromINI("vttl.ini", "vendor", "UseRIPE", boolUseRIPE)
boolUseARIN = ValueFromINI("vttl.ini", "vendor", "useARIN", boolUseARIN)
enableFreeGeoIP = ValueFromINI("vttl.ini", "vendor", "useFreeGeoIP", enableFreeGeoIP)
boolLogURLs = ValueFromINI("vttl.ini", "vendor", "LogURLs", boolLogURLs)
boolLogHashes = ValueFromINI("vttl.ini", "vendor", "LogHashes", boolLogHashes)
boolLogIPs = ValueFromINI("vttl.ini", "vendor", "LogIPs", boolLogIPs)
boolLogIOCs = ValueFromINI("vttl.ini", "vendor", "LogIOCs", boolLogIOCs)
boolLogReferenceURLs= ValueFromINI("vttl.ini", "vendor", "LogReferenceURLs", boolLogReferenceURLs)
boolUseTrancoList = ValueFromINI("vttl.ini", "vendor", "TrancoList", boolUseTrancoList) 'Check domains against https://tranco-list.eu
boolSkipOnTrancoHit = ValueFromINI("vttl.ini", "vendor", "SkipLookupsOnTrancoMatch", boolSkipOnTrancoHit)
BoolSeclytics = ValueFromINI("vttl.ini", "vendor", "useSeclytics", BoolSeclytics)
boolPulsedive = ValueFromINI("vttl.ini", "vendor", "usePulsedive", boolPulsedive)
PulsediveAPIprompt = ValueFromINI("vttl.ini", "vendor", "PulsediveAPIprompt", PulsediveAPIprompt)
BoolURLWatchLlistRegex = ValueFromINI("vttl.ini", "VirusTotal", "UseRegexForURL", BoolURLWatchLlistRegex)
intDetectionNameCount = ValueFromINI("vttl.ini", "VirusTotal", "WebSamplesToCheck", intDetectionNameCount) 'Set greater than zero to enable reporting on detection names associated with domain/IP. set to zero to disable.
intDetectionCategory = ValueFromINI("vttl.ini", "VirusTotal", "WebSampleCategory", intDetectionCategory) 'associated with domain/IP category to use: detected_downloaded_samples=0, detected_referrer_samples=1, detected_communicating_samples=2
intHashPositiveThreashold = ValueFromINI("vttl.ini", "VirusTotal", "WebSamplePositiveThreshold", intHashPositiveThreashold) 'Positive detection threshold to perform hash lookups for IP/domain association. Will only report on detections above the threshold.
boolSiblings = ValueFromINI("vttl.ini", "VirusTotal", "TrackSiblings", boolSiblings) 'IOC tracking for siblings
BoolDebugTrace = ValueFromINI("vttl.ini", "Debug", "trace", BoolDebugTrace)
boolSigCheckDebug = ValueFromINI("vttl.ini", "Debug", "sigcheck", boolSigCheckDebug)
BoolWhoisDebug = ValueFromINI("vttl.ini", "Debug", "Whois", BoolWhoisDebug)' used to do additional messaging and logging to troubleshoot whois and some geolocation
strDebugPath = ValueFromINI("vttl.ini", "Debug", "path", strDebugPath)
on error resume next
set objDnsClient = wscript.createobject("DnsClientCOM.DnsQuery+comReverseLookup")
if err.number <> 0 then
boolDNScom = False
end if
on error goto 0
'----------------end reconfigure
If len(strCAPEport) > 0 then strCAPEport = ":" & strCAPEport
if strCuckooIPAddress = "" then boolEnableCuckoo = False
If len(strCuckooPort) > 0 then strCuckooPort = ":" & strCuckooPort
if strCuckooV2IPAddress = "" then boolEnableCuckooV2 = false
'set types
if isnumeric(intHashPositiveThreashold) then
intHashPositiveThreashold = cint(intHashPositiveThreashold)
else
msgbox "WebSamplePositiveThreshold (intHashPositiveThreashold) is not a numeric value. Script will use 9"
intHashPositiveThreashold = 9
end if
if isnumeric(intDetectionCategory) then
intDetectionCategory = cint(intDetectionCategory)
else
msgbox "WebSampleCategory (intDetectionCategory) is not a numeric value. Script will use 2"
intDetectionCategory = 2
end if
if isnumeric(intDetectionNameCount) then
intDetectionNameCount = cint(intDetectionNameCount)
else
msgbox "WebSamplesToCheck (intDetectionNameCount) is not a numeric value. Script will use 0 to disable lookups"
intDetectionNameCount = 2
end if
'end set types
if isnumeric(intRefreshAge) then 'make sure we are looking back in time for refresh of hash intel
if left(intRefreshAge, 1) <> "-" then
intRefreshAge = cint("-" & intRefreshAge)
end if
end if
boolPendingItems = False
BoolEchoLog = False
boolRescan = False
BoolUseThreatGRID = False
BoolUseCIF = False
boolSHA256csvLookup = False
boolEchoError = True
boolNetAMPCSV = False
if BoolDNS_BLchecks = False then
enableZEN = False
enableURIBL = False
EnableCBL = False
boolEnableZDBL = False
EnableBarracuda = False
enableSORBS = False
end if
if boolDisableDomain_BLchecks = True then
enableURIBL = False
boolEnableZDBL = False
enableSURBL = False
end if
if sleepOnSkippedVT = False then
'disable anything that might get overwhelmed
boolUseThreatCrowd = False
boolEnableMalShare = False 'only provides threshold for downloads but disabling to be safe
end if
'this needs to be after the config section to overide the queue behavior if .net framework 3.5 is not installed
if boolEnableTIAqueue = True then
on error resume next
Dim outQueue: Set outQueue = CreateObject("System.Collections.Queue")
Dim lookupQueue: Set lookupQueue = CreateObject("System.Collections.Queue")
if error.number <> 0 then boolEnableTIAqueue = False
on error goto 0
end if
strRandom = "4bv3nT9vrkJpj3QyueTvYFBMIvMOllyuKy3d401Fxaho6DQTbPafyVmfk8wj1bXF" 'encryption key. Change if you want but can only decrypt with same key
intTabCounter = 1
intWriteRowCounter = 1
'set path strings and create sub folders
CurrentDirectory = GetFilePath(wscript.ScriptFullName)
CreateFolder CurrentDirectory & "\Debug\"
if strDebugPath = "" then strDebugPath = CreateFolder(CurrentDirectory & "\Debug\Operations\")
strIPreportsPath = CreateFolder(CurrentDirectory & "\Debug\IP_Reports")
strDomainreportsPath = CreateFolder(CurrentDirectory & "\Debug\Domain_Reports")
strURLreportsPath = CreateFolder(CurrentDirectory & "\Debug\URL_Reports")
strHashReportsPath = CreateFolder(CurrentDirectory & "\Debug\Hash_Reports")
strMetaReportsPath = CreateFolder(CurrentDirectory & "\Debug\Meta_Reports")
strAlienVaultreportsPath = CreateFolder(CurrentDirectory & "\Debug\AlienVault")
strCachePath = CreateFolder(CurrentDirectory & "\cache")
strIntelPath = CreateFolder(CurrentDirectory & "\cache\intel")
strTLDPath = CreateFolder(CurrentDirectory & "\tld")
strReportsPath = CreateFolder(CurrentDirectory & "\Reports")
strConfigPath = CreateFolder(CurrentDirectory & "\Config")
if staticIntelPath = "" then
if objFSO.folderexists(CurrentDirectory & "\static") then
staticIntelPath = CurrentDirectory & "\static"
end if
else
if objFSO.folderexists(staticIntelPath) then
'all set
elseif objFSO.folderexists(CurrentDirectory & "\" & staticIntelPath) then
staticIntelPath = CurrentDirectory & "\" & staticIntelPath
Else
if instr(staticIntelPath, ":") = 0 Then staticIntelPath = CurrentDirectory & "\" & staticIntelPath
objFSO.createfolder(staticIntelPath)
end if
end if
DIm objShellComplete
Set objShellComplete = WScript.CreateObject("WScript.Shell")
Dim objFile
'debug logging
if objFSO.fileexists(strDebugPath & "\enable") then
BoolDebugTrace = True
end if
' Store the arguments in a variable:
Set objArgs = Wscript.Arguments
boolSQLcache = False
if BoolUseSQLite = True then
if objFSO.fileexists(strDatabasePath) = false then 'use default database if none exists
if objFSO.fileexists("default.db") = True then
objFSO.CopyFile "default.db", strDatabasePath
end if
end if
'SQL Connect
Dim oCS : oCS = "Driver={SQLite3 ODBC Driver};Database=" & strDatabasePath & ";Version=3;"
Dim oCNCT : Set oCNCT = CreateObject( "ADODB.Connection" )
redim preserve ArraySigCheckData(1)
if SQLTestConnect = True then
boolSQLcache = True
else
BoolUseSQLite = False
end if
end if
if BoolUseSQLite = False then
enableIP_DB = False 'Use internal IP-DB for GeoIP
boolTrancoSQL =False
end if
if dictTrancoList.count = 0 and boolTrancoSQL = False then boolUseTrancoList = False
if boolUseMySQL = True then 'Experimental. Do not use
'SQL Connect
Dim oCS_MySQL : oCS_MySQL = "Driver={MySQL ODBC 5.3 ANSI Driver};Server=;" & _
"Database=VTTL; User=; Password=;"
Set oCNCT_MySQL = CreateObject( "ADODB.Connection" )
Set cmdMySQL = createobject("ADODB.Command")
boolMySQLcache = TableCheck
end if
strOutputName = ""
boolFileName = False
if BoolDebugTrace = True then logdata strDebugPath & "\SQL" & "" & ".txt", "boolSQLcache=" & boolSQLcache ,BoolEchoLog
if WScript.Arguments.Count = 0 then
BoolRunSilent = False
else
' all command-line arguments
For Each strArg in objArgs
if BoolDebugTrace = True then logdata strDebugPath & "\VT_Debug" & "_Parameter" & ".txt", "strArg=" & strArg ,BoolEchoLog
select case lcase(strArg)
case "/s"
BoolRunSilent = True
boolEchoError = False
AddQueueParameter("/s")
case "/e"
BoolCreateSpreadsheet = True
BoolUseExcel = True
AddQueueParameter("/e")
case "/g"
BoolSigCheckLookup = True
AddQueueParameter("/g")
case "/a"
BoolEnCaseLookup = True
AddQueueParameter("/a")
case "/p"
boolIPDomainPrev = True
AddQueueParameter("/p")
case "/dcb"
BoolEnableCarbonBlack = false
AddQueueParameter("/dcb")
case "/dxf"
boolUseXforce = false
AddQueueParameter("/dxf")
case "/n"
boolFileName = True
case "/dms"
boolEnableMalShare = False
AddQueueParameter("/dms")
case "/dtc"
boolUseThreatCrowd = False
AddQueueParameter("/dtc")
case "/dav"
boolUseAlienVault = False
AddQueueParameter "/dav"
case "/det"
boolEnableETIntelligence = False
AddQueueParameter("/det")
boolCheckProofpointIDS = False
Case "/dtg"
BoolUseThreatGRID = False
BoolUseThreatGRID_IP = False
BoolEnableThreatGRID = False
AddQueueParameter("/dtg")
Case "/dtia"
BoolEnableTIA = False
case else
if boolFileName = True and left(strArg, 1) <> "/" Then
strOutputName = strArg
else 'file name was not provided as the next argument so discarding the file name config
boolFileName = False
if strSigCheckFilePath = "" then
if objFSO.fileexists(strArg) then
strSigCheckFilePath = lcase(strArg)
else
msgbox "invalid argument: " & strArg
end if
else
msgbox "invalid argument: " & strArg
end if
end if
end select
Next
end if
strStatsOutput = strReportsPath & "\VTTL_WithStats_" & strOutputName & "_" & udate(now) & ".csv"
UniqueString = udate(now)
strSSfilePath = strReportsPath & "\VTTL_" & strOutputName & "_" & UniqueString & ".csv"
if BoolEnCaseLookup = True and BoolSigCheckLookup = True then
StrQuestion = msgbox("The script can only import using certain formats such as EnCase/NetAMP (tab) or SigCheck/Autorunsc (CSV) data. Do you want to perform lookups against EnCase/NetAMP?",4,"VTTL Question")
if StrQuestion = 7 then'no
BoolEnCaseLookup = False
elseif StrQuestion = 6 then'yes
BoolSigCheckLookup = False
else
msgbox "invalid response. Script will now exit"
wscript.quit
end if
end if
if BoolEnCaseLookup = True then 'EnCase export does not provide vendor name
BoolRecordVendorPathStats = False
end if
if BoolDebugTrace = True and BoolRunSilent = False Then
msgbox "debug logging is enabled!"
end if
if BoolNoScanning = False and BoolRunSilent = False Then