simple_whatweb 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/SimpleWhatWeb.gemspec +1 -1
- data/lib/whatweb/helper.rb +6 -3
- data/lib/whatweb/matcher/ghdb.rb +2 -2
- data/lib/whatweb/plugins/anygate.rb +0 -1
- data/lib/whatweb/plugins/bm-classifieds.rb +0 -1
- data/lib/whatweb/plugins/fidion-cms.rb +0 -1
- data/lib/whatweb/plugins/mihalism-multi-host.rb +0 -1
- data/lib/whatweb/plugins/netsnap-web-camera.rb +0 -1
- data/lib/whatweb/plugins/rvi-camera.rb +0 -1
- data/lib/whatweb/plugins/s-cms.rb +0 -1
- data/lib/whatweb/plugins/samphpweb.rb +0 -1
- data/lib/whatweb/plugins/snografx.rb +0 -1
- data/lib/whatweb/plugins/title.rb +3 -3
- data/lib/whatweb/target.rb +2 -2
- data/lib/whatweb/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa93fc00fb8c3719932816eda5f66233849319c2c97536b74a9fd3590864f3ab
|
4
|
+
data.tar.gz: a24e458f6488eeb31b5ca814b14af6662363b807d8f72f57053fe364f8f6aa41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d42ceb9c118d0081712d4e5551b6899d0ec774af54ed3cf623744dbb59be8321ecdd785b32f3531a0a17ba7e4d0f77daa976bbf3fd1ea958b9bc84750a72d0a9
|
7
|
+
data.tar.gz: 98609d498e9a948cf813d80031864f8d346905fecfa3e551497e970b2dff8f7525bb49b24d135baa67b97c3af523fc2b7701d00ab7fd3d7d1c95d721c8df9824
|
data/SimpleWhatWeb.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency "webmock", "~> 3.4"
|
33
33
|
|
34
34
|
spec.add_dependency "http", "~> 3.3"
|
35
|
+
spec.add_dependency "oga", "~> 2.15"
|
35
36
|
spec.add_dependency "require_all", "~> 2.0"
|
36
|
-
spec.add_dependency "sanitize", "~> 4.6"
|
37
37
|
spec.add_dependency "thor", "~> 0.19"
|
38
38
|
end
|
data/lib/whatweb/helper.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "digest/md5"
|
4
|
-
require "
|
4
|
+
require "oga"
|
5
5
|
|
6
6
|
module WhatWeb
|
7
7
|
module Helper
|
@@ -10,8 +10,11 @@ module WhatWeb
|
|
10
10
|
Digest::MD5.hexdigest(body.to_s)
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
14
|
-
|
13
|
+
def text
|
14
|
+
doc = Oga.parse_html(body.to_s.force_encoding('UTF-8'))
|
15
|
+
path = /\A<body(?:\s|>)/i.match?(body.to_s) ? '/html/body' : '/html/body/node()'
|
16
|
+
nodes = doc.xpath(path)
|
17
|
+
nodes.map(&:text).join
|
15
18
|
end
|
16
19
|
|
17
20
|
def tag_pattern
|
data/lib/whatweb/matcher/ghdb.rb
CHANGED
@@ -45,10 +45,10 @@ module WhatWeb
|
|
45
45
|
# does it start with a - ?
|
46
46
|
if w[0] == '-'
|
47
47
|
# reverse true/false if it begins with a -
|
48
|
-
!target.
|
48
|
+
!target.text.match? /#{Regexp.escape(w[1..-1])}/i
|
49
49
|
else
|
50
50
|
w = w[1..-1] if w[0] == '+' # if it starts with +, ignore the 1st char
|
51
|
-
target.
|
51
|
+
target.text.match? /#{Regexp.escape(w)}/i
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -12,7 +12,7 @@
|
|
12
12
|
# Version 0.2
|
13
13
|
# removed :certainty=>100
|
14
14
|
|
15
|
-
require "
|
15
|
+
require "oga"
|
16
16
|
|
17
17
|
WhatWeb::Plugin.define "Title" do
|
18
18
|
@author = "Andrew Horton"
|
@@ -22,8 +22,8 @@ WhatWeb::Plugin.define "Title" do
|
|
22
22
|
def passive(target)
|
23
23
|
m = []
|
24
24
|
|
25
|
-
html =
|
26
|
-
title = html.
|
25
|
+
html = Oga.parse_html(target.body)
|
26
|
+
title = html.at_css("title")
|
27
27
|
if title
|
28
28
|
# Give warining if title element contains newline(s)
|
29
29
|
m << { name: "WARNING", module: "Title element contains newline(s)!" } if title.text.include? "\n"
|
data/lib/whatweb/target.rb
CHANGED
data/lib/whatweb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_whatweb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Niseki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -109,33 +109,33 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '3.3'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: oga
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '2.
|
117
|
+
version: '2.15'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '2.
|
124
|
+
version: '2.15'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: require_all
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
131
|
+
version: '2.0'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
138
|
+
version: '2.0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: thor
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|