virustotal_api 0.4.0 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +26 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +12 -5
- data/CHANGELOG.md +35 -9
- data/README.md +97 -59
- data/lib/virustotal_api.rb +7 -7
- data/lib/virustotal_api/analysis.rb +16 -0
- data/lib/virustotal_api/base.rb +41 -10
- data/lib/virustotal_api/domain.rb +18 -0
- data/lib/virustotal_api/exceptions.rb +3 -0
- data/lib/virustotal_api/file.rb +48 -0
- data/lib/virustotal_api/group.rb +18 -0
- data/lib/virustotal_api/ip.rb +18 -0
- data/lib/virustotal_api/uri.rb +2 -1
- data/lib/virustotal_api/url.rb +38 -0
- data/lib/virustotal_api/user.rb +18 -0
- data/lib/virustotal_api/version.rb +2 -1
- data/test/analysis_test.rb +26 -0
- data/test/base_test.rb +13 -25
- data/test/domain_test.rb +27 -0
- data/test/exceptions_test.rb +22 -0
- data/test/file_test.rb +63 -0
- data/test/fixtures/analysis.yml +544 -0
- data/test/fixtures/domain.yml +830 -0
- data/test/fixtures/file_analyse.yml +52 -0
- data/test/fixtures/file_find.yml +853 -0
- data/test/fixtures/file_not_found.yml +52 -0
- data/test/fixtures/file_rate_limit.yml +52 -0
- data/test/fixtures/file_unauthorized.yml +51 -0
- data/test/fixtures/file_upload.yml +54 -0
- data/test/fixtures/group_find.yml +216 -0
- data/test/fixtures/ip.yml +716 -0
- data/test/fixtures/unscanned_url_find.yml +44 -0
- data/test/fixtures/url_analyse.yml +52 -0
- data/test/fixtures/url_find.yml +599 -0
- data/test/fixtures/user_find.yml +213 -0
- data/test/group_test.rb +27 -0
- data/test/{ip_report_test.rb → ip_test.rb} +6 -4
- data/test/uri_test.rb +1 -1
- data/test/url_test.rb +47 -0
- data/test/user_test.rb +26 -0
- data/test/version_test.rb +1 -2
- data/virustotal_api.gemspec +10 -8
- metadata +99 -69
- data/.circleci/config.yml +0 -19
- data/lib/virustotal_api/domain_report.rb +0 -36
- data/lib/virustotal_api/file_report.rb +0 -37
- data/lib/virustotal_api/file_rescan.rb +0 -35
- data/lib/virustotal_api/file_scan.rb +0 -37
- data/lib/virustotal_api/ip_report.rb +0 -36
- data/lib/virustotal_api/url_report.rb +0 -41
- data/lib/virustotal_api/url_scan.rb +0 -35
- data/test/domain_report_test.rb +0 -32
- data/test/file_report_test.rb +0 -36
- data/test/file_rescan_test.rb +0 -32
- data/test/file_scan_test.rb +0 -30
- data/test/fixtures/domain_report.yml +0 -311
- data/test/fixtures/ip_report.yml +0 -1323
- data/test/fixtures/queue_unscanned_url_report.yml +0 -46
- data/test/fixtures/report.yml +0 -110
- data/test/fixtures/report_not_found.yml +0 -42
- data/test/fixtures/request_forbidden.yml +0 -38
- data/test/fixtures/rescan.yml +0 -47
- data/test/fixtures/scan.yml +0 -49
- data/test/fixtures/unscanned_url_report.yml +0 -43
- data/test/fixtures/url_report.yml +0 -95
- data/test/fixtures/url_scan.yml +0 -48
- data/test/url_report_test.rb +0 -57
- data/test/url_scan_test.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 549e10acf953216ded9295c21129e76fc737bd63f29703af799499c6feed2c6e
|
4
|
+
data.tar.gz: d20c12d67d748d329e3b0e340a4857115d516d942af5e3a282bb72e80a90e373
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 394ad7a9dbf0f4c59d7e286acd57974e042427f0f4c82d1c652195b0dca4d17a0eeed28cd82946da2a072679a824060bacf184c741ecd0578e383386295c328d
|
7
|
+
data.tar.gz: 0f9b0e2bc76a11d1b496ac1b0fb266875ed36cbfb51b27396396b555c3e47d5e411073e8bef956e1e44d08ec395e1165a45df8e525b24af6a0ae915d2c9c1b79
|
@@ -0,0 +1,26 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
Test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
- name: Set up Ruby
|
16
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
17
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
18
|
+
uses: ruby/setup-ruby@v1.46.0
|
19
|
+
with:
|
20
|
+
ruby-version: 2.5
|
21
|
+
- name: Install dependencies
|
22
|
+
run: bundle install
|
23
|
+
- name: Lint
|
24
|
+
run: bundle exec rake rubocop
|
25
|
+
- name: Run tests
|
26
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
# This is the configuration used to check the rubocop source code.
|
2
2
|
|
3
3
|
AllCops:
|
4
|
+
NewCops: enable
|
4
5
|
Exclude:
|
5
6
|
- 'test/fixtures/*'
|
6
7
|
|
7
8
|
Style/StringLiterals:
|
8
9
|
Enabled: true
|
9
10
|
|
10
|
-
Style/
|
11
|
+
Style/RedundantPercentQ:
|
11
12
|
Enabled: true
|
12
13
|
|
13
14
|
# Disabled Checks
|
@@ -20,13 +21,19 @@ Style/PercentLiteralDelimiters:
|
|
20
21
|
Style/RegexpLiteral:
|
21
22
|
Enabled: false
|
22
23
|
|
23
|
-
Style/BracesAroundHashParameters:
|
24
|
-
Enabled: false
|
25
|
-
|
26
24
|
Lint/MissingCopEnableDirective:
|
27
25
|
Exclude:
|
28
26
|
- 'test/base_test.rb'
|
29
27
|
|
30
|
-
Naming/
|
28
|
+
Naming/MethodParameterName:
|
31
29
|
Exclude:
|
32
30
|
- 'lib/virustotal_api/ip_report.rb'
|
31
|
+
|
32
|
+
Layout/LineLength:
|
33
|
+
Enabled: false
|
34
|
+
|
35
|
+
Metrics/MethodLength:
|
36
|
+
Enabled: false
|
37
|
+
|
38
|
+
Gemspec/RequiredRubyVersion:
|
39
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,21 +1,47 @@
|
|
1
1
|
# VirusTotal API Changelog
|
2
2
|
|
3
|
-
## 0.
|
3
|
+
## [0.5.2] - 2020-10-06
|
4
4
|
|
5
|
-
*
|
6
|
-
*
|
5
|
+
* Fix Fix exists? check
|
6
|
+
* Fix detected_by for File
|
7
|
+
* Fix RateLimitError
|
8
|
+
* Added User and Group API
|
9
|
+
* [@jonnynux](https://github.com/jonnynux)
|
10
|
+
|
11
|
+
## [0.5.1] - 2020-10-06
|
12
|
+
|
13
|
+
* Downgrade ruby requirement to 2.5.
|
14
|
+
* [@crondaemon](https://github.com/crondaemon)
|
15
|
+
|
16
|
+
## [0.5.0] - 2020-09-02
|
17
|
+
|
18
|
+
* Full rework to support API V3 [#30](https://github.com/pwelch/virustotal_api/pull/30)
|
19
|
+
* [@crondaemon](https://github.com/crondaemon) & [@jonnynux](https://github.com/jonnynux)
|
20
|
+
* Move to Ruby 2.6 for minimum Ruby version
|
21
|
+
|
22
|
+
## [0.4.1] - 2019-09-04
|
23
|
+
|
24
|
+
* Fixed Reponse Parsing
|
25
|
+
* [@jonnynux](https://github.com/jonnynux)
|
26
|
+
|
27
|
+
## [0.4.0] - 2019-07-23
|
28
|
+
|
29
|
+
* Added ReScan [#15](https://github.com/pwelch/virustotal_api/pull/15)
|
30
|
+
* Added URL Scan [#16](https://github.com/pwelch/virustotal_api/pull/16)
|
7
31
|
* [@jonnynux](https://github.com/jonnynux)
|
8
32
|
|
9
|
-
## 0.3.0
|
33
|
+
## [0.3.0] - 2018-03-31
|
10
34
|
|
11
|
-
*
|
35
|
+
* Added optional scan param for url report API [#5](https://github.com/pwelch/virustotal_api/pull/5)
|
12
36
|
* [@mkunkel ](https://github.com/mkunkel)
|
13
37
|
|
14
|
-
## 0.2.0
|
38
|
+
## [0.2.0] - 2015-12-19
|
15
39
|
|
16
|
-
* Check if the respone is 204 [#2](https://github.com/pwelch/virustotal_api/pull/2)
|
17
|
-
*
|
40
|
+
* Added Check if the respone is 204 [#2](https://github.com/pwelch/virustotal_api/pull/2)
|
41
|
+
* [@postmodern](https://github.com/postmodern)
|
18
42
|
|
19
|
-
## 0.1.0
|
43
|
+
## [0.1.0] - 2014-12-26
|
20
44
|
|
21
45
|
* First Release
|
46
|
+
|
47
|
+
https://keepachangelog.com
|
data/README.md
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
# VirustotalAPI
|
2
2
|
|
3
|
-
Ruby Gem for [VirusTotal](https://www.virustotal.com) [
|
3
|
+
Ruby Gem for [VirusTotal](https://www.virustotal.com) [V3 API](https://developers.virustotal.com/v3.0/reference).
|
4
|
+
If you want the version 2, check out the gem versions up to [0.4.0](https://github.com/crondaemon/virustotal_api/tree/v0.4.0).
|
5
|
+
|
6
|
+
![Ruby](https://github.com/pwelch/virustotal_api/workflows/Ruby/badge.svg)
|
4
7
|
|
5
8
|
[![Gem Version](https://badge.fury.io/rb/virustotal_api.svg)](http://badge.fury.io/rb/virustotal_api)
|
6
|
-
[![CircleCI](https://circleci.com/gh/pwelch/virustotal_api.svg?style=svg)](https://circleci.com/gh/pwelch/virustotal_api)
|
7
9
|
|
8
10
|
## Installation
|
9
11
|
|
@@ -27,7 +29,7 @@ VirusTotal only allows 4 queries per minute for their Public API. https://www.vi
|
|
27
29
|
|
28
30
|
You will need a Private API Key if you require more queries per minute.
|
29
31
|
|
30
|
-
### File
|
32
|
+
### File Find
|
31
33
|
|
32
34
|
```ruby
|
33
35
|
require 'virustotal_api'
|
@@ -35,7 +37,7 @@ require 'virustotal_api'
|
|
35
37
|
sha256 = '01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b'
|
36
38
|
api_key = 'MY_API_KEY'
|
37
39
|
|
38
|
-
vtreport = VirustotalAPI::
|
40
|
+
vtreport = VirustotalAPI::File.find(sha256, api_key)
|
39
41
|
|
40
42
|
# Does the resource have any results?
|
41
43
|
vtreport.exists?
|
@@ -43,14 +45,19 @@ vtreport.exists?
|
|
43
45
|
|
44
46
|
# URL for File Report (if it exists)
|
45
47
|
vtreport.report_url
|
46
|
-
# => "https://www.virustotal.com/
|
48
|
+
# => "https://www.virustotal.com/api/v3/files/01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b"
|
47
49
|
|
48
50
|
# Report results (if they exist) are available via #report
|
49
|
-
vtreport.report[
|
50
|
-
# => {"
|
51
|
+
vtreport.report['data']['attributes']['last_analysis_results']['ClamAV']
|
52
|
+
# => {"category"=>"undetected", "engine_name"=>"ClamAV", "engine_update"=>"20200826",
|
53
|
+
# "engine_version"=>"0.102.4.0", "method"=>"blacklist", "result"=>nil}
|
54
|
+
|
55
|
+
# Check whether an Antivirus detected this sample or not
|
56
|
+
vtreport.detected_by('ClamAV')
|
57
|
+
# => false
|
51
58
|
```
|
52
59
|
|
53
|
-
### File
|
60
|
+
### File Upload
|
54
61
|
|
55
62
|
```ruby
|
56
63
|
require 'virustotal_api'
|
@@ -58,28 +65,21 @@ require 'virustotal_api'
|
|
58
65
|
file = '/path/to/file'
|
59
66
|
api_key = 'MY_API_KEY'
|
60
67
|
|
61
|
-
vtscan = VirustotalAPI::
|
68
|
+
vtscan = VirustotalAPI::File.upload(file, api_key)
|
62
69
|
|
63
|
-
#
|
64
|
-
vtscan.
|
70
|
+
# Virustotal ID of file
|
71
|
+
vtscan.id
|
65
72
|
# => "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b-1419454668"
|
66
73
|
|
67
74
|
# Response results are available via #response
|
68
|
-
vtscan.
|
75
|
+
vtscan.report
|
69
76
|
# =>
|
70
|
-
{
|
71
|
-
"
|
72
|
-
|
73
|
-
"resource"=>"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b",
|
74
|
-
"response_code"=>1,
|
75
|
-
"sha256"=>"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b",
|
76
|
-
"permalink"=>"https://www.virustotal.com/file/01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b/analysis/1419454668/",
|
77
|
-
"md5"=>"68b329da9893e34099c7d8ad5cb9c940",
|
78
|
-
"verbose_msg"=>"Scan request successfully queued, come back later for the report"
|
79
|
-
}
|
77
|
+
{"data"=>
|
78
|
+
{"id"=>"MTkxNDBmMjU4ZGY1OGZiYzZjNmU2ODcyMWNhYjhkZTM6MTU5ODUzMTE5OQ==",
|
79
|
+
"type"=>"analysis"}}
|
80
80
|
```
|
81
81
|
|
82
|
-
### File
|
82
|
+
### File Analyse
|
83
83
|
|
84
84
|
```ruby
|
85
85
|
require 'virustotal_api'
|
@@ -87,25 +87,21 @@ require 'virustotal_api'
|
|
87
87
|
sha256 = '01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b'
|
88
88
|
api_key = 'MY_API_KEY'
|
89
89
|
|
90
|
-
vtrescan = VirustotalAPI::
|
90
|
+
vtrescan = VirustotalAPI::File.analyse(sha256, api_key)
|
91
91
|
|
92
|
-
#
|
93
|
-
vtrescan.
|
94
|
-
# => "
|
92
|
+
# Virustotal ID of file
|
93
|
+
vtrescan.id
|
94
|
+
# => "MTkxNDBmMjU4ZGY1OGZiYzZjNmU2ODcyMWNhYjhkZTM6MTU5ODUzMTE5OQ=="
|
95
95
|
|
96
96
|
# Response results are available via #response
|
97
|
-
vtrescan.
|
97
|
+
vtrescan.report
|
98
98
|
# =>
|
99
|
-
{
|
100
|
-
"
|
101
|
-
|
102
|
-
"sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b",
|
103
|
-
"resource": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b",
|
104
|
-
"scan_id": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b-1562684247"
|
105
|
-
}
|
99
|
+
{"data"=>
|
100
|
+
{"id"=>"MTkxNDBmMjU4ZGY1OGZiYzZjNmU2ODcyMWNhYjhkZTM6MTU5ODUzMTE5OQ==",
|
101
|
+
"type"=>"analysis"}}
|
106
102
|
```
|
107
103
|
|
108
|
-
### URL
|
104
|
+
### URL find
|
109
105
|
|
110
106
|
```ruby
|
111
107
|
require 'virustotal_api'
|
@@ -113,7 +109,7 @@ require 'virustotal_api'
|
|
113
109
|
url = 'http://www.google.com'
|
114
110
|
api_key = 'MY_API_KEY'
|
115
111
|
|
116
|
-
vturl_report = VirustotalAPI::
|
112
|
+
vturl_report = VirustotalAPI::URL.find(url, api_key)
|
117
113
|
|
118
114
|
# Does the resource have any results?
|
119
115
|
vturl_report.exists?
|
@@ -121,14 +117,14 @@ vturl_report.exists?
|
|
121
117
|
|
122
118
|
# URL for Report (if it exists)
|
123
119
|
vturl_report.report_url
|
124
|
-
# => "https://www.virustotal.com/
|
120
|
+
# => "https://www.virustotal.com/api/v3/urls/dd014af5ed6b38d9130e3f466f850e46d21b951199d53a18ef29ee9341614eaf"
|
125
121
|
|
126
122
|
# Report results (if they exist) are available via #report
|
127
|
-
vturl_report.report[
|
128
|
-
# => {"
|
123
|
+
vturl_report.report['data']['attributes']['last_analysis_results']['Avira']
|
124
|
+
# => {"category"=>"harmless", "engine_name"=>"Avira", "method"=>"blacklist", "result"=>"clean"}
|
129
125
|
```
|
130
126
|
|
131
|
-
### URL
|
127
|
+
### URL Upload
|
132
128
|
|
133
129
|
```ruby
|
134
130
|
require 'virustotal_api'
|
@@ -136,27 +132,22 @@ require 'virustotal_api'
|
|
136
132
|
url = 'http://www.google.com'
|
137
133
|
api_key = 'MY_API_KEY'
|
138
134
|
|
139
|
-
vturl_scan = VirustotalAPI::
|
135
|
+
vturl_scan = VirustotalAPI::URL.upload(url, api_key)
|
140
136
|
|
141
|
-
#
|
142
|
-
vturl_scan.
|
143
|
-
# => "dd014af5ed6b38d9130e3f466f850e46d21b951199d53a18ef29ee9341614eaf-
|
137
|
+
# Virustotal ID of file
|
138
|
+
vturl_scan.id
|
139
|
+
# => "u-dd014af5ed6b38d9130e3f466f850e46d21b951199d53a18ef29ee9341614eaf-1598531929"
|
144
140
|
|
145
141
|
# Response results are available via #response
|
146
|
-
vturl_scan.
|
142
|
+
vturl_scan.report
|
147
143
|
# =>
|
148
|
-
{
|
149
|
-
"
|
150
|
-
|
151
|
-
|
152
|
-
"response_code": 1,
|
153
|
-
"scan_date": "2019-07-10 09:39:13",
|
154
|
-
"scan_id": "dd014af5ed6b38d9130e3f466f850e46d21b951199d53a18ef29ee9341614eaf-1562751553",
|
155
|
-
"verbose_msg": "Scan request successfully queued, come back later for the report"
|
156
|
-
}
|
144
|
+
{"data"=>
|
145
|
+
{"id"=>
|
146
|
+
"u-dd014af5ed6b38d9130e3f466f850e46d21b951199d53a18ef29ee9341614eaf-1598531929",
|
147
|
+
"type"=>"analysis"}}
|
157
148
|
```
|
158
149
|
|
159
|
-
### IP
|
150
|
+
### IP Find
|
160
151
|
|
161
152
|
```ruby
|
162
153
|
require 'virustotal_api'
|
@@ -164,18 +155,22 @@ require 'virustotal_api'
|
|
164
155
|
ip = '8.8.8.8'
|
165
156
|
api_key = 'MY_API_KEY'
|
166
157
|
|
167
|
-
vtip_report = VirustotalAPI::
|
158
|
+
vtip_report = VirustotalAPI::IP.find(ip, api_key)
|
168
159
|
|
169
160
|
# Does the resource have any results?
|
170
161
|
vtip_report.exists?
|
171
162
|
# => true
|
172
163
|
|
164
|
+
# URL for Report (if it exists)
|
165
|
+
vtip_report.report_url
|
166
|
+
# => "https://www.virustotal.com/api/v3/ip_addresses/8.8.8.8"
|
167
|
+
|
173
168
|
# Report results (if they exist) are available via #report
|
174
169
|
vtip_report.report
|
175
170
|
# => Hash of report results
|
176
171
|
```
|
177
172
|
|
178
|
-
### Domain
|
173
|
+
### Domain Find
|
179
174
|
|
180
175
|
```ruby
|
181
176
|
require 'virustotal_api'
|
@@ -183,22 +178,65 @@ require 'virustotal_api'
|
|
183
178
|
domain = 'virustotal.com'
|
184
179
|
api_key = 'MY_API_KEY'
|
185
180
|
|
186
|
-
vtdomain_report = VirustotalAPI::
|
181
|
+
vtdomain_report = VirustotalAPI::Domain.find(domain, api_key)
|
187
182
|
|
188
183
|
# Does the resource have any results?
|
189
184
|
vtdomain_report.exists?
|
190
185
|
# => true
|
191
186
|
|
187
|
+
# URL for Report (if it exists)
|
188
|
+
vtdomain_report.report_url
|
189
|
+
# => "https://www.virustotal.com/api/v3/domains/virustotal.com"
|
190
|
+
|
192
191
|
# Report results (if they exist) are available via #report
|
193
192
|
vtdomain_report.report
|
194
193
|
# => Hash of report results
|
195
194
|
```
|
196
195
|
|
196
|
+
### User Find
|
197
|
+
|
198
|
+
```ruby
|
199
|
+
require 'virustotal_api'
|
200
|
+
|
201
|
+
user_key = 'user_key' # user_id or api_key
|
202
|
+
api_key = 'MY_API_KEY'
|
203
|
+
|
204
|
+
vtuser_report = VirustotalAPI::User.find(user_key, api_key)
|
205
|
+
|
206
|
+
# Does the resource have any results?
|
207
|
+
vtuser_report.exists?
|
208
|
+
# => true
|
209
|
+
|
210
|
+
# Report results (if they exist) are available via #report
|
211
|
+
vtuser_report.report
|
212
|
+
# => Hash of report results
|
213
|
+
```
|
214
|
+
|
215
|
+
### Group Find
|
216
|
+
|
217
|
+
```ruby
|
218
|
+
require 'virustotal_api'
|
219
|
+
|
220
|
+
group_id = 'GROUP_id'
|
221
|
+
api_key = 'MY_API_KEY'
|
222
|
+
|
223
|
+
vtgroup_report = VirustotalAPI::Group.find(group_id, api_key)
|
224
|
+
|
225
|
+
# Does the resource have any results?
|
226
|
+
vtgroup_report.exists?
|
227
|
+
# => true
|
228
|
+
|
229
|
+
# Report results (if they exist) are available via #report
|
230
|
+
vtgroup_report.report
|
231
|
+
# => Hash of report results
|
232
|
+
```
|
233
|
+
|
197
234
|
## Contributors
|
198
235
|
|
199
236
|
- [@postmodern](https://github.com/postmodern)
|
200
237
|
- [@mkunkel](https://github.com/mkunkel)
|
201
238
|
- [@jonnynux](https://github.com/jonnynux)
|
239
|
+
- [@crondaemon](https://github.com/crondaemon/)
|
202
240
|
|
203
241
|
## Contributing
|
204
242
|
|
data/lib/virustotal_api.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'virustotal_api/
|
4
|
-
require 'virustotal_api/
|
5
|
-
require 'virustotal_api/
|
6
|
-
require 'virustotal_api/
|
7
|
-
require 'virustotal_api/
|
8
|
-
require 'virustotal_api/
|
9
|
-
require 'virustotal_api/url_scan'
|
3
|
+
require 'virustotal_api/analysis'
|
4
|
+
require 'virustotal_api/domain'
|
5
|
+
require 'virustotal_api/file'
|
6
|
+
require 'virustotal_api/group'
|
7
|
+
require 'virustotal_api/ip'
|
8
|
+
require 'virustotal_api/url'
|
10
9
|
require 'virustotal_api/uri'
|
10
|
+
require 'virustotal_api/user'
|
11
11
|
require 'virustotal_api/version'
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
|
5
|
+
module VirustotalAPI
|
6
|
+
# A class for '/analyses' API
|
7
|
+
class Analysis < Base
|
8
|
+
# @param [String] id The Virustotal ID to get the report for.
|
9
|
+
# @param [String] api_key The key for virustotal
|
10
|
+
# @return [VirustotalAPI::IP] Report
|
11
|
+
def self.find(id, api_key)
|
12
|
+
report = perform("/analyses/#{id}", api_key)
|
13
|
+
new(report)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|