uirusu 0.0.1 → 0.0.3
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.
- data/LICENSE +13 -10
- data/NEWS.markdown +4 -1
- data/README.markdown +34 -2
- data/Rakefile +28 -0
- data/TODO.markdown +1 -2
- data/bin/uirusu +28 -0
- data/lib/uirusu/cli/application.rb +28 -0
- data/lib/uirusu/vtcomment.rb +28 -0
- data/lib/uirusu/vtfile.rb +38 -9
- data/lib/uirusu/vtresult.rb +38 -10
- data/lib/uirusu/vturl.rb +28 -0
- data/lib/uirusu.rb +30 -2
- data/uirusu.gemspec +7 -7
- metadata +22 -12
data/LICENSE
CHANGED
@@ -1,25 +1,28 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2012 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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
Redistributions of source code must retain the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer.
|
9
|
+
|
10
|
+
Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
12
|
+
and/or other materials provided with the distribution.
|
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
|
16
|
+
without specific prior written permission.
|
15
17
|
|
16
18
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
17
19
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
18
20
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
19
|
-
DISCLAIMED. IN NO EVENT SHALL
|
21
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
20
22
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
21
23
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
22
24
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
23
25
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
24
26
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
25
27
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
|
data/NEWS.markdown
CHANGED
data/README.markdown
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# uirusu
|
2
2
|
|
3
|
-
uirusu is [
|
3
|
+
uirusu is an [Virustotal](http://www.virustotal.com) automation and convenience tool for hash, file and URL submission.
|
4
4
|
|
5
5
|
The current version is 0.0.1
|
6
6
|
|
@@ -40,5 +40,37 @@ The current version is 0.0.1
|
|
40
40
|
### Saving results to a file
|
41
41
|
% uirusu -s "http://www.google.com" --yaml-output > file.yaml
|
42
42
|
|
43
|
+
|
44
|
+
## API Usage
|
45
|
+
```ruby
|
46
|
+
#First you need to include the correct require files
|
47
|
+
require 'rubygems'
|
48
|
+
require 'uirusu'
|
49
|
+
|
50
|
+
APT_KEY = "YOUR API KEY HERE"
|
51
|
+
|
52
|
+
hash = "FD287794107630FA3116800E617466A9" #Hash for a version of Poison Ivy
|
53
|
+
url = "http://www.google.com"
|
54
|
+
comment = "Hey this is Poison Ivy, anyone have a copy of this binary?"
|
55
|
+
|
56
|
+
#To query a hash(sha1/sha256/md5)
|
57
|
+
results = Uirusu::VTFile.query_report(APT_KEY, hash)
|
58
|
+
result = Uirusu::VTResult.new(hash, results)
|
59
|
+
print result.to_stdout if result != nil
|
60
|
+
|
61
|
+
#To scan for a url
|
62
|
+
results = Uirusu::VTUrl.query_report(APT_KEY, url)
|
63
|
+
result = Uirusu::VTResult.new(url, results)
|
64
|
+
print result.to_stdout if result != nil
|
65
|
+
|
66
|
+
#To post a comment to a resource(url/hash/scan_id)
|
67
|
+
results = Uirusu::VTComment.post_comment(APT_KEY, hash, comment)
|
68
|
+
print results if results != nil
|
69
|
+
```
|
70
|
+
|
71
|
+
##License
|
72
|
+
|
73
|
+
Uirusu is licensed under the BSD license see the `LICENSE` file for the full license.
|
74
|
+
|
43
75
|
## Contact
|
44
|
-
You can reach me at
|
76
|
+
You can reach me at uirusu[@]arxopia[dot]com or http://www.arxopia.com
|
data/Rakefile
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
# Copyright (c) 2012 Arxopia LLC.
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
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
|
16
|
+
# without specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
22
|
+
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
|
1
29
|
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
2
30
|
|
3
31
|
require 'rubygems'
|
data/TODO.markdown
CHANGED
data/bin/uirusu
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
# Copyright (c) 2012 Arxopia LLC.
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
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
|
16
|
+
# without specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
22
|
+
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
|
1
29
|
#!/usr/bin/env ruby
|
2
30
|
|
3
31
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '/../lib'))
|
@@ -1,3 +1,31 @@
|
|
1
|
+
# Copyright (c) 2012 Arxopia LLC.
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
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
|
16
|
+
# without specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
22
|
+
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
|
1
29
|
module Uirusu
|
2
30
|
module CLI
|
3
31
|
class Application
|
data/lib/uirusu/vtcomment.rb
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
# Copyright (c) 2012 Arxopia LLC.
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
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
|
16
|
+
# without specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
22
|
+
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
|
1
29
|
module Uirusu
|
2
30
|
# Module for submiting comments to Virustotal.com resources using the
|
3
31
|
# Virustotal.com public API
|
data/lib/uirusu/vtfile.rb
CHANGED
@@ -1,10 +1,39 @@
|
|
1
|
+
# Copyright (c) 2012 Arxopia LLC.
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
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
|
16
|
+
# without specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
22
|
+
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
|
1
29
|
module Uirusu
|
30
|
+
|
2
31
|
# Module for Accessing the File scan and report functionalities of the
|
3
32
|
# Virustotal.com public API
|
4
33
|
module VTFile
|
5
34
|
SCAN_URL = "http://www.virustotal.com/vtapi/v2/file/scan"
|
6
35
|
REPORT_URL = "https://www.virustotal.com/vtapi/v2/file/report"
|
7
|
-
|
36
|
+
|
8
37
|
# Queries a report from Virustotal.com
|
9
38
|
#
|
10
39
|
# @param api_key Virustotal.com API key
|
@@ -15,13 +44,13 @@ module Uirusu
|
|
15
44
|
if api_key == nil
|
16
45
|
raise "Invalid API Key"
|
17
46
|
end
|
18
|
-
|
47
|
+
|
19
48
|
if resource == nil
|
20
49
|
raise "Invalid resource, must be MD5/sha1/sha256/scan_id"
|
21
50
|
end
|
22
51
|
|
23
52
|
response = RestClient.post REPORT_URL, :apikey => api_key, :resource => resource
|
24
|
-
|
53
|
+
|
25
54
|
case response.code
|
26
55
|
when 429
|
27
56
|
raise "Virustotal limit reached. Try again later."
|
@@ -33,24 +62,24 @@ module Uirusu
|
|
33
62
|
nil
|
34
63
|
end
|
35
64
|
end
|
36
|
-
|
65
|
+
|
37
66
|
# Submits a file to Virustotal.com for analysis
|
38
|
-
#
|
67
|
+
#
|
39
68
|
# @param api_key Virustotal.com API key
|
40
69
|
# @param path_to_file Path to file on disk to upload
|
41
70
|
#
|
42
71
|
# @return [JSON] Parsed response
|
43
|
-
def self.scan_file(api_key, path_to_file)
|
72
|
+
def self.scan_file(api_key, path_to_file)
|
44
73
|
if !File.exists?(path_to_file)
|
45
74
|
raise Errno::ENOENT
|
46
75
|
end
|
47
|
-
|
76
|
+
|
48
77
|
if api_key == nil
|
49
78
|
raise "Invalid API Key"
|
50
79
|
end
|
51
|
-
|
80
|
+
|
52
81
|
response = RestClient.post SCAN_URL, :apikey => api_key, :filename=> path_to_file, :file => File.new(path_to_file, 'rb')
|
53
|
-
|
82
|
+
|
54
83
|
case response.code
|
55
84
|
when 429
|
56
85
|
raise "Virustotal limit reached. Try again later."
|
data/lib/uirusu/vtresult.rb
CHANGED
@@ -1,6 +1,34 @@
|
|
1
|
+
# Copyright (c) 2012 Arxopia LLC.
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
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
|
16
|
+
# without specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
22
|
+
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
|
1
29
|
module Uirusu
|
2
|
-
|
3
|
-
#
|
30
|
+
|
31
|
+
#A wrapper class to hold all of the data for a single Virus total result
|
4
32
|
class VTResult
|
5
33
|
def initialize hash, result
|
6
34
|
if result == nil
|
@@ -33,7 +61,7 @@ module Uirusu
|
|
33
61
|
md5 = result["md5"]
|
34
62
|
sha1 = result["sha1"]
|
35
63
|
sha256 = result["sha256"]
|
36
|
-
|
64
|
+
|
37
65
|
result["scans"].each do |scanner, value|
|
38
66
|
if value != ''
|
39
67
|
res = Hash.new
|
@@ -50,7 +78,7 @@ module Uirusu
|
|
50
78
|
else
|
51
79
|
res['result'] = value["result"]
|
52
80
|
end
|
53
|
-
|
81
|
+
|
54
82
|
res['update'] = value['update']
|
55
83
|
res['permalink'] = permalink unless permalink == nil
|
56
84
|
|
@@ -58,7 +86,7 @@ module Uirusu
|
|
58
86
|
end
|
59
87
|
end
|
60
88
|
end
|
61
|
-
|
89
|
+
|
62
90
|
#if we didn't have any results let create a fake not found
|
63
91
|
if @results.size == 0
|
64
92
|
res = Hash.new
|
@@ -73,7 +101,7 @@ module Uirusu
|
|
73
101
|
res['result'] = '-'
|
74
102
|
res['update'] = '-'
|
75
103
|
res['result'] = result["verbose_msg"]
|
76
|
-
@results.push res
|
104
|
+
@results.push res
|
77
105
|
end
|
78
106
|
end
|
79
107
|
|
@@ -81,10 +109,10 @@ module Uirusu
|
|
81
109
|
#
|
82
110
|
def to_stdout
|
83
111
|
result_string = String.new
|
84
|
-
@results.each do |result|
|
112
|
+
@results.each do |result|
|
85
113
|
result_string << "#{result['hash']}: Scanner: #{result['scanner']} Result: #{result['result']}\n"
|
86
114
|
end
|
87
|
-
|
115
|
+
|
88
116
|
print result_string
|
89
117
|
end
|
90
118
|
|
@@ -104,7 +132,7 @@ module Uirusu
|
|
104
132
|
result_string << " permalink: #{result['permalink']}\n" unless result['permalink'] == nil
|
105
133
|
result_string << " result: #{result['result']}\n\n"
|
106
134
|
end
|
107
|
-
|
135
|
+
|
108
136
|
print result_string
|
109
137
|
end
|
110
138
|
|
@@ -125,7 +153,7 @@ module Uirusu
|
|
125
153
|
result_string << "\t\t<result>#{result['result']}</result>\n"
|
126
154
|
result_string << "\t</vtresult>\n"
|
127
155
|
end
|
128
|
-
|
156
|
+
|
129
157
|
print result_string
|
130
158
|
end
|
131
159
|
end
|
data/lib/uirusu/vturl.rb
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
# Copyright (c) 2012 Arxopia LLC.
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
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
|
16
|
+
# without specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
22
|
+
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
|
1
29
|
module Uirusu
|
2
30
|
#
|
3
31
|
#
|
data/lib/uirusu.rb
CHANGED
@@ -1,6 +1,34 @@
|
|
1
|
+
# Copyright (c) 2012 Arxopia LLC.
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
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
|
16
|
+
# without specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
22
|
+
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
|
1
29
|
module Uirusu
|
2
30
|
APP_NAME = "uirusu"
|
3
|
-
VERSION = "0.0.
|
31
|
+
VERSION = "0.0.3"
|
4
32
|
CONFIG_FILE = "~/.uirusu"
|
5
33
|
end
|
6
34
|
|
@@ -13,4 +41,4 @@ require 'uirusu/vtfile'
|
|
13
41
|
require 'uirusu/vturl'
|
14
42
|
require 'uirusu/vtcomment'
|
15
43
|
require 'uirusu/vtresult'
|
16
|
-
require 'uirusu/cli/application'
|
44
|
+
require 'uirusu/cli/application'
|
data/uirusu.gemspec
CHANGED
@@ -10,22 +10,22 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.summary = Uirusu::APP_NAME
|
11
11
|
s.description = "uirusu is library for interacting with Virustotal.org"
|
12
12
|
s.license = "BSD"
|
13
|
-
|
13
|
+
|
14
14
|
s.author = "Jacob Hammack"
|
15
15
|
s.email = "jacob.hammack@hammackj.com"
|
16
|
-
|
16
|
+
|
17
17
|
s.files = Dir['[A-Z]*'] + Dir['lib/**/*'] + ['uirusu.gemspec']
|
18
18
|
s.default_executable = 'uirusu'
|
19
19
|
s.executables = ['uirusu']
|
20
20
|
s.require_paths = ["lib"]
|
21
|
-
|
22
|
-
s.required_ruby_version = '>= 1.9.
|
21
|
+
|
22
|
+
s.required_ruby_version = '>= 1.9.2'
|
23
23
|
s.required_rubygems_version = ">= 1.8.16"
|
24
|
-
|
24
|
+
|
25
25
|
s.has_rdoc = 'yard'
|
26
26
|
s.extra_rdoc_files = ["README.markdown", "LICENSE", "NEWS.markdown", "TODO.markdown"]
|
27
|
-
|
27
|
+
|
28
28
|
s.add_dependency('json', '>= 1.5.1')
|
29
29
|
s.add_dependency('rest-client', '>= 1.6.1')
|
30
|
-
|
30
|
+
|
31
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: 1.5.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.5.1
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: rest-client
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,7 +37,12 @@ dependencies:
|
|
32
37
|
version: 1.6.1
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.6.1
|
36
46
|
description: uirusu is library for interacting with Virustotal.org
|
37
47
|
email: jacob.hammack@hammackj.com
|
38
48
|
executables:
|
@@ -44,16 +54,16 @@ extra_rdoc_files:
|
|
44
54
|
- NEWS.markdown
|
45
55
|
- TODO.markdown
|
46
56
|
files:
|
57
|
+
- README.markdown
|
47
58
|
- LICENSE
|
48
59
|
- NEWS.markdown
|
49
|
-
- Rakefile
|
50
|
-
- README.markdown
|
51
60
|
- TODO.markdown
|
61
|
+
- Rakefile
|
62
|
+
- lib/uirusu/vturl.rb
|
63
|
+
- lib/uirusu/vtfile.rb
|
52
64
|
- lib/uirusu/cli/application.rb
|
53
65
|
- lib/uirusu/vtcomment.rb
|
54
|
-
- lib/uirusu/vtfile.rb
|
55
66
|
- lib/uirusu/vtresult.rb
|
56
|
-
- lib/uirusu/vturl.rb
|
57
67
|
- lib/uirusu.rb
|
58
68
|
- uirusu.gemspec
|
59
69
|
- bin/uirusu
|
@@ -69,7 +79,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
79
|
requirements:
|
70
80
|
- - ! '>='
|
71
81
|
- !ruby/object:Gem::Version
|
72
|
-
version: 1.9.
|
82
|
+
version: 1.9.2
|
73
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
84
|
none: false
|
75
85
|
requirements:
|
@@ -78,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
88
|
version: 1.8.16
|
79
89
|
requirements: []
|
80
90
|
rubyforge_project:
|
81
|
-
rubygems_version: 1.8.
|
91
|
+
rubygems_version: 1.8.24
|
82
92
|
signing_key:
|
83
93
|
specification_version: 3
|
84
94
|
summary: uirusu
|