simple_whatweb 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/whatweb/cli.rb +9 -3
- data/lib/whatweb/plugin.rb +0 -1
- data/lib/whatweb/plugins/allow.rb +1 -1
- data/lib/whatweb/plugins/apache-tomcat.rb +1 -3
- data/lib/whatweb/plugins/appleidiskserver.rb +1 -1
- data/lib/whatweb/plugins/asp.net.rb +1 -1
- data/lib/whatweb/plugins/atlassian-jira.rb +1 -1
- data/lib/whatweb/plugins/confluence.rb +2 -2
- data/lib/whatweb/plugins/contao.rb +1 -3
- data/lib/whatweb/plugins/password_field.rb +3 -3
- data/lib/whatweb/plugins/punbb.rb +1 -3
- data/lib/whatweb/plugins/x-powered-by-header.rb +1 -3
- data/lib/whatweb/target.rb +5 -3
- data/lib/whatweb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc8a116eb5a0ba92f6c846d78124f349204dd2716da9d04f968bc0b9a2e0856e
|
4
|
+
data.tar.gz: caf26d9f9c8ba4f3bf91b0968d1bb188b3535a06be57889e612756e91711a2e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1398c10d4ac8a6cd4549ebe90e0da52a7fb025dc0c537dbdb05c42589c75579deee78ee9547467fd4274fb5f126948a9c97cab7b912fa76f0261309d3373045
|
7
|
+
data.tar.gz: b0822fe238bc0664bdaf74501c3ac0fb188ec56bb03313866be5f36323c0ab5482f73825496a1fab050d403ca6e57266b552117cf141b23e50c0914efaff4b57
|
data/lib/whatweb/cli.rb
CHANGED
@@ -7,10 +7,13 @@ module WhatWeb
|
|
7
7
|
class CLI < Thor
|
8
8
|
desc "scan URL", "Scan against a given URL"
|
9
9
|
method_options aggressive: :boolean, default: false
|
10
|
+
method_options user_agent: :string
|
10
11
|
def scan(url)
|
12
|
+
user_agent = options[:user_agent]
|
11
13
|
is_aggressive = options[:aggressive]
|
14
|
+
|
12
15
|
with_error_handling do
|
13
|
-
hash = execute_plugins(url, is_aggressive)
|
16
|
+
hash = execute_plugins(url, user_agent: user_agent, is_aggressive: is_aggressive)
|
14
17
|
puts hash.to_json
|
15
18
|
end
|
16
19
|
end
|
@@ -23,9 +26,12 @@ module WhatWeb
|
|
23
26
|
end
|
24
27
|
|
25
28
|
no_commands do
|
26
|
-
def execute_plugins(url,
|
29
|
+
def execute_plugins(url, options = {})
|
30
|
+
user_agent = options[:user_agent]
|
31
|
+
is_aggressive = options[:is_aggressive]
|
32
|
+
|
27
33
|
plugins = PluginManager.instance.load_plugins
|
28
|
-
target = Target.new(url)
|
34
|
+
target = Target.new(url, user_agent: user_agent)
|
29
35
|
|
30
36
|
results = {}
|
31
37
|
plugins.each do |name, plugin|
|
data/lib/whatweb/plugin.rb
CHANGED
@@ -93,7 +93,6 @@ module WhatWeb
|
|
93
93
|
results += matches.map { |match| matching(target, match) } if matches
|
94
94
|
results += passive(target)
|
95
95
|
results += aggressive(target) if is_aggressive
|
96
|
-
# TODO: aggressive mode support
|
97
96
|
results.flatten!
|
98
97
|
results.compact!
|
99
98
|
results.each { |result| result[:certainty] = 100 unless result.key?(:certainty) }
|
@@ -48,9 +48,7 @@ WhatWeb::Plugin.define "Apache-Tomcat" do
|
|
48
48
|
new_target = WhatWeb::Target.new(new_url)
|
49
49
|
if new_target.status == 404
|
50
50
|
v = new_target.body.scan(/Apache Tomcat\/([456]\.\d+\.\d+)/)[0]
|
51
|
-
|
52
|
-
info << { name: "Tomcat version", certainty: 100, version: v }
|
53
|
-
end
|
51
|
+
info << { name: "Tomcat version", certainty: 100, version: v } if v
|
54
52
|
end
|
55
53
|
info
|
56
54
|
end
|
@@ -39,7 +39,7 @@ WhatWeb::Plugin.define "AppleIDiskServer" do
|
|
39
39
|
m << { name: "WWW Authenticate" } if target.headers["www-authenticate"] =~ /Basic realm="me\.com"/
|
40
40
|
|
41
41
|
# Account Detection # X-dmUser
|
42
|
-
m << { account: target.headers["x-dmuser"] }
|
42
|
+
m << { account: target.headers["x-dmuser"] } if target.headers["x-dmuser"]
|
43
43
|
end
|
44
44
|
|
45
45
|
# Return passive matches
|
@@ -93,7 +93,7 @@ WhatWeb::Plugin.define "ASP_NET" do
|
|
93
93
|
m = []
|
94
94
|
|
95
95
|
# Version Detection # X-AspNetmvc-version HTTP header
|
96
|
-
m << { string: "MVC" + target.headers['x-aspnetmvc-version'].to_s }
|
96
|
+
m << { string: "MVC" + target.headers['x-aspnetmvc-version'].to_s } if target.headers['x-aspnetmvc-version']
|
97
97
|
|
98
98
|
# Return passive results
|
99
99
|
m
|
@@ -50,7 +50,7 @@ WhatWeb::Plugin.define "Atlassian-JIRA" do
|
|
50
50
|
m << { name: "x-arequestid header" } if target.headers["x-arequestid"] =~ /^[\d]+x[\d]+x[\d]+$/
|
51
51
|
|
52
52
|
# x-ausername
|
53
|
-
m << { name: "x-ausername header" }
|
53
|
+
m << { name: "x-ausername header" } if target.headers["x-ausername"]
|
54
54
|
|
55
55
|
# atlassian.xsrf.token cookie
|
56
56
|
m << { name: "atlassian.xsrf.token" } if target.headers["set-cookie"] =~ /atlassian\.xsrf\.token=/
|
@@ -47,10 +47,10 @@ WhatWeb::Plugin.define "Confluence" do
|
|
47
47
|
m = []
|
48
48
|
|
49
49
|
# x-confluence-cluster-node
|
50
|
-
m << { name: "x-confluence-cluster-node header" }
|
50
|
+
m << { name: "x-confluence-cluster-node header" } if target.headers["x-confluence-cluster-node"]
|
51
51
|
|
52
52
|
# x-confluence-request-time
|
53
|
-
m << { name: "x-confluence-request-time header" }
|
53
|
+
m << { name: "x-confluence-request-time header" } if target.headers["x-confluence-request-time"]
|
54
54
|
|
55
55
|
# Return passive matches
|
56
56
|
m
|
@@ -15,7 +15,7 @@ WhatWeb::Plugin.define "PasswordField" do
|
|
15
15
|
# Matches #
|
16
16
|
@matches = [
|
17
17
|
|
18
|
-
{ name: "
|
18
|
+
{ name: "input type", regexp: /<input [^>]*?type=["']password["'][^>]*>/i },
|
19
19
|
|
20
20
|
]
|
21
21
|
|
@@ -28,8 +28,8 @@ WhatWeb::Plugin.define "PasswordField" do
|
|
28
28
|
field.scan(/name=["'](.*?)["']/i).first.first
|
29
29
|
rescue StandardError
|
30
30
|
nil
|
31
|
-
end
|
32
|
-
m << { name: "field name", string: name }
|
31
|
+
end
|
32
|
+
m << { name: "field name", string: name } if name
|
33
33
|
end
|
34
34
|
m
|
35
35
|
end
|
@@ -92,9 +92,7 @@ WhatWeb::Plugin.define "PunBB" do
|
|
92
92
|
end
|
93
93
|
|
94
94
|
# Set version if present
|
95
|
-
|
96
|
-
m << { name: "md5 sums of files", version: version }
|
97
|
-
end
|
95
|
+
m << { name: "md5 sums of files", version: version } if version
|
98
96
|
|
99
97
|
# Return aggressive matches
|
100
98
|
m
|
@@ -25,9 +25,7 @@ WhatWeb::Plugin.define "X-Powered-By" do
|
|
25
25
|
m = []
|
26
26
|
|
27
27
|
# X-Powered-By Headers
|
28
|
-
|
29
|
-
m << { name: "x-powered-by string", string: target.headers["x-powered-by"] }
|
30
|
-
end
|
28
|
+
m << { name: "x-powered-by string", string: target.headers["x-powered-by"] } if target.headers["x-powered-by"]
|
31
29
|
|
32
30
|
# Return passive matches
|
33
31
|
m
|
data/lib/whatweb/target.rb
CHANGED
@@ -5,16 +5,18 @@ module WhatWeb
|
|
5
5
|
using WhatWeb::Helper
|
6
6
|
|
7
7
|
attr_accessor :response
|
8
|
+
attr_reader :user_agent
|
8
9
|
attr_reader :url, :body, :headers, :raw_headers, :raw_response, :status, :uri
|
9
10
|
|
10
|
-
def initialize(url,
|
11
|
+
def initialize(url, opts = {})
|
11
12
|
@url = url.to_s
|
12
|
-
@
|
13
|
+
@user_agent = opts[:user_agent] || "WhatWeb/#{VERSION}"
|
14
|
+
@response = opts[:response] || open_url
|
13
15
|
build
|
14
16
|
end
|
15
17
|
|
16
18
|
def open_url
|
17
|
-
HTTP.get url
|
19
|
+
HTTP.headers(user_agent: user_agent).get url
|
18
20
|
end
|
19
21
|
|
20
22
|
def build
|
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.3.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-09-
|
11
|
+
date: 2018-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|