uirusu 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +6 -7
- data/NEWS.markdown +12 -6
- data/README.markdown +1 -1
- data/bin/uirusu +9 -9
- data/lib/uirusu.rb +2 -2
- data/lib/uirusu/cli/application.rb +3 -2
- data/lib/uirusu/scanner.rb +1 -1
- data/lib/uirusu/vtcomment.rb +14 -14
- data/lib/uirusu/vtfile.rb +1 -1
- data/lib/uirusu/vtresult.rb +2 -2
- data/lib/uirusu/vturl.rb +1 -2
- data/uirusu.gemspec +3 -3
- metadata +15 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 141b452bc03bd39d1b454366943749bc6f932a64
|
4
|
+
data.tar.gz: da760b18fb2ca69ff15785c66910fb7b821cebe6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d95c2122732d7888a9fdd0a5277dc84215ae0a26893a802b507a591d8b2d6d6fdefef758bafc0738dd7c63c419703bf1bfef2264edfee345fc2247fe7a2e809f
|
7
|
+
data.tar.gz: 6d51144899e0c063bbe7db597a4ba9b9d5e1b8f7cfbbc3ba510543d9c0933f66ba7d9c27f05aa6c4b002dbe8ade3587a10d22afea2845c8a531382a961bf6d09
|
data/LICENSE
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
Copyright (c) 2012-
|
1
|
+
Copyright (c) 2012-2015 Arxopia LLC.
|
2
2
|
All rights reserved.
|
3
3
|
|
4
4
|
Redistribution and use in source and binary forms, with or without
|
5
5
|
modification, are permitted provided that the following conditions are met:
|
6
6
|
|
7
|
-
Redistributions of source code must retain the above copyright notice,
|
7
|
+
Redistributions of source code must retain the above copyright notice,
|
8
8
|
this list of conditions and the following disclaimer.
|
9
9
|
|
10
|
-
Redistributions in binary form must reproduce the above copyright notice,
|
11
|
-
this list of conditions and the following disclaimer in the documentation
|
10
|
+
Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
12
12
|
and/or other materials provided with the distribution.
|
13
13
|
|
14
|
-
Neither the name of the project's author nor the names of its contributors
|
15
|
-
may be used to endorse or promote products derived from this software
|
14
|
+
Neither the name of the project's author nor the names of its contributors
|
15
|
+
may be used to endorse or promote products derived from this software
|
16
16
|
without specific prior written permission.
|
17
17
|
|
18
18
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
@@ -25,4 +25,3 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
25
25
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
26
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
27
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
-
|
data/NEWS.markdown
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
-
# 0.0.
|
3
|
+
# 0.0.8 (Novemeber 20, 2015)
|
4
|
+
- remove double array bracket [kitplummer]
|
5
|
+
|
6
|
+
# 0.0.7 (August 31, 2015)
|
7
|
+
- Accept HTTP response code 204 as limit-reached code [JasonPoll]
|
8
|
+
- Update application.rb [david-sackmary]
|
9
|
+
|
10
|
+
# 0.0.6 (September 10, 2013)
|
4
11
|
- Added support for hashing a directory and submitting it to the hash scan[request from myne-us]
|
5
12
|
- -d DIRECTORY will invoke this, all files will be hashed and submitted to the hash array to be hashed
|
6
13
|
- Minor tweaks
|
@@ -8,7 +15,7 @@
|
|
8
15
|
|
9
16
|
# 0.0.5 (June 14, 2013)
|
10
17
|
- Merged Pull request from [jfx41]
|
11
|
-
- Lots of cleanup from jfx41
|
18
|
+
- Lots of cleanup from [jfx41]
|
12
19
|
|
13
20
|
# 0.0.4 (April 11, 2013)
|
14
21
|
- Added Proxy support [abenson]
|
@@ -16,13 +23,12 @@
|
|
16
23
|
- Made sure each hash request waits for the timeout specified in the yaml file
|
17
24
|
- The default timeout is 15 seconds, by default virustotal.org only allows 4 requests per minute
|
18
25
|
|
19
|
-
# 0.0.3 ()
|
26
|
+
# 0.0.3 (August 16, 2012)
|
20
27
|
- Gemspec fix
|
21
28
|
|
22
|
-
# 0.0.2 ()
|
29
|
+
# 0.0.2 (March 2, 2012)
|
23
30
|
- Copyright fixes
|
24
31
|
|
25
|
-
# 0.0.1 (
|
32
|
+
# 0.0.1 (February 25, 2012)
|
26
33
|
- Rename ruby-virustotal/virustotal gem to uirusu, to prevent being sued.
|
27
34
|
- Complete rewrite of the gem
|
28
|
-
|
data/README.markdown
CHANGED
data/bin/uirusu
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
# Copyright (c) 2012-
|
3
|
+
# Copyright (c) 2012-2015 Arxopia LLC.
|
4
4
|
# All rights reserved.
|
5
|
-
#
|
5
|
+
#
|
6
6
|
# Redistribution and use in source and binary forms, with or without
|
7
7
|
# modification, are permitted provided that the following conditions are met:
|
8
|
-
#
|
9
|
-
# Redistributions of source code must retain the above copyright notice,
|
8
|
+
#
|
9
|
+
# Redistributions of source code must retain the above copyright notice,
|
10
10
|
# this list of conditions and the following disclaimer.
|
11
11
|
#
|
12
|
-
# Redistributions in binary form must reproduce the above copyright notice,
|
13
|
-
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# Redistributions in binary form must reproduce the above copyright notice,
|
13
|
+
# this list of conditions and the following disclaimer in the documentation
|
14
14
|
# and/or other materials provided with the distribution.
|
15
15
|
#
|
16
|
-
# Neither the name of the project's author nor the names of its contributors
|
17
|
-
# may be used to endorse or promote products derived from this software
|
16
|
+
# Neither the name of the project's author nor the names of its contributors
|
17
|
+
# may be used to endorse or promote products derived from this software
|
18
18
|
# without specific prior written permission.
|
19
|
-
#
|
19
|
+
#
|
20
20
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
21
21
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
22
22
|
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
data/lib/uirusu.rb
CHANGED
@@ -28,14 +28,14 @@
|
|
28
28
|
|
29
29
|
module Uirusu
|
30
30
|
APP_NAME = "uirusu"
|
31
|
-
VERSION = "0.0.
|
31
|
+
VERSION = "0.0.9"
|
32
32
|
CONFIG_FILE = Dir.home + "/.uirusu"
|
33
33
|
VT_API = "https://www.virustotal.com/vtapi/v2"
|
34
34
|
RESULT_FIELDS = [ :hash, :scanner, :version, :detected, :result, :md5, :sha1, :sha256, :update, :permalink]
|
35
35
|
end
|
36
36
|
|
37
37
|
require 'json'
|
38
|
-
require '
|
38
|
+
require 'rest-client'
|
39
39
|
require 'optparse'
|
40
40
|
require 'yaml'
|
41
41
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2012-
|
1
|
+
# Copyright (c) 2012-2015 Arxopia LLC.
|
2
2
|
# All rights reserved.
|
3
3
|
#
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
@@ -219,10 +219,12 @@ module Uirusu
|
|
219
219
|
# rescan_file returns an array of results if more than one hash
|
220
220
|
# is requested to be rescanned.
|
221
221
|
result_array = result.is_a?(Array) ? result : [ result ]
|
222
|
+
|
222
223
|
result_array.collect do |result|
|
223
224
|
if result['response_code'] == 1
|
224
225
|
STDERR.puts "[*] Attempting to parse the results for: #{result['resource']}" if @options['verbose']
|
225
226
|
results = mod.query_report(@config['virustotal']['api-key'], result['resource'])
|
227
|
+
|
226
228
|
while results['response_code'] != 1
|
227
229
|
STDERR.puts "[*] File has not been analyized yet, waiting 60 seconds to try again" if @options['verbose']
|
228
230
|
sleep 60
|
@@ -230,7 +232,6 @@ module Uirusu
|
|
230
232
|
end
|
231
233
|
|
232
234
|
return result['resource'], results
|
233
|
-
#return [result['resource'], results]
|
234
235
|
|
235
236
|
elsif result['response_code'] == 0 and @options['rescan']
|
236
237
|
STDERR.puts "[!] Unknown Virustotal error for rescan of #{result['resource']}." if @options['verbose']
|
data/lib/uirusu/scanner.rb
CHANGED
data/lib/uirusu/vtcomment.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
# Copyright (c) 2012-
|
1
|
+
# Copyright (c) 2012-2015 Arxopia LLC.
|
2
2
|
# All rights reserved.
|
3
|
-
#
|
3
|
+
#
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
5
5
|
# modification, are permitted provided that the following conditions are met:
|
6
|
-
#
|
7
|
-
# Redistributions of source code must retain the above copyright notice,
|
6
|
+
#
|
7
|
+
# Redistributions of source code must retain the above copyright notice,
|
8
8
|
# this list of conditions and the following disclaimer.
|
9
9
|
#
|
10
|
-
# Redistributions in binary form must reproduce the above copyright notice,
|
11
|
-
# this list of conditions and the following disclaimer in the documentation
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
12
|
# and/or other materials provided with the distribution.
|
13
13
|
#
|
14
|
-
# Neither the name of the project's author nor the names of its contributors
|
15
|
-
# may be used to endorse or promote products derived from this software
|
14
|
+
# Neither the name of the project's author nor the names of its contributors
|
15
|
+
# may be used to endorse or promote products derived from this software
|
16
16
|
# without specific prior written permission.
|
17
|
-
#
|
17
|
+
#
|
18
18
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
|
19
19
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
20
|
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
@@ -31,7 +31,7 @@ module Uirusu
|
|
31
31
|
# Virustotal.com public API
|
32
32
|
module VTComment
|
33
33
|
POST_URL = Uirusu::VT_API + "/comments/put"
|
34
|
-
|
34
|
+
|
35
35
|
# Submits a comment to Virustotal.com for a specific resource
|
36
36
|
#
|
37
37
|
# @param [String] api_key Virustotal.com API key
|
@@ -43,17 +43,17 @@ module Uirusu
|
|
43
43
|
if api_key == nil
|
44
44
|
raise "Invalid API Key"
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
if resource == nil
|
48
48
|
raise "Invalid resource, must be a valid url"
|
49
49
|
end
|
50
|
-
|
50
|
+
|
51
51
|
if comment == nil
|
52
52
|
raise "You must provide a comment to submit."
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
55
|
response = RestClient.post POST_URL, :apikey => api_key, :resource => resource, :comment => comment
|
56
|
-
|
56
|
+
|
57
57
|
case response.code
|
58
58
|
when 429, 204
|
59
59
|
raise "Virustotal limit reached. Try again later."
|
data/lib/uirusu/vtfile.rb
CHANGED
data/lib/uirusu/vtresult.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2012-
|
1
|
+
# Copyright (c) 2012-2015 Arxopia LLC.
|
2
2
|
# All rights reserved.
|
3
3
|
#
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
@@ -123,7 +123,7 @@ module Uirusu
|
|
123
123
|
# Outputs the result to JSON
|
124
124
|
#
|
125
125
|
# @return [String] JSON representation of the result
|
126
|
-
def to_json
|
126
|
+
def to_json(options={})
|
127
127
|
JSON::pretty_generate(@results.map{|entry| { :vtresult => entry } })
|
128
128
|
end
|
129
129
|
|
data/lib/uirusu/vturl.rb
CHANGED
data/uirusu.gemspec
CHANGED
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
|
|
40
40
|
s.license = "BSD"
|
41
41
|
|
42
42
|
s.author = "Jacob Hammack"
|
43
|
-
s.email = "
|
43
|
+
s.email = "jacob.hammack@arxopia.com"
|
44
44
|
|
45
45
|
s.files = Dir['[A-Z]*'] + Dir['lib/**/*'] + ['uirusu.gemspec']
|
46
46
|
s.default_executable = 'uirusu'
|
@@ -53,6 +53,6 @@ Gem::Specification.new do |s|
|
|
53
53
|
s.has_rdoc = 'yard'
|
54
54
|
s.extra_rdoc_files = ["README.markdown", "LICENSE", "NEWS.markdown", "TODO.markdown"]
|
55
55
|
|
56
|
-
s.
|
57
|
-
s.
|
56
|
+
s.add_runtime_dependency 'json', '~> 1.5', '>= 1.5.1'
|
57
|
+
s.add_runtime_dependency 'rest-client', '~> 1.6', '>= 1.6.1'
|
58
58
|
end
|
metadata
CHANGED
@@ -1,19 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uirusu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Hammack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.5'
|
17
20
|
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
22
|
version: 1.5.1
|
@@ -21,6 +24,9 @@ dependencies:
|
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.5'
|
24
30
|
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
32
|
version: 1.5.1
|
@@ -28,6 +34,9 @@ dependencies:
|
|
28
34
|
name: rest-client
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.6'
|
31
40
|
- - ">="
|
32
41
|
- !ruby/object:Gem::Version
|
33
42
|
version: 1.6.1
|
@@ -35,11 +44,14 @@ dependencies:
|
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
37
46
|
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '1.6'
|
38
50
|
- - ">="
|
39
51
|
- !ruby/object:Gem::Version
|
40
52
|
version: 1.6.1
|
41
53
|
description: uirusu is library for interacting with Virustotal.org
|
42
|
-
email:
|
54
|
+
email: jacob.hammack@arxopia.com
|
43
55
|
executables:
|
44
56
|
- uirusu
|
45
57
|
extensions: []
|