wappalyzer 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 119dc327d284571e6f61f9d212b892acc27f80f5
4
- data.tar.gz: 43911aa6af7ee07882902d7d8c35aa848efcfd4a
3
+ metadata.gz: f0543ba8905811175b0f1cbb1807c8c5a74d5a90
4
+ data.tar.gz: 63646604ad982711daff02f0699346ea8a5468cb
5
5
  SHA512:
6
- metadata.gz: 1177f6cdf7605a0d0f90c004e6d56cab7c261f66fa47579c598acf4618f0b04a3fd0c8685558c06f7a9bcbc88d8d1299309ce37e30fc037b1998a612dae8d49d
7
- data.tar.gz: 54f568f824cda7e9de21065132c10a9aef0a52e16d77685f8f0356c3cc535d7dcb2d3c16c23d66cfe624c896dcbccc5dcc129e987d026c434848fe2d5d60f05e
6
+ metadata.gz: c52aed068ce38f64a29c6c42e3624661d81f5614617ab8ae742c1af6dbb0a3f776e2fc29cbe0806117af4527ff1a39004c6ff8ca3dda3fd6aff6ce2093828406
7
+ data.tar.gz: e905e0d118a20d10a2ec6c9d06b3fecdac24cc9d660c1436729c7201dfe8183226eaea4480b9b267193a35f4518ff3db18d3e6c8b476a609c63578df35f5bf5a
@@ -5,6 +5,7 @@ require "wappalyzer/version"
5
5
  require 'net/http'
6
6
  require 'mini_racer'
7
7
  require 'json'
8
+ require 'zlib'
8
9
 
9
10
  Encoding.default_external = Encoding::UTF_8
10
11
 
@@ -19,10 +20,18 @@ module Wappalyzer
19
20
 
20
21
  def analyze(url)
21
22
  uri, body, headers = URI(url), nil, {}
22
- Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https', :open_timeout => 5) do |http|
23
- resp = http.get(uri.request_uri)
24
- resp.each_header{|k,v| headers[k.downcase] = v}
25
- body = resp.body.encode('UTF-8', :invalid => :replace, :undef => :replace)
23
+ Net::HTTP.start(uri.host, uri.port,
24
+ :use_ssl => uri.scheme == 'https',
25
+ :verify_mode => OpenSSL::SSL::VERIFY_NONE,
26
+ :open_timeout => 5) do |http|
27
+ begin
28
+ resp = http.get(uri.request_uri)
29
+ rescue Zlib::DataError
30
+ resp = http.get(uri.request_uri, "Accept-Encoding" => "none")
31
+ end
32
+
33
+ resp.each_header { |k,v| headers[utf8_encoding(k).downcase] = utf8_encoding(v) }
34
+ body = utf8_encoding(resp.body)
26
35
  end
27
36
 
28
37
  cxt = MiniRacer::Context.new
@@ -32,6 +41,12 @@ module Wappalyzer
32
41
  output = cxt.eval("w.apps = #{@apps.to_json}; w.categories = #{@categories.to_json}; w.driver.data = #{data.to_json}; w.driver.init();")
33
42
  JSON.load(output)
34
43
  end
44
+
45
+ private
46
+
47
+ def utf8_encoding(str)
48
+ str.encode('UTF-8', :invalid => :replace, :undef => :replace)
49
+ end
35
50
  end
36
51
  end
37
52
 
@@ -1,3 +1,3 @@
1
1
  module Wappalyzer
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "mini_racer", "~> 0.1.4"
21
+ spec.add_dependency "mini_racer", "~> 0.2.4"
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.11"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wappalyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - pulkit21
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-27 00:00:00.000000000 Z
11
+ date: 2019-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mini_racer
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.4
19
+ version: 0.2.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.4
26
+ version: 0.2.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.6.7
111
+ rubygems_version: 2.6.12
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Analyzes a provided url and returns any services it can detect