uirusu 0.0.3 → 0.0.4
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 +7 -0
- data/LICENSE +1 -1
- data/NEWS.markdown +11 -1
- data/README.markdown +2 -3
- data/Rakefile +10 -10
- data/TODO.markdown +1 -0
- data/bin/uirusu +3 -3
- data/lib/uirusu.rb +2 -2
- data/lib/uirusu/cli/application.rb +19 -5
- data/lib/uirusu/vtcomment.rb +1 -1
- data/lib/uirusu/vtfile.rb +2 -2
- data/lib/uirusu/vtresult.rb +5 -5
- data/lib/uirusu/vturl.rb +20 -20
- data/uirusu.gemspec +46 -19
- metadata +22 -27
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA1:
         | 
| 3 | 
            +
              metadata.gz: cf7de8705fa6a0e595f9c1a1781dd4936ea9df91
         | 
| 4 | 
            +
              data.tar.gz: 698407a8dddc1a1b8fb9aac9de18afb33b2c4248
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: 1e9dc51ae0271f2640578e26572e76014d78c29125d47bab199c1715b56d273e68402da9d317ee4e47be21af698bd776359cb56138b9edba5338cd632888cf5d
         | 
| 7 | 
            +
              data.tar.gz: c86b7afc18da01de6482f0eb824684fa9534207e1f19fb1bee5993031f0fe1c2425ce9401ffb5b8cd42404589d88802c3670a76f89ccf70816c0bbb863ce5cb9
         | 
    
        data/LICENSE
    CHANGED
    
    
    
        data/NEWS.markdown
    CHANGED
    
    | @@ -1,8 +1,18 @@ | |
| 1 1 | 
             
            # News
         | 
| 2 2 |  | 
| 3 | 
            +
            # 0.0.4 (April 11, 2013)
         | 
| 4 | 
            +
            - Added Proxy support [abenson]
         | 
| 5 | 
            +
            - Copyright date updates
         | 
| 6 | 
            +
            - Made sure each hash request waits for the timeout specified in the yaml file
         | 
| 7 | 
            +
            - The default timeout is 15 seconds, by default virustotal.org only allows 4 requests per minute
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            # 0.0.3 ()
         | 
| 10 | 
            +
            - Gemspec fix
         | 
| 11 | 
            +
             | 
| 3 12 | 
             
            # 0.0.2 ()
         | 
| 4 | 
            -
            -
         | 
| 13 | 
            +
            - Copyright fixes
         | 
| 5 14 |  | 
| 6 15 | 
             
            # 0.0.1 (March 4, 2012)
         | 
| 7 16 | 
             
            - Rename ruby-virustotal/virustotal gem to uirusu, to prevent being sued.
         | 
| 8 17 | 
             
            - Complete rewrite of the gem
         | 
| 18 | 
            +
             | 
    
        data/README.markdown
    CHANGED
    
    | @@ -2,12 +2,11 @@ | |
| 2 2 |  | 
| 3 3 | 
             
            uirusu is an [Virustotal](http://www.virustotal.com) automation and convenience tool for hash, file and URL submission.
         | 
| 4 4 |  | 
| 5 | 
            -
            The current version is 0.0. | 
| 5 | 
            +
            The current version is 0.0.4.
         | 
| 6 6 |  | 
| 7 7 | 
             
            ## Requirements
         | 
| 8 8 |  | 
| 9 9 | 
             
            * ruby
         | 
| 10 | 
            -
            * rubygems
         | 
| 11 10 | 
             
            * json
         | 
| 12 11 | 
             
            * rest-client
         | 
| 13 12 |  | 
| @@ -73,4 +72,4 @@ print results if results != nil | |
| 73 72 | 
             
            Uirusu is licensed under the BSD license see the `LICENSE` file for the full license.
         | 
| 74 73 |  | 
| 75 74 | 
             
            ## Contact
         | 
| 76 | 
            -
            You can reach  | 
| 75 | 
            +
            You can reach the team at uirusu[@]arxopia[dot]com or http://www.arxopia.com
         | 
    
        data/Rakefile
    CHANGED
    
    | @@ -1,20 +1,20 @@ | |
| 1 | 
            -
            # Copyright (c) 2012 Arxopia LLC.
         | 
| 1 | 
            +
            # Copyright (c) 2012-2013 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
         | 
| @@ -39,7 +39,7 @@ end | |
| 39 39 |  | 
| 40 40 | 
             
            task :release => :build do
         | 
| 41 41 | 
             
              system "gem push #{Uirusu::APP_NAME}-#{Uirusu::VERSION}.gem"
         | 
| 42 | 
            -
            	puts "Just released #{Uirusu::APP_NAME} v#{Uirusu::VERSION}. #{Uirusu::APP_NAME} is  | 
| 42 | 
            +
            	puts "Just released #{Uirusu::APP_NAME} v#{Uirusu::VERSION}. #{Uirusu::APP_NAME} is rubygem for using the Virustotal web service! More information at http://arxopia.com/projects/uirusu/"
         | 
| 43 43 | 
             
            end
         | 
| 44 44 |  | 
| 45 45 | 
             
            task :clean do
         | 
    
        data/TODO.markdown
    CHANGED
    
    
    
        data/bin/uirusu
    CHANGED
    
    | @@ -1,4 +1,6 @@ | |
| 1 | 
            -
             | 
| 1 | 
            +
            #!/usr/bin/env ruby
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            # Copyright (c) 2012-2013 Arxopia LLC.
         | 
| 2 4 | 
             
            # All rights reserved.
         | 
| 3 5 | 
             
            # 
         | 
| 4 6 | 
             
            # Redistribution and use in source and binary forms, with or without
         | 
| @@ -26,8 +28,6 @@ | |
| 26 28 | 
             
            # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
         | 
| 27 29 | 
             
            # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
         | 
| 28 30 |  | 
| 29 | 
            -
            #!/usr/bin/env ruby
         | 
| 30 | 
            -
             | 
| 31 31 | 
             
            $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '/../lib'))
         | 
| 32 32 |  | 
| 33 33 | 
             
            require 'rubygems'
         | 
    
        data/lib/uirusu.rb
    CHANGED
    
    | @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            # Copyright (c) 2012 Arxopia LLC.
         | 
| 1 | 
            +
            # Copyright (c) 2012-2013 Arxopia LLC.
         | 
| 2 2 | 
             
            # All rights reserved.
         | 
| 3 3 | 
             
            #
         | 
| 4 4 | 
             
            # Redistribution and use in source and binary forms, with or without
         | 
| @@ -28,7 +28,7 @@ | |
| 28 28 |  | 
| 29 29 | 
             
            module Uirusu
         | 
| 30 30 | 
             
            	APP_NAME = "uirusu"
         | 
| 31 | 
            -
            	VERSION = "0.0. | 
| 31 | 
            +
            	VERSION = "0.0.4"
         | 
| 32 32 | 
             
            	CONFIG_FILE = "~/.uirusu"
         | 
| 33 33 | 
             
            end
         | 
| 34 34 |  | 
| @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            # Copyright (c) 2012 Arxopia LLC.
         | 
| 1 | 
            +
            # Copyright (c) 2012-2013 Arxopia LLC.
         | 
| 2 2 | 
             
            # All rights reserved.
         | 
| 3 3 | 
             
            # 
         | 
| 4 4 | 
             
            # Redistribution and use in source and binary forms, with or without
         | 
| @@ -48,6 +48,7 @@ module Uirusu | |
| 48 48 | 
             
            				begin
         | 
| 49 49 | 
             
            					@options['output'] = :stdout
         | 
| 50 50 | 
             
            					@options['verbose'] = false
         | 
| 51 | 
            +
            					@options[:timeout] = 25
         | 
| 51 52 |  | 
| 52 53 | 
             
            					opt = OptionParser.new do |opt|
         | 
| 53 54 | 
             
            						opt.banner =	"#{APP_NAME} v#{VERSION}\nJacob Hammack\nhttp://www.hammackj.com\n\n"
         | 
| @@ -116,6 +117,10 @@ module Uirusu | |
| 116 117 | 
             
            							end
         | 
| 117 118 | 
             
            						end
         | 
| 118 119 |  | 
| 120 | 
            +
            						opt.on('-p PROXY', '--proxy-server', 'Uses a specified proxy server') do |proxy|
         | 
| 121 | 
            +
            							@options['proxy'] = proxy
         | 
| 122 | 
            +
            						end
         | 
| 123 | 
            +
             | 
| 119 124 | 
             
            						opt.on('--[no-]verbose', 'Print verbose information') do |v|
         | 
| 120 125 | 
             
            							@options["verbose"] = v
         | 
| 121 126 | 
             
            						end
         | 
| @@ -155,6 +160,8 @@ module Uirusu | |
| 155 160 | 
             
            					STDERR.puts "[!] #{CONFIG_FILE} does not exist. Please run #{APP_NAME} --create-config, to create it."
         | 
| 156 161 | 
             
            					exit
         | 
| 157 162 | 
             
            				end
         | 
| 163 | 
            +
             | 
| 164 | 
            +
            				@options[:timeout] = @config["virustotal"]["timeout"] if @config["virustotal"]["timeout"] != nil
         | 
| 158 165 | 
             
            			end
         | 
| 159 166 |  | 
| 160 167 | 
             
            			# Submits a file/url and waits for analysis to be complete and returns the results.
         | 
| @@ -203,7 +210,7 @@ module Uirusu | |
| 203 210 | 
             
            						nil
         | 
| 204 211 | 
             
            					end	
         | 
| 205 212 | 
             
            				rescue => e					
         | 
| 206 | 
            -
            					STDERR.puts "[!] An error has  | 
| 213 | 
            +
            					STDERR.puts "[!] An error has occurred retrieving the report. Retrying 60 seconds up #{retries} retries.\n" if  @options["verbose"]
         | 
| 207 214 | 
             
            					if retries >= 0
         | 
| 208 215 | 
             
            						sleep 60
         | 
| 209 216 | 
             
            						retry
         | 
| @@ -227,6 +234,10 @@ module Uirusu | |
| 227 234 | 
             
            					print "<results>\n"
         | 
| 228 235 | 
             
            				end
         | 
| 229 236 |  | 
| 237 | 
            +
            				if @options['proxy'] != nil
         | 
| 238 | 
            +
            					RestClient.proxy = @options['proxy']
         | 
| 239 | 
            +
            				end
         | 
| 240 | 
            +
             | 
| 230 241 | 
             
            				if @files_of_hashes != nil
         | 
| 231 242 | 
             
            					@files_of_hashes.each do |file|
         | 
| 232 243 | 
             
            						f = File.open(file, 'r')
         | 
| @@ -239,26 +250,29 @@ module Uirusu | |
| 239 250 | 
             
            				end		
         | 
| 240 251 |  | 
| 241 252 | 
             
            				if @hashes != nil
         | 
| 242 | 
            -
            					@hashes. | 
| 253 | 
            +
            					@hashes.each_with_index do |hash, index|
         | 
| 243 254 | 
             
            						results = Uirusu::VTFile.query_report(@config["virustotal"]["api-key"], hash)
         | 
| 244 255 | 
             
            						result = Uirusu::VTResult.new(hash, results)
         | 
| 245 256 | 
             
            						print result.send output_method if result != nil
         | 
| 257 | 
            +
            						sleep @options[:timeout] if index != @hashes.length - 1
         | 
| 246 258 | 
             
            					end
         | 
| 247 259 | 
             
            				end
         | 
| 248 260 |  | 
| 249 261 | 
             
            				if @sites != nil
         | 
| 250 | 
            -
            					@sites. | 
| 262 | 
            +
            					@sites.each_with_index do |url, index|
         | 
| 251 263 | 
             
            						results = scan_and_wait(Uirusu::VTUrl, url, 5)
         | 
| 252 264 | 
             
            						result = Uirusu::VTResult.new(results[0], results[1])
         | 
| 253 265 | 
             
            						print result.send output_method if result != nil
         | 
| 266 | 
            +
            						sleep @options[:timeout] if index != @sites.length - 1
         | 
| 254 267 | 
             
            					end
         | 
| 255 268 | 
             
            				end
         | 
| 256 269 |  | 
| 257 270 | 
             
            				if @uploads != nil
         | 
| 258 | 
            -
            					@uploads. | 
| 271 | 
            +
            					@uploads.each_with_index do |upload, index|
         | 
| 259 272 | 
             
            						results = scan_and_wait(Uirusu::VTFile, upload, 5)
         | 
| 260 273 | 
             
            						result = Uirusu::VTResult.new(results[0], results[1])						
         | 
| 261 274 | 
             
            						print result.send output_method if result != nil
         | 
| 275 | 
            +
            						sleep @options[:timeout] if index != @uploads.length - 1
         | 
| 262 276 | 
             
            					end
         | 
| 263 277 | 
             
            				end
         | 
| 264 278 |  | 
    
        data/lib/uirusu/vtcomment.rb
    CHANGED
    
    
    
        data/lib/uirusu/vtfile.rb
    CHANGED
    
    | @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            # Copyright (c) 2012 Arxopia LLC.
         | 
| 1 | 
            +
            # Copyright (c) 2012-2013 Arxopia LLC.
         | 
| 2 2 | 
             
            # All rights reserved.
         | 
| 3 3 | 
             
            #
         | 
| 4 4 | 
             
            # Redistribution and use in source and binary forms, with or without
         | 
| @@ -46,7 +46,7 @@ module Uirusu | |
| 46 46 | 
             
            			end
         | 
| 47 47 |  | 
| 48 48 | 
             
            			if resource == nil
         | 
| 49 | 
            -
            				raise "Invalid resource, must be  | 
| 49 | 
            +
            				raise "Invalid resource, must be md5/sha1/sha256/scan_id"
         | 
| 50 50 | 
             
            			end
         | 
| 51 51 |  | 
| 52 52 | 
             
            			response = RestClient.post REPORT_URL, :apikey => api_key, :resource => resource
         | 
    
        data/lib/uirusu/vtresult.rb
    CHANGED
    
    | @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            # Copyright (c) 2012 Arxopia LLC.
         | 
| 1 | 
            +
            # Copyright (c) 2012-2013 Arxopia LLC.
         | 
| 2 2 | 
             
            # All rights reserved.
         | 
| 3 3 | 
             
            #
         | 
| 4 4 | 
             
            # Redistribution and use in source and binary forms, with or without
         | 
| @@ -87,7 +87,7 @@ module Uirusu | |
| 87 87 | 
             
            				end
         | 
| 88 88 | 
             
            			end
         | 
| 89 89 |  | 
| 90 | 
            -
            			#if we didn't have any results  | 
| 90 | 
            +
            			#if we didn't have any results lets create a fake not found
         | 
| 91 91 | 
             
            			if @results.size == 0
         | 
| 92 92 | 
             
            				res = Hash.new
         | 
| 93 93 | 
             
            				res['hash'] = hash
         | 
| @@ -111,7 +111,7 @@ module Uirusu | |
| 111 111 | 
             
            			result_string = String.new
         | 
| 112 112 | 
             
            			@results.each do |result|
         | 
| 113 113 | 
             
            				result_string << "#{result['hash']}: Scanner: #{result['scanner']} Result: #{result['result']}\n"
         | 
| 114 | 
            -
            			end
         | 
| 114 | 
            +
            			end if @results != nil
         | 
| 115 115 |  | 
| 116 116 | 
             
            			print result_string
         | 
| 117 117 | 
             
            		end
         | 
| @@ -131,7 +131,7 @@ module Uirusu | |
| 131 131 | 
             
            				result_string << "  date: #{result['date']}\n"
         | 
| 132 132 | 
             
            				result_string << "  permalink: #{result['permalink']}\n" unless result['permalink'] == nil
         | 
| 133 133 | 
             
            				result_string << "  result: #{result['result']}\n\n"
         | 
| 134 | 
            -
            			end
         | 
| 134 | 
            +
            			end if @results != nil
         | 
| 135 135 |  | 
| 136 136 | 
             
            			print result_string
         | 
| 137 137 | 
             
            		end
         | 
| @@ -152,7 +152,7 @@ module Uirusu | |
| 152 152 | 
             
            				result_string << "\t\t<permalink>#{result['permalink']}</permalink>\n" unless result['permalink'] == nil
         | 
| 153 153 | 
             
            				result_string << "\t\t<result>#{result['result']}</result>\n"
         | 
| 154 154 | 
             
            				result_string << "\t</vtresult>\n"
         | 
| 155 | 
            -
            			end
         | 
| 155 | 
            +
            			end if @results != nil
         | 
| 156 156 |  | 
| 157 157 | 
             
            			print result_string
         | 
| 158 158 | 
             
            		end
         | 
    
        data/lib/uirusu/vturl.rb
    CHANGED
    
    | @@ -1,20 +1,20 @@ | |
| 1 | 
            -
            # Copyright (c) 2012 Arxopia LLC.
         | 
| 1 | 
            +
            # Copyright (c) 2012-2013 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
         | 
| @@ -32,7 +32,7 @@ module Uirusu | |
| 32 32 | 
             
            	module VTUrl
         | 
| 33 33 | 
             
            		SCAN_URL = "https://www.virustotal.com/vtapi/v2/url/scan"
         | 
| 34 34 | 
             
            		REPORT_URL = "http://www.virustotal.com/vtapi/v2/url/report"
         | 
| 35 | 
            -
             | 
| 35 | 
            +
             | 
| 36 36 | 
             
            		# Submits a URL to be scanned by Virustotal.com
         | 
| 37 37 | 
             
            		#
         | 
| 38 38 | 
             
            		# @param api_key Virustotal.com API key
         | 
| @@ -43,13 +43,13 @@ 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 | 
             
            			response = RestClient.post SCAN_URL, :apikey => api_key, :url => resource
         | 
| 52 | 
            -
             | 
| 52 | 
            +
             | 
| 53 53 | 
             
            			case response.code
         | 
| 54 54 | 
             
            				when 429
         | 
| 55 55 | 
             
            					raise "Virustotal limit reached. Try again later."
         | 
| @@ -59,10 +59,10 @@ module Uirusu | |
| 59 59 | 
             
            					JSON.parse(response)
         | 
| 60 60 | 
             
            				else
         | 
| 61 61 | 
             
            					raise "Unknown Server error."
         | 
| 62 | 
            -
            			end | 
| 62 | 
            +
            			end
         | 
| 63 63 | 
             
            		end
         | 
| 64 | 
            -
             | 
| 65 | 
            -
            		#  | 
| 64 | 
            +
             | 
| 65 | 
            +
            		# Searches reports by URL from Virustotal.com
         | 
| 66 66 | 
             
            		#
         | 
| 67 67 | 
             
            		# @param api_key Virustotal.com API key
         | 
| 68 68 | 
             
            		# @param resource url to search
         | 
| @@ -72,13 +72,13 @@ module Uirusu | |
| 72 72 | 
             
            			if api_key == nil
         | 
| 73 73 | 
             
            				raise "Invalid API Key"
         | 
| 74 74 | 
             
            			end
         | 
| 75 | 
            -
             | 
| 75 | 
            +
             | 
| 76 76 | 
             
            			if resource == nil
         | 
| 77 77 | 
             
            				raise "Invalid resource, must be a valid url"
         | 
| 78 78 | 
             
            			end
         | 
| 79 | 
            -
             | 
| 79 | 
            +
             | 
| 80 80 | 
             
            			response = RestClient.post REPORT_URL, :apikey => api_key, :resource => resource
         | 
| 81 | 
            -
             | 
| 81 | 
            +
             | 
| 82 82 | 
             
            			case response.code
         | 
| 83 83 | 
             
            				when 429
         | 
| 84 84 | 
             
            					raise "Virustotal limit reached. Try again later."
         | 
| @@ -88,7 +88,7 @@ module Uirusu | |
| 88 88 | 
             
            					JSON.parse(response)
         | 
| 89 89 | 
             
            				else
         | 
| 90 90 | 
             
            					raise "Unknown Server error."
         | 
| 91 | 
            -
            			end | 
| 91 | 
            +
            			end
         | 
| 92 92 | 
             
            		end
         | 
| 93 93 | 
             
            	end
         | 
| 94 94 | 
             
            end
         | 
    
        data/uirusu.gemspec
    CHANGED
    
    | @@ -1,31 +1,58 @@ | |
| 1 | 
            +
            # Copyright (c) 2012-2013 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 | 
             
            base = __FILE__
         | 
| 2 30 | 
             
            $:.unshift(File.join(File.dirname(base), 'lib'))
         | 
| 3 31 |  | 
| 4 32 | 
             
            require 'uirusu'
         | 
| 5 33 |  | 
| 6 34 | 
             
            Gem::Specification.new do |s|
         | 
| 7 | 
            -
            	s.name | 
| 8 | 
            -
            	s.version | 
| 9 | 
            -
            	s.homepage | 
| 10 | 
            -
            	s.summary | 
| 11 | 
            -
            	s.description | 
| 12 | 
            -
            	s.license | 
| 13 | 
            -
             | 
| 14 | 
            -
            	s.author | 
| 15 | 
            -
            	s.email | 
| 16 | 
            -
             | 
| 17 | 
            -
            	s.files | 
| 18 | 
            -
            	s.default_executable | 
| 19 | 
            -
            	s.executables | 
| 20 | 
            -
            	s.require_paths | 
| 21 | 
            -
             | 
| 22 | 
            -
            	s.required_ruby_version = '>= 1.9. | 
| 35 | 
            +
            	s.name = Uirusu::APP_NAME
         | 
| 36 | 
            +
            	s.version = Uirusu::VERSION
         | 
| 37 | 
            +
            	s.homepage = "http://github.com/arxopia/uirusu/"
         | 
| 38 | 
            +
            	s.summary = Uirusu::APP_NAME
         | 
| 39 | 
            +
            	s.description = "uirusu is library for interacting with Virustotal.org"
         | 
| 40 | 
            +
            	s.license = "BSD"
         | 
| 41 | 
            +
             | 
| 42 | 
            +
            	s.author = "Jacob Hammack"
         | 
| 43 | 
            +
            	s.email = "uirusu@arxopia.com"
         | 
| 44 | 
            +
             | 
| 45 | 
            +
            	s.files = Dir['[A-Z]*'] + Dir['lib/**/*'] + ['uirusu.gemspec']
         | 
| 46 | 
            +
            	s.default_executable = 'uirusu'
         | 
| 47 | 
            +
            	s.executables = ['uirusu']
         | 
| 48 | 
            +
            	s.require_paths	= ["lib"]
         | 
| 49 | 
            +
             | 
| 50 | 
            +
            	s.required_ruby_version = '>= 1.9.3'
         | 
| 23 51 | 
             
            	s.required_rubygems_version = ">= 1.8.16"
         | 
| 24 52 |  | 
| 25 | 
            -
            	s.has_rdoc | 
| 26 | 
            -
            	s.extra_rdoc_files | 
| 53 | 
            +
            	s.has_rdoc = 'yard'
         | 
| 54 | 
            +
            	s.extra_rdoc_files = ["README.markdown", "LICENSE", "NEWS.markdown", "TODO.markdown"]
         | 
| 27 55 |  | 
| 28 56 | 
             
            	s.add_dependency('json', '>= 1.5.1')
         | 
| 29 57 | 
             
            	s.add_dependency('rest-client', '>= 1.6.1')
         | 
| 30 | 
            -
             | 
| 31 58 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,50 +1,45 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: uirusu
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 5 | 
            -
              prerelease: 
         | 
| 4 | 
            +
              version: 0.0.4
         | 
| 6 5 | 
             
            platform: ruby
         | 
| 7 6 | 
             
            authors:
         | 
| 8 7 | 
             
            - Jacob Hammack
         | 
| 9 8 | 
             
            autorequire: 
         | 
| 10 9 | 
             
            bindir: bin
         | 
| 11 10 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date:  | 
| 11 | 
            +
            date: 2013-04-09 00:00:00.000000000 Z
         | 
| 13 12 | 
             
            dependencies:
         | 
| 14 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 14 | 
             
              name: json
         | 
| 16 15 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 17 | 
            -
                none: false
         | 
| 18 16 | 
             
                requirements:
         | 
| 19 | 
            -
                - -  | 
| 17 | 
            +
                - - '>='
         | 
| 20 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 21 19 | 
             
                    version: 1.5.1
         | 
| 22 20 | 
             
              type: :runtime
         | 
| 23 21 | 
             
              prerelease: false
         | 
| 24 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 25 | 
            -
                none: false
         | 
| 26 23 | 
             
                requirements:
         | 
| 27 | 
            -
                - -  | 
| 24 | 
            +
                - - '>='
         | 
| 28 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 29 26 | 
             
                    version: 1.5.1
         | 
| 30 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 31 28 | 
             
              name: rest-client
         | 
| 32 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 33 | 
            -
                none: false
         | 
| 34 30 | 
             
                requirements:
         | 
| 35 | 
            -
                - -  | 
| 31 | 
            +
                - - '>='
         | 
| 36 32 | 
             
                  - !ruby/object:Gem::Version
         | 
| 37 33 | 
             
                    version: 1.6.1
         | 
| 38 34 | 
             
              type: :runtime
         | 
| 39 35 | 
             
              prerelease: false
         | 
| 40 36 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 41 | 
            -
                none: false
         | 
| 42 37 | 
             
                requirements:
         | 
| 43 | 
            -
                - -  | 
| 38 | 
            +
                - - '>='
         | 
| 44 39 | 
             
                  - !ruby/object:Gem::Version
         | 
| 45 40 | 
             
                    version: 1.6.1
         | 
| 46 41 | 
             
            description: uirusu is library for interacting with Virustotal.org
         | 
| 47 | 
            -
            email:  | 
| 42 | 
            +
            email: uirusu@arxopia.com
         | 
| 48 43 | 
             
            executables:
         | 
| 49 44 | 
             
            - uirusu
         | 
| 50 45 | 
             
            extensions: []
         | 
| @@ -54,42 +49,42 @@ extra_rdoc_files: | |
| 54 49 | 
             
            - NEWS.markdown
         | 
| 55 50 | 
             
            - TODO.markdown
         | 
| 56 51 | 
             
            files:
         | 
| 57 | 
            -
            - README.markdown
         | 
| 58 | 
            -
            - LICENSE
         | 
| 59 | 
            -
            - NEWS.markdown
         | 
| 60 52 | 
             
            - TODO.markdown
         | 
| 61 53 | 
             
            - Rakefile
         | 
| 62 | 
            -
            -  | 
| 63 | 
            -
            -  | 
| 54 | 
            +
            - NEWS.markdown
         | 
| 55 | 
            +
            - README.markdown
         | 
| 56 | 
            +
            - LICENSE
         | 
| 57 | 
            +
            - lib/uirusu.rb
         | 
| 64 58 | 
             
            - lib/uirusu/cli/application.rb
         | 
| 65 | 
            -
            - lib/uirusu/vtcomment.rb
         | 
| 66 59 | 
             
            - lib/uirusu/vtresult.rb
         | 
| 67 | 
            -
            - lib/uirusu.rb
         | 
| 60 | 
            +
            - lib/uirusu/vtcomment.rb
         | 
| 61 | 
            +
            - lib/uirusu/vtfile.rb
         | 
| 62 | 
            +
            - lib/uirusu/vturl.rb
         | 
| 68 63 | 
             
            - uirusu.gemspec
         | 
| 69 64 | 
             
            - bin/uirusu
         | 
| 70 | 
            -
            homepage: http://github.com/ | 
| 65 | 
            +
            homepage: http://github.com/arxopia/uirusu/
         | 
| 71 66 | 
             
            licenses:
         | 
| 72 67 | 
             
            - BSD
         | 
| 68 | 
            +
            metadata: {}
         | 
| 73 69 | 
             
            post_install_message: 
         | 
| 74 70 | 
             
            rdoc_options: []
         | 
| 75 71 | 
             
            require_paths:
         | 
| 76 72 | 
             
            - lib
         | 
| 77 73 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 78 | 
            -
              none: false
         | 
| 79 74 | 
             
              requirements:
         | 
| 80 | 
            -
              - -  | 
| 75 | 
            +
              - - '>='
         | 
| 81 76 | 
             
                - !ruby/object:Gem::Version
         | 
| 82 | 
            -
                  version: 1.9. | 
| 77 | 
            +
                  version: 1.9.3
         | 
| 83 78 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 84 | 
            -
              none: false
         | 
| 85 79 | 
             
              requirements:
         | 
| 86 | 
            -
              - -  | 
| 80 | 
            +
              - - '>='
         | 
| 87 81 | 
             
                - !ruby/object:Gem::Version
         | 
| 88 82 | 
             
                  version: 1.8.16
         | 
| 89 83 | 
             
            requirements: []
         | 
| 90 84 | 
             
            rubyforge_project: 
         | 
| 91 | 
            -
            rubygems_version:  | 
| 85 | 
            +
            rubygems_version: 2.0.0
         | 
| 92 86 | 
             
            signing_key: 
         | 
| 93 | 
            -
            specification_version:  | 
| 87 | 
            +
            specification_version: 4
         | 
| 94 88 | 
             
            summary: uirusu
         | 
| 95 89 | 
             
            test_files: []
         | 
| 90 | 
            +
            has_rdoc: yard
         |