virustotal_api_compat 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/.github/CODE_OF_CONDUCT.md +46 -0
  3. data/.github/CONTRIBUTING.md +7 -0
  4. data/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  6. data/.github/pull_request_template.md +11 -0
  7. data/.github/workflows/ruby.yml +46 -0
  8. data/.gitignore +18 -0
  9. data/.rubocop.yml +39 -0
  10. data/CHANGELOG.md +70 -0
  11. data/Gemfile +5 -0
  12. data/LICENSE.txt +22 -0
  13. data/README.md +253 -0
  14. data/Rakefile +25 -0
  15. data/lib/virustotal_api/analysis.rb +16 -0
  16. data/lib/virustotal_api/base.rb +78 -0
  17. data/lib/virustotal_api/domain.rb +18 -0
  18. data/lib/virustotal_api/exceptions.rb +9 -0
  19. data/lib/virustotal_api/file.rb +67 -0
  20. data/lib/virustotal_api/group.rb +18 -0
  21. data/lib/virustotal_api/ip.rb +18 -0
  22. data/lib/virustotal_api/uri.rb +6 -0
  23. data/lib/virustotal_api/url.rb +38 -0
  24. data/lib/virustotal_api/user.rb +18 -0
  25. data/lib/virustotal_api/version.rb +6 -0
  26. data/lib/virustotal_api.rb +11 -0
  27. data/test/analysis_test.rb +26 -0
  28. data/test/base_test.rb +63 -0
  29. data/test/domain_test.rb +27 -0
  30. data/test/exceptions_test.rb +31 -0
  31. data/test/file_test.rb +73 -0
  32. data/test/fixtures/analysis.yml +544 -0
  33. data/test/fixtures/domain.yml +830 -0
  34. data/test/fixtures/domain_bad_request.yml +52 -0
  35. data/test/fixtures/file_analyse.yml +52 -0
  36. data/test/fixtures/file_find.yml +853 -0
  37. data/test/fixtures/file_not_found.yml +52 -0
  38. data/test/fixtures/file_rate_limit.yml +52 -0
  39. data/test/fixtures/file_unauthorized.yml +51 -0
  40. data/test/fixtures/file_upload.yml +54 -0
  41. data/test/fixtures/group_find.yml +216 -0
  42. data/test/fixtures/ip.yml +716 -0
  43. data/test/fixtures/large_file_upload.yml +99 -0
  44. data/test/fixtures/null_file +1 -0
  45. data/test/fixtures/unscanned_url_find.yml +44 -0
  46. data/test/fixtures/url_analyse.yml +52 -0
  47. data/test/fixtures/url_encoding_find.yml +651 -0
  48. data/test/fixtures/url_find.yml +599 -0
  49. data/test/fixtures/user_find.yml +213 -0
  50. data/test/group_test.rb +27 -0
  51. data/test/ip_test.rb +26 -0
  52. data/test/test_helper.rb +11 -0
  53. data/test/uri_test.rb +10 -0
  54. data/test/url_test.rb +47 -0
  55. data/test/user_test.rb +26 -0
  56. data/test/version_test.rb +9 -0
  57. data/virustotal_api.gemspec +33 -0
  58. metadata +287 -0
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://www.virustotal.com/api/v3/files/01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*"
12
+ User-Agent:
13
+ - rest-client/2.1.0 (linux-gnu x86_64) ruby/2.5.1p57
14
+ X-Apikey:
15
+ - testapikey
16
+ Content-Length:
17
+ - '0'
18
+ Content-Type:
19
+ - application/x-www-form-urlencoded
20
+ Accept-Encoding:
21
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
+ Host:
23
+ - www.virustotal.com
24
+ response:
25
+ status:
26
+ code: 404
27
+ message: Not Found
28
+ headers:
29
+ Cache-Control:
30
+ - no-cache
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ X-Cloud-Trace-Context:
34
+ - 1530c5d92ceea7ca966597807f154284
35
+ Date:
36
+ - Mon, 28 Sep 2020 16:25:32 GMT
37
+ Server:
38
+ - Google Frontend
39
+ Content-Length:
40
+ - '130'
41
+ body:
42
+ encoding: UTF-8
43
+ string: |-
44
+ {
45
+ "error": {
46
+ "code": "NotFoundError",
47
+ "message": "File \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\" not found"
48
+ }
49
+ }
50
+ http_version:
51
+ recorded_at: Mon, 28 Sep 2020 16:25:32 GMT
52
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.virustotal.com/api/v3/files/01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b/analyse
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*"
12
+ User-Agent:
13
+ - rest-client/2.1.0 (linux-gnu x86_64) ruby/2.5.1p57
14
+ X-Apikey:
15
+ - testapikey
16
+ Content-Length:
17
+ - '0'
18
+ Content-Type:
19
+ - application/x-www-form-urlencoded
20
+ Accept-Encoding:
21
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
+ Host:
23
+ - www.virustotal.com
24
+ response:
25
+ status:
26
+ code: 429
27
+ message: Too Many Requests
28
+ headers:
29
+ Cache-Control:
30
+ - no-cache
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ X-Cloud-Trace-Context:
34
+ - 478e4eb97aa48d5b286e7e4b3aa67ef6
35
+ Date:
36
+ - Wed, 30 Sep 2020 15:15:30 GMT
37
+ Server:
38
+ - Google Frontend
39
+ Content-Length:
40
+ - '98'
41
+ body:
42
+ encoding: UTF-8
43
+ string: |-
44
+ {
45
+ "error": {
46
+ "code": "QuotaExceededError",
47
+ "message": "Quota exceeded"
48
+ }
49
+ }
50
+ http_version:
51
+ recorded_at: Wed, 30 Sep 2020 15:15:30 GMT
52
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://www.virustotal.com/api/v3/files/01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*"
12
+ User-Agent:
13
+ - rest-client/2.1.0 (linux-gnu x86_64) ruby/2.5.1p57
14
+ X-Apikey:
15
+ - testapikey
16
+ Content-Length:
17
+ - '0'
18
+ Content-Type:
19
+ - application/x-www-form-urlencoded
20
+ Accept-Encoding:
21
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
+ Host:
23
+ - www.virustotal.com
24
+ response:
25
+ status:
26
+ code: 401
27
+ message: Unauthorized
28
+ headers:
29
+ Cache-Control:
30
+ - no-cache
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ X-Cloud-Trace-Context:
34
+ - 58dbefadec2107a7b6ab2d92b416b41e
35
+ Date:
36
+ - Thu, 03 Sep 2020 08:23:00 GMT
37
+ Server:
38
+ - Google Frontend
39
+ Content-Length:
40
+ - '112'
41
+ body:
42
+ encoding: UTF-8
43
+ string: |-
44
+ {
45
+ "error": {
46
+ "code": "WrongCredentialsError",
47
+ "message": "Wrong API key: testapikey"
48
+ }
49
+ }
50
+ recorded_at: Thu, 03 Sep 2020 08:23:00 GMT
51
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.virustotal.com/api/v3/files
6
+ body:
7
+ encoding: ASCII-8BIT
8
+ string: "------RubyFormBoundaryjv5FxFNLpwqDoUQA\r\nContent-Disposition: form-data;
9
+ name=\"filename\"\r\n\r\nnull_file\r\n------RubyFormBoundaryjv5FxFNLpwqDoUQA\r\nContent-Disposition:
10
+ form-data; name=\"file\"; filename=\"null_file\"\r\nContent-Type: text/plain\r\n\r\n\n\r\n------RubyFormBoundaryjv5FxFNLpwqDoUQA--\r\n"
11
+ headers:
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - rest-client/2.1.0 (linux-gnu x86_64) ruby/2.5.1p57
16
+ X-Apikey:
17
+ - testapikey
18
+ Content-Length:
19
+ - '282'
20
+ Content-Type:
21
+ - multipart/form-data; boundary=----RubyFormBoundaryjv5FxFNLpwqDoUQA
22
+ Accept-Encoding:
23
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
24
+ Host:
25
+ - www.virustotal.com
26
+ response:
27
+ status:
28
+ code: 200
29
+ message: OK
30
+ headers:
31
+ Cache-Control:
32
+ - no-cache
33
+ Content-Type:
34
+ - application/json; charset=utf-8
35
+ X-Cloud-Trace-Context:
36
+ - 9c3d1ae8f345c5ca8060a4b793174891
37
+ Date:
38
+ - Wed, 02 Sep 2020 14:02:36 GMT
39
+ Server:
40
+ - Google Frontend
41
+ Content-Length:
42
+ - '128'
43
+ body:
44
+ encoding: UTF-8
45
+ string: |-
46
+ {
47
+ "data": {
48
+ "id": "NjhiMzI5ZGE5ODkzZTM0MDk5YzdkOGFkNWNiOWM5NDA6MTU5OTA1NTM1Ng==",
49
+ "type": "analysis"
50
+ }
51
+ }
52
+ http_version:
53
+ recorded_at: Wed, 02 Sep 2020 14:02:37 GMT
54
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,216 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://www.virustotal.com/api/v3/groups/GROUP_us
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*"
12
+ User-Agent:
13
+ - rest-client/2.1.0 (linux-gnu x86_64) ruby/2.5.1p57
14
+ X-Apikey:
15
+ - testapikey
16
+ Content-Length:
17
+ - '0'
18
+ Content-Type:
19
+ - application/x-www-form-urlencoded
20
+ Accept-Encoding:
21
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
+ Host:
23
+ - www.virustotal.com
24
+ response:
25
+ status:
26
+ code: 200
27
+ message: OK
28
+ headers:
29
+ Cache-Control:
30
+ - no-cache
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ X-Cloud-Trace-Context:
34
+ - 424b5968185466d45e93db7cd34f7055
35
+ Date:
36
+ - Mon, 05 Oct 2020 14:16:58 GMT
37
+ Server:
38
+ - Google Frontend
39
+ Content-Length:
40
+ - '5487'
41
+ body:
42
+ encoding: UTF-8
43
+ string: |-
44
+ {
45
+ "data": {
46
+ "attributes": {
47
+ "agreement_company_address": "3582 White River Way, Farmington, UT 84025",
48
+ "agreement_company_country": "US",
49
+ "agreement_company_name": "GROUP inc",
50
+ "agreement_signatory": "Valdo Donati",
51
+ "agreement_signatory_email": "granville@okeefehomenick.co",
52
+ "agreement_signatory_title": "mr",
53
+ "agreement_signed_date": 1580891744,
54
+ "country": "USA",
55
+ "country_iso": "US",
56
+ "domain_name": "okeefehomenick.co",
57
+ "industry": "Communications",
58
+ "lock_users_api_quota_group": true,
59
+ "organization": "GROUP inc",
60
+ "organization_legal_name": "GROUP inc",
61
+ "privileges": {
62
+ "cases": {
63
+ "granted": false
64
+ },
65
+ "click_to_accept": {
66
+ "granted": true
67
+ },
68
+ "creditcards": {
69
+ "granted": false
70
+ },
71
+ "dogfooder": {
72
+ "granted": false
73
+ },
74
+ "downloads-tier-1": {
75
+ "granted": false
76
+ },
77
+ "downloads-tier-2": {
78
+ "expiration_date": 1625011200,
79
+ "granted": true
80
+ },
81
+ "file-behaviour-feed": {
82
+ "granted": false
83
+ },
84
+ "file-feed": {
85
+ "granted": false
86
+ },
87
+ "file-feed-without-av-results": {
88
+ "granted": false
89
+ },
90
+ "intelligence": {
91
+ "expiration_date": 1625011200,
92
+ "granted": true
93
+ },
94
+ "intelligence-search-tier-1": {
95
+ "granted": false
96
+ },
97
+ "intelligence-search-tier-2": {
98
+ "granted": false
99
+ },
100
+ "intelligence-search-tier-3": {
101
+ "granted": false
102
+ },
103
+ "monitor": {
104
+ "granted": false
105
+ },
106
+ "monitor-partner": {
107
+ "granted": false
108
+ },
109
+ "private": {
110
+ "expiration_date": 1625011200,
111
+ "granted": true
112
+ },
113
+ "retrohunt-tier-1": {
114
+ "granted": false
115
+ },
116
+ "retrohunt-tier-2": {
117
+ "granted": false
118
+ },
119
+ "retrohunt-tier-3": {
120
+ "granted": false
121
+ },
122
+ "sales-staff": {
123
+ "granted": false
124
+ },
125
+ "staff": {
126
+ "granted": false
127
+ },
128
+ "url-feed": {
129
+ "granted": false
130
+ },
131
+ "vtalerts": {
132
+ "granted": false
133
+ },
134
+ "vtdiff-api": {
135
+ "granted": false
136
+ },
137
+ "vtdiff-ui": {
138
+ "granted": false
139
+ },
140
+ "vtgrep": {
141
+ "granted": false
142
+ },
143
+ "widget": {
144
+ "granted": false
145
+ }
146
+ },
147
+ "quota_usage_by_user": {},
148
+ "quotas": {
149
+ "api_requests_daily": {
150
+ "allowed": 30000,
151
+ "used": 1
152
+ },
153
+ "api_requests_hourly": {
154
+ "allowed": 1800000,
155
+ "used": 0
156
+ },
157
+ "api_requests_monthly": {
158
+ "allowed": 1000000000,
159
+ "used": 15
160
+ },
161
+ "cases_creation_monthly": {
162
+ "allowed": 20,
163
+ "used": 0
164
+ },
165
+ "intelligence_downloads_monthly": {
166
+ "allowed": 15000,
167
+ "used": 0
168
+ },
169
+ "intelligence_graphs_private": {
170
+ "allowed": 0,
171
+ "used": 0
172
+ },
173
+ "intelligence_hunting_rules": {
174
+ "allowed": 25,
175
+ "used": 3
176
+ },
177
+ "intelligence_retrohunt_jobs_monthly": {
178
+ "allowed": 5,
179
+ "used": 0
180
+ },
181
+ "intelligence_searches_monthly": {
182
+ "allowed": 15000,
183
+ "used": 41
184
+ },
185
+ "intelligence_vtdiff_creation_monthly": {
186
+ "allowed": 100000000,
187
+ "used": 0
188
+ },
189
+ "monitor_storage_bytes": {
190
+ "allowed": 0,
191
+ "used": 0
192
+ },
193
+ "monitor_storage_files": {
194
+ "allowed": 0,
195
+ "used": 0
196
+ },
197
+ "monitor_uploaded_bytes": {
198
+ "allowed": 0,
199
+ "used": 0
200
+ },
201
+ "monitor_uploaded_files": {
202
+ "allowed": 0,
203
+ "used": 0
204
+ }
205
+ }
206
+ },
207
+ "id": "GROUP_us",
208
+ "links": {
209
+ "self": "https://www.virustotal.com/api/v3/groups/GROUP_us"
210
+ },
211
+ "type": "group"
212
+ }
213
+ }
214
+ http_version:
215
+ recorded_at: Mon, 05 Oct 2020 14:16:58 GMT
216
+ recorded_with: VCR 5.0.0