simple_whatweb 0.1.0 → 0.2.0
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/.rubocop.yml +172 -0
- data/README.md +8 -10
- data/lib/whatweb/cli.rb +20 -0
- data/lib/whatweb/helper.rb +1 -0
- data/lib/whatweb/matcher.rb +0 -1
- data/lib/whatweb/matcher/status.rb +3 -1
- data/lib/whatweb/matcher/url.rb +4 -2
- data/lib/whatweb/matcher/version.rb +18 -34
- data/lib/whatweb/plugins/achecker.rb +1 -2
- data/lib/whatweb/plugins/amxmodx.rb +1 -2
- data/lib/whatweb/plugins/apache-tomcat.rb +12 -22
- data/lib/whatweb/plugins/contao.rb +0 -1
- data/lib/whatweb/plugins/country.rb +1 -1
- data/lib/whatweb/plugins/episerver.rb +0 -1
- data/lib/whatweb/plugins/escenic.rb +0 -1
- data/lib/whatweb/plugins/google-hack-honeypot.rb +2 -2
- data/lib/whatweb/plugins/htpasswd.rb +1 -4
- data/lib/whatweb/plugins/mac-osx-server.rb +0 -1
- data/lib/whatweb/plugins/magento.rb +1 -1
- data/lib/whatweb/plugins/mysource-matrix.rb +1 -2
- data/lib/whatweb/plugins/phpwcms.rb +3 -4
- data/lib/whatweb/plugins/title.rb +2 -4
- data/lib/whatweb/plugins/vulnerable-to-xss.rb +1 -2
- data/lib/whatweb/target.rb +1 -1
- data/lib/whatweb/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74949bba132a54310d0734e532ea57ea10df193d42748826bb1ec8f0a94ce704
|
4
|
+
data.tar.gz: dff1cb823b0c7f36e38524eeba7433267d06120f23bd7c64df696d917b93a6a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78c15492948ebae1399a703f0e57072881e0fbf57451f4f8ac79ef350ca2f325108618207724f0eee36db8479a3c91b3effaeab7b4e66b051d7f8e54aad14cf3
|
7
|
+
data.tar.gz: a3e404817a1d41a34b54972bc534a4ffc86cdb6b4112c6ab23468b1f4410da5fa9e1db26713f05ddcdc64ac5540422530cfb8a4b9bd0a9d5441101fd4e7c4669
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,172 @@
|
|
1
|
+
# Relaxed.Ruby.Style
|
2
|
+
## Version 2.2
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
TargetRubyVersion: 2.5
|
6
|
+
|
7
|
+
Style/Alias:
|
8
|
+
Enabled: false
|
9
|
+
StyleGuide: https://relaxed.ruby.style/#stylealias
|
10
|
+
|
11
|
+
Style/AsciiComments:
|
12
|
+
Enabled: false
|
13
|
+
StyleGuide: https://relaxed.ruby.style/#styleasciicomments
|
14
|
+
|
15
|
+
Style/BeginBlock:
|
16
|
+
Enabled: false
|
17
|
+
StyleGuide: https://relaxed.ruby.style/#stylebeginblock
|
18
|
+
|
19
|
+
Style/BlockDelimiters:
|
20
|
+
Enabled: false
|
21
|
+
StyleGuide: https://relaxed.ruby.style/#styleblockdelimiters
|
22
|
+
|
23
|
+
Style/CommentAnnotation:
|
24
|
+
Enabled: false
|
25
|
+
StyleGuide: https://relaxed.ruby.style/#stylecommentannotation
|
26
|
+
|
27
|
+
Style/Documentation:
|
28
|
+
Enabled: false
|
29
|
+
StyleGuide: https://relaxed.ruby.style/#styledocumentation
|
30
|
+
|
31
|
+
Layout/DotPosition:
|
32
|
+
Enabled: false
|
33
|
+
StyleGuide: https://relaxed.ruby.style/#layoutdotposition
|
34
|
+
|
35
|
+
Style/DoubleNegation:
|
36
|
+
Enabled: false
|
37
|
+
StyleGuide: https://relaxed.ruby.style/#styledoublenegation
|
38
|
+
|
39
|
+
Style/EndBlock:
|
40
|
+
Enabled: false
|
41
|
+
StyleGuide: https://relaxed.ruby.style/#styleendblock
|
42
|
+
|
43
|
+
Style/FormatString:
|
44
|
+
Enabled: false
|
45
|
+
StyleGuide: https://relaxed.ruby.style/#styleformatstring
|
46
|
+
|
47
|
+
Style/IfUnlessModifier:
|
48
|
+
Enabled: false
|
49
|
+
StyleGuide: https://relaxed.ruby.style/#styleifunlessmodifier
|
50
|
+
|
51
|
+
Style/Lambda:
|
52
|
+
Enabled: false
|
53
|
+
StyleGuide: https://relaxed.ruby.style/#stylelambda
|
54
|
+
|
55
|
+
Style/ModuleFunction:
|
56
|
+
Enabled: false
|
57
|
+
StyleGuide: https://relaxed.ruby.style/#stylemodulefunction
|
58
|
+
|
59
|
+
Style/MultilineBlockChain:
|
60
|
+
Enabled: false
|
61
|
+
StyleGuide: https://relaxed.ruby.style/#stylemultilineblockchain
|
62
|
+
|
63
|
+
Style/NegatedIf:
|
64
|
+
Enabled: false
|
65
|
+
StyleGuide: https://relaxed.ruby.style/#stylenegatedif
|
66
|
+
|
67
|
+
Style/NegatedWhile:
|
68
|
+
Enabled: false
|
69
|
+
StyleGuide: https://relaxed.ruby.style/#stylenegatedwhile
|
70
|
+
|
71
|
+
Style/ParallelAssignment:
|
72
|
+
Enabled: false
|
73
|
+
StyleGuide: https://relaxed.ruby.style/#styleparallelassignment
|
74
|
+
|
75
|
+
Style/PercentLiteralDelimiters:
|
76
|
+
Enabled: false
|
77
|
+
StyleGuide: https://relaxed.ruby.style/#stylepercentliteraldelimiters
|
78
|
+
|
79
|
+
Style/PerlBackrefs:
|
80
|
+
Enabled: false
|
81
|
+
StyleGuide: https://relaxed.ruby.style/#styleperlbackrefs
|
82
|
+
|
83
|
+
Style/Semicolon:
|
84
|
+
Enabled: false
|
85
|
+
StyleGuide: https://relaxed.ruby.style/#stylesemicolon
|
86
|
+
|
87
|
+
Style/SignalException:
|
88
|
+
Enabled: false
|
89
|
+
StyleGuide: https://relaxed.ruby.style/#stylesignalexception
|
90
|
+
|
91
|
+
Style/SingleLineBlockParams:
|
92
|
+
Enabled: false
|
93
|
+
StyleGuide: https://relaxed.ruby.style/#stylesinglelineblockparams
|
94
|
+
|
95
|
+
Style/SingleLineMethods:
|
96
|
+
Enabled: false
|
97
|
+
StyleGuide: https://relaxed.ruby.style/#stylesinglelinemethods
|
98
|
+
|
99
|
+
Layout/SpaceBeforeBlockBraces:
|
100
|
+
Enabled: false
|
101
|
+
StyleGuide: https://relaxed.ruby.style/#layoutspacebeforeblockbraces
|
102
|
+
|
103
|
+
Layout/SpaceInsideParens:
|
104
|
+
Enabled: false
|
105
|
+
StyleGuide: https://relaxed.ruby.style/#layoutspaceinsideparens
|
106
|
+
|
107
|
+
Style/SpecialGlobalVars:
|
108
|
+
Enabled: false
|
109
|
+
StyleGuide: https://relaxed.ruby.style/#stylespecialglobalvars
|
110
|
+
|
111
|
+
Style/StringLiterals:
|
112
|
+
Enabled: false
|
113
|
+
StyleGuide: https://relaxed.ruby.style/#stylestringliterals
|
114
|
+
|
115
|
+
Style/TrailingCommaInArguments:
|
116
|
+
Enabled: false
|
117
|
+
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarguments
|
118
|
+
|
119
|
+
Style/TrailingCommaInArrayLiteral:
|
120
|
+
Enabled: false
|
121
|
+
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarrayliteral
|
122
|
+
|
123
|
+
Style/TrailingCommaInHashLiteral:
|
124
|
+
Enabled: false
|
125
|
+
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainhashliteral
|
126
|
+
|
127
|
+
Style/SymbolArray:
|
128
|
+
Enabled: false
|
129
|
+
StyleGuide: http://relaxed.ruby.style/#stylesymbolarray
|
130
|
+
|
131
|
+
Style/WhileUntilModifier:
|
132
|
+
Enabled: false
|
133
|
+
StyleGuide: https://relaxed.ruby.style/#stylewhileuntilmodifier
|
134
|
+
|
135
|
+
Style/WordArray:
|
136
|
+
Enabled: false
|
137
|
+
StyleGuide: https://relaxed.ruby.style/#stylewordarray
|
138
|
+
|
139
|
+
Lint/AmbiguousRegexpLiteral:
|
140
|
+
Enabled: false
|
141
|
+
StyleGuide: https://relaxed.ruby.style/#lintambiguousregexpliteral
|
142
|
+
|
143
|
+
Lint/AssignmentInCondition:
|
144
|
+
Enabled: false
|
145
|
+
StyleGuide: https://relaxed.ruby.style/#lintassignmentincondition
|
146
|
+
|
147
|
+
Metrics/AbcSize:
|
148
|
+
Enabled: false
|
149
|
+
|
150
|
+
Metrics/BlockNesting:
|
151
|
+
Enabled: false
|
152
|
+
|
153
|
+
Metrics/ClassLength:
|
154
|
+
Enabled: false
|
155
|
+
|
156
|
+
Metrics/ModuleLength:
|
157
|
+
Enabled: false
|
158
|
+
|
159
|
+
Metrics/CyclomaticComplexity:
|
160
|
+
Enabled: false
|
161
|
+
|
162
|
+
Metrics/LineLength:
|
163
|
+
Enabled: false
|
164
|
+
|
165
|
+
Metrics/MethodLength:
|
166
|
+
Enabled: false
|
167
|
+
|
168
|
+
Metrics/ParameterLists:
|
169
|
+
Enabled: false
|
170
|
+
|
171
|
+
Metrics/PerceivedComplexity:
|
172
|
+
Enabled: false
|
data/README.md
CHANGED
@@ -34,21 +34,19 @@ Or install it yourself as:
|
|
34
34
|
|
35
35
|
### As a CLI
|
36
36
|
|
37
|
-
|
38
|
-
Usage:
|
39
|
-
whatweb scan URL
|
40
|
-
|
41
|
-
Options:
|
42
|
-
[--aggressive], [--no-aggressive]
|
43
|
-
[--default], [--no-default]
|
37
|
+
#### Commands
|
44
38
|
|
45
|
-
|
39
|
+
```
|
40
|
+
Commands:
|
41
|
+
whatweb help [COMMAND] # Describe available commands or one specific command
|
42
|
+
whatweb list_plugins # List all plugins
|
43
|
+
whatweb scan URL # Scan against a given URL
|
46
44
|
```
|
47
45
|
|
48
|
-
|
46
|
+
#### Example
|
49
47
|
|
50
48
|
```bash
|
51
|
-
whatweb scan http://localhost:8000 | jq .
|
49
|
+
$ whatweb scan http://localhost:8000 | jq .
|
52
50
|
```
|
53
51
|
|
54
52
|
```json
|
data/lib/whatweb/cli.rb
CHANGED
@@ -15,6 +15,13 @@ module WhatWeb
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
desc "list_plugins", "List all plugins"
|
19
|
+
def list_plugins
|
20
|
+
with_error_handling do
|
21
|
+
puts plugin_names.to_json
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
18
25
|
no_commands do
|
19
26
|
def execute_plugins(url, is_aggressive = false)
|
20
27
|
plugins = PluginManager.instance.load_plugins
|
@@ -28,6 +35,19 @@ module WhatWeb
|
|
28
35
|
results
|
29
36
|
end
|
30
37
|
|
38
|
+
def plugin_names
|
39
|
+
plugins = PluginManager.instance.load_plugins
|
40
|
+
plugins.map do |name, plugin|
|
41
|
+
{
|
42
|
+
name: name,
|
43
|
+
author: plugin.author.encode("UTF-8"),
|
44
|
+
description: plugin.description.encode("UTF-8"),
|
45
|
+
website: plugin.website,
|
46
|
+
version: plugin.version
|
47
|
+
}
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
31
51
|
def with_error_handling
|
32
52
|
yield
|
33
53
|
rescue StandardError => e
|
data/lib/whatweb/helper.rb
CHANGED
data/lib/whatweb/matcher.rb
CHANGED
data/lib/whatweb/matcher/url.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module WhatWeb
|
2
4
|
module Matcher
|
3
5
|
class URL < Base
|
@@ -21,7 +23,7 @@ module WhatWeb
|
|
21
23
|
elsif is_relative? && has_query?
|
22
24
|
"#{target.uri.path}?#{target.uri.query}".match? /#{url}$/
|
23
25
|
elsif !is_relative? && has_query?
|
24
|
-
"#{target.uri.path}?#{target.uri.query}"
|
26
|
+
url == "#{target.uri.path}?#{target.uri.query}"
|
25
27
|
else
|
26
28
|
# !is_relative? && !has_query?
|
27
29
|
target.uri.path == url
|
@@ -29,4 +31,4 @@ module WhatWeb
|
|
29
31
|
end
|
30
32
|
end
|
31
33
|
end
|
32
|
-
end
|
34
|
+
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module WhatWeb
|
4
4
|
module Matcher
|
5
5
|
class Version
|
6
|
+
attr_reader :name, :versions, :files, :url, :best_versions
|
6
7
|
def initialize(name_product = nil, versions = nil, url = nil)
|
7
8
|
raise ArgumentError, 'You must specify the name of the product' if name_product.nil?
|
8
9
|
raise ArgumentError, 'You must specify the available versions of the product' if versions.nil?
|
@@ -10,51 +11,34 @@ module WhatWeb
|
|
10
11
|
|
11
12
|
@name = name_product
|
12
13
|
@versions = versions
|
13
|
-
@files =
|
14
|
+
@files = { 'filenames' => [], 'files' => [], 'md5' => [] }
|
14
15
|
@url = url
|
15
|
-
@got_best_versions = false
|
16
16
|
@best_versions = []
|
17
17
|
|
18
|
-
versions.each do |
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
@files['
|
23
|
-
|
24
|
-
@files['md5'].push(target.md5sum)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
18
|
+
versions.each do |_version, value|
|
19
|
+
# e.g. key => "5.0.0"
|
20
|
+
# e.g. value => [["login.php", "59a69886a8c006d607369865f1b4a28c"]]]
|
21
|
+
value.each do |filename, _md5|
|
22
|
+
next if @files['filenames'].include? filename
|
23
|
+
@files['filenames'] << filename
|
28
24
|
|
29
|
-
|
30
|
-
|
25
|
+
url = URI.join(@url.to_s, filename.to_s)
|
26
|
+
@files['files'] << url
|
31
27
|
|
32
|
-
|
33
|
-
|
34
|
-
version[1].each do |file|
|
35
|
-
i = @files['filenames'].index(file[0])
|
36
|
-
count += 1 if @files['md5'][i] == file[1]
|
37
|
-
end
|
38
|
-
while !@best_versions.empty? && @best_versions[0][1] < count
|
39
|
-
@best_versions.delete_at(0)
|
40
|
-
end
|
41
|
-
if count > 0 && (@best_versions.empty? || @best_versions[0][1] == count) && \
|
42
|
-
!@best_versions.include?([version[0], count])
|
43
|
-
@best_versions.insert(0, [version[0], count])
|
28
|
+
target = Target.new(url)
|
29
|
+
@files['md5'] << target.md5sum
|
44
30
|
end
|
45
31
|
end
|
32
|
+
end
|
46
33
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
@best_versions.each_index { |i| @best_versions.delete_at(i + 1) }.sort!
|
51
|
-
|
52
|
-
@best_versions
|
34
|
+
def best_match
|
35
|
+
versions.max { |x, y| x[1].length <=> y[1].length }
|
53
36
|
end
|
54
37
|
|
55
38
|
def matches_format
|
56
|
-
|
57
|
-
|
39
|
+
return [] if versions.empty?
|
40
|
+
version, _files = best_match
|
41
|
+
[version]
|
58
42
|
end
|
59
43
|
end
|
60
44
|
end
|
@@ -35,9 +35,8 @@ WhatWeb::Plugin.define "AChecker" do
|
|
35
35
|
if / <\/td><td><span> Version: ([\d\.]+)<\/span><\/td>/.match?(target.body)
|
36
36
|
version = target.body.scan(/ <\/td><td><span> Version: ([\d\.]+)<\/span><\/td>/)[0][0]
|
37
37
|
m << { version: version }
|
38
|
-
|
38
|
+
end
|
39
39
|
end
|
40
|
-
|
41
40
|
m
|
42
41
|
end
|
43
42
|
end
|
@@ -35,8 +35,7 @@ WhatWeb::Plugin.define "AMX-Mod-X" do
|
|
35
35
|
if target.body =~ /amx_sql_host[\s]+"([^\"]*)"/ && target.body =~ /amx_sql_user[\s]+"([^\"]+)"/ && target.body =~ /amx_sql_pass[\s]+"([^\"]*)"/
|
36
36
|
version = target.body.scan(/amx_sql_user[\s]+"([^\"]+)"/)[0][0] + ":" + target.body.scan(/amx_sql_pass[\s]+"([^\"]*)"/)[0][0] + "@" + target.body.scan(/amx_sql_host[\s]+"([^\"]+)"/)[0][0]
|
37
37
|
m << { version: version }
|
38
|
-
|
39
|
-
|
38
|
+
end
|
40
39
|
m
|
41
40
|
end
|
42
41
|
end
|
@@ -39,40 +39,30 @@ WhatWeb::Plugin.define "Apache-Tomcat" do
|
|
39
39
|
|
40
40
|
]
|
41
41
|
|
42
|
-
def random_string(length = 32)
|
43
|
-
# should probably be moved somewhere else to be used in other plugins
|
44
|
-
(1..length).map{ |_i| ('a'..'z').to_a[rand(26)] }.join
|
45
|
-
end
|
46
|
-
|
47
42
|
##
|
48
43
|
# get a random page to check for default 404 tomcat page
|
49
44
|
##
|
50
45
|
def version_from_404(target)
|
51
|
-
new_url = "
|
46
|
+
new_url = "#{target.uri.scheme}://#{target.uri.host}:#{target.uri.port}/#{randstr}"
|
52
47
|
info = []
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
unless v.nil?
|
59
|
-
info << { name: "Tomcat version", certainty: 100, version: v }
|
60
|
-
end
|
48
|
+
new_target = WhatWeb::Target.new(new_url)
|
49
|
+
if new_target.status == 404
|
50
|
+
v = new_target.body.scan(/Apache Tomcat\/([456]\.\d+\.\d+)/)[0]
|
51
|
+
unless v.nil?
|
52
|
+
info << { name: "Tomcat version", certainty: 100, version: v }
|
61
53
|
end
|
62
|
-
rescue StandardError => _
|
63
|
-
# do nothing
|
64
54
|
end
|
65
55
|
info
|
66
56
|
end
|
67
57
|
|
68
58
|
def aggressive(target)
|
69
|
-
|
70
|
-
|
71
|
-
|
59
|
+
begin
|
60
|
+
info = version_from_404(target)
|
61
|
+
rescue StandardError => e
|
62
|
+
p e
|
72
63
|
[]
|
73
|
-
|
74
|
-
|
75
|
-
end
|
64
|
+
end
|
65
|
+
info
|
76
66
|
# TODO version can also be retrieve from 500 error page
|
77
67
|
end
|
78
68
|
end
|
@@ -66,7 +66,6 @@ WhatWeb::Plugin.define "Contao" do
|
|
66
66
|
to_download = files.map { |x| x[:path] }.sort.uniq
|
67
67
|
downloads = {}
|
68
68
|
to_download.each do |d|
|
69
|
-
|
70
69
|
url = URI.join(target.uri.to_s, d).to_s
|
71
70
|
new_target = WhatWeb::Target.new(url)
|
72
71
|
downloads[d] = { md5sum: new_target.md5sum }
|
@@ -43,7 +43,7 @@ WhatWeb::Plugin.define "Country" do
|
|
43
43
|
File.open(whatweb_folder + "/country-ips.dat", "wb") do |wfile|
|
44
44
|
IO.foreach(whatweb_folder + "/IpToCountry.csv") do |line|
|
45
45
|
next if line !~ /^"/
|
46
|
-
s, e,
|
46
|
+
s, e, _d1, _d2, co = line.delete!("\"").split(",")
|
47
47
|
s, e = s.to_i, e.to_i
|
48
48
|
if !last_start
|
49
49
|
# initialize with first entry
|
@@ -92,8 +92,8 @@ WhatWeb::Plugin.define "Google-Hack-Honeypot" do
|
|
92
92
|
# Password format: WebAdmin:ae[11-random-characters]
|
93
93
|
# Refresh URL and see if the password changed
|
94
94
|
if target.uri.to_s =~ /\/passwd\.txt$/ && target.body =~ /^WebAdmin:ae[\w]{11}$/
|
95
|
-
|
96
|
-
if body != target.body
|
95
|
+
new_target = WhatWeb::Target.new(target.uri.to_s)
|
96
|
+
if new_target.body != target.body
|
97
97
|
m << { module: "wwwboard passwd.txt" }
|
98
98
|
end
|
99
99
|
|
@@ -73,16 +73,13 @@ WhatWeb::Plugin.define "htpasswd" do
|
|
73
73
|
# Display hash if unknown
|
74
74
|
else
|
75
75
|
{ account: line.to_s }
|
76
|
-
|
77
|
-
|
76
|
+
end
|
78
77
|
# Display hash if user is not "admin"
|
79
78
|
else
|
80
79
|
{ account: line.to_s }
|
81
80
|
end
|
82
81
|
end
|
83
|
-
|
84
82
|
end
|
85
|
-
|
86
83
|
m
|
87
84
|
end
|
88
85
|
end
|
@@ -13,7 +13,7 @@ WhatWeb::Plugin.define "Magento" do
|
|
13
13
|
@website = "http://www.magentocommerce.com"
|
14
14
|
|
15
15
|
@dorks = [
|
16
|
-
|
16
|
+
'Magento is a trademark of Magento Inc. Copyright" "admin"',
|
17
17
|
'intitle:"Magento Downloader" "Report All Bugs"'
|
18
18
|
]
|
19
19
|
|
@@ -41,14 +41,13 @@ WhatWeb::Plugin.define "MySource-Matrix" do
|
|
41
41
|
version = target.body.scan(/MySource Matrix ([\d\.]+)/)[0][0]
|
42
42
|
m << { version: version }
|
43
43
|
end
|
44
|
-
|
44
|
+
end
|
45
45
|
|
46
46
|
# HTML comment
|
47
47
|
if / Running Squiz MySource v([\d\.]+) \(Matrix\) - http:\/\/matrix.squiz.net\//.match?(target.body)
|
48
48
|
version = target.body.scan(/ Running Squiz MySource v([\d\.]+) \(Matrix\) - http:\/\/matrix.squiz.net\//)[0][0]
|
49
49
|
m << { version: version }
|
50
50
|
end
|
51
|
-
|
52
51
|
m
|
53
52
|
end
|
54
53
|
end
|
@@ -27,12 +27,11 @@ WhatWeb::Plugin.define "phpwcms" do
|
|
27
27
|
m = []
|
28
28
|
|
29
29
|
if /phpwcms \| open source web content management system/.match?(target.body)
|
30
|
-
if /
|
31
|
-
version = target.body.scan(/
|
30
|
+
if /Release: ([\d\.\-A-Z]+) [\d\-]+\/\/-->/.match?(target.body)
|
31
|
+
version = target.body.scan(/Release: ([\d\.\-A-Z]+) [\d\-]+\/\/-->/)[0][0]
|
32
32
|
m << { version: version }
|
33
|
-
|
33
|
+
end
|
34
34
|
end
|
35
|
-
|
36
35
|
m
|
37
36
|
end
|
38
37
|
end
|
@@ -26,12 +26,10 @@ WhatWeb::Plugin.define "Title" do
|
|
26
26
|
title = html.css("title")
|
27
27
|
if title
|
28
28
|
# Give warining if title element contains newline(s)
|
29
|
-
if title.text.include? "\n"
|
30
|
-
m << { name: "WARNING", module: "Title element contains newline(s)!" }
|
31
|
-
end
|
29
|
+
m << { name: "WARNING", module: "Title element contains newline(s)!" } if title.text.include? "\n"
|
32
30
|
# Strip all newlines in title string (for better output)
|
33
31
|
m << { name: "page title", string: title.text.strip }
|
34
|
-
|
32
|
+
end
|
35
33
|
m
|
36
34
|
end
|
37
35
|
end
|
@@ -18,12 +18,11 @@ WhatWeb::Plugin.define "Vulnerable-To-XSS" do
|
|
18
18
|
m = []
|
19
19
|
result = ""
|
20
20
|
if /<script>([\s]*)(alert\([a-zA-Z0-9\/\'\"]+\))([\s]*[\;]?[\s]*)<\/script>/i.match?(target.body)
|
21
|
-
|
21
|
+
target.body.scan(/<script>([\s]*)(alert\([a-zA-Z0-9\/\'\"]+\))[\s]*[\;]?[\s]*<\/script>/i) { |match|
|
22
22
|
result << "#{match} "
|
23
23
|
}
|
24
24
|
m << { version: result, certainty: 25 }
|
25
25
|
end
|
26
|
-
|
27
26
|
m
|
28
27
|
end
|
29
28
|
end
|
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.
|
4
|
+
version: 0.2.0
|
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-08-
|
11
|
+
date: 2018-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -160,6 +160,7 @@ extra_rdoc_files: []
|
|
160
160
|
files:
|
161
161
|
- ".gitignore"
|
162
162
|
- ".rspec"
|
163
|
+
- ".rubocop.yml"
|
163
164
|
- ".travis.yml"
|
164
165
|
- Gemfile
|
165
166
|
- LICENSE.txt
|