sitecore_scan 0.0.2 → 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 +5 -13
- data/bin/sitecore-scan +9 -11
- data/lib/sitecore_scan.rb +65 -5
- metadata +13 -15
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NDU2NWU1ZTc0MWNhZDEyNmY3NzMwNDdkNmFlZWM4YjU3NDZlNjE2MQ==
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b678037d9c8815435b9e010914c27478105b0edb7b5d3c894cfb1fccb7cb3107
|
4
|
+
data.tar.gz: 7da2e224e3427c8e9f8f34b42acc1970e5ccfd3ccfccbd7e27b956e53a1efdf7
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
Zjk2N2YyODJlN2Y1YzhjYjBkYTVhMmQ4MzhhNGYxYWZiZDliODUwNzVmMDQ5
|
11
|
-
MmMyYWE3OTE0Y2ZmYWRkNTUxZGNkNmRlNzYwMzBhMGRkM2EyNzA=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MDFiM2QyYmZmZGY0NWNiNjNhNzJjMWE3NGY1ODRiNmE4MDk1ZGQxMTlhN2E4
|
14
|
-
MDJkNGRmMzZmMDJhYzJlMDI5NDg3OTk0ZmRjODYwYmE3M2QzZDkyMmY0NTM3
|
15
|
-
MzQ3MjQxYWI3ZmVmZTVkOWJlZjEyNjYyNGVhZmYyZTE2NDFhNjM=
|
6
|
+
metadata.gz: 487fb1c72d1adf02654b5b22d887bc0d1774f5521ff299c04dfbf8f57e2ecf819bcc2cc732bef59bad37cf1c026bbe701716432c0d67c793ec2717768aa3ac85
|
7
|
+
data.tar.gz: ae6bb06f1925ab086b744ea4cd46768028a95af647da39c240cc64a8d59b5bd569044fe338f2a9d2e6f7473622054cdec110d0004a23195dca7ed319a58a2582
|
data/bin/sitecore-scan
CHANGED
@@ -16,7 +16,7 @@ def banner
|
|
16
16
|
\\___ \\| | __/ _ \\/ __/ _ \\| '__/ _ \\\\___ \\ / __/ _` | '_ \\
|
17
17
|
____) | | || __/ (_| (_) | | | __/____) | (_| (_| | | | |
|
18
18
|
|_____/|_|\\__\\___|\\___\\___/|_| \\___|_____/ \\___\\__,_|_| |_|
|
19
|
-
version
|
19
|
+
version #{SitecoreScan::VERSION}"
|
20
20
|
puts
|
21
21
|
puts '-' * 60
|
22
22
|
end
|
@@ -93,8 +93,7 @@ def scan(url, check: true, insecure: false, verbose: false)
|
|
93
93
|
|
94
94
|
# Check if the URL is Sitecore
|
95
95
|
if check
|
96
|
-
|
97
|
-
unless is_sitecore
|
96
|
+
unless SitecoreScan::detectSitecore(url)
|
98
97
|
puts '- Sitecore not found'
|
99
98
|
exit(1)
|
100
99
|
end
|
@@ -106,20 +105,19 @@ def scan(url, check: true, insecure: false, verbose: false)
|
|
106
105
|
puts "+ Version: #{version}" if version
|
107
106
|
|
108
107
|
# Check if Glimpse debugging is enabled
|
109
|
-
|
110
|
-
puts "+ Glimpse debugging is enabled" if glimpse
|
108
|
+
puts "+ Glimpse debugging is enabled" if SitecoreScan::glimpseDebugging(url)
|
111
109
|
|
112
110
|
# Check if SOAP API is accessible
|
113
|
-
|
114
|
-
|
111
|
+
puts "+ SOAP API is available" if SitecoreScan::soapApi(url)
|
112
|
+
|
113
|
+
# Check if MVC Device Simulator allows file disclosure
|
114
|
+
puts "+ MVC Device Simulator allows file disclosure" if SitecoreScan::mvcDeviceSimulatorFileDisclosure(url)
|
115
115
|
|
116
116
|
# Check if Executive Insight Dashboard reporting is accessible
|
117
|
-
reporting
|
118
|
-
puts "+ Executive Insight Dashboard reporting is available" if reporting
|
117
|
+
puts "+ Executive Insight Dashboard reporting is available" if SitecoreScan::dashboardReporting(url)
|
119
118
|
|
120
119
|
# Check if Telerik Web UI is accessible
|
121
|
-
|
122
|
-
puts "+ Telerik Web Ui is available" if telerik
|
120
|
+
puts "+ Telerik Web Ui is available" if SitecoreScan::telerikWebUi(url)
|
123
121
|
|
124
122
|
puts "Scan finished at #{Time.now.getutc}"
|
125
123
|
puts '-' * 60
|
data/lib/sitecore_scan.rb
CHANGED
@@ -8,9 +8,10 @@ require 'cgi'
|
|
8
8
|
require 'logger'
|
9
9
|
require 'net/http'
|
10
10
|
require 'openssl'
|
11
|
+
require 'stringio'
|
11
12
|
|
12
13
|
class SitecoreScan
|
13
|
-
VERSION = '0.0.
|
14
|
+
VERSION = '0.0.4'.freeze
|
14
15
|
|
15
16
|
def self.logger
|
16
17
|
@logger
|
@@ -29,13 +30,27 @@ class SitecoreScan
|
|
29
30
|
end
|
30
31
|
|
31
32
|
#
|
32
|
-
# Check if URL is running Sitecore
|
33
|
+
# Check if URL is running Sitecore
|
33
34
|
#
|
34
35
|
# @param [String] URL
|
35
36
|
#
|
36
37
|
# @return [Boolean]
|
37
38
|
#
|
38
39
|
def self.detectSitecore(url)
|
40
|
+
return true if detectSitecoreEditMode(url)
|
41
|
+
return true if detectSitecoreErrorRedirect(url)
|
42
|
+
|
43
|
+
false
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Check if URL is running Sitecore using edit mode
|
48
|
+
#
|
49
|
+
# @param [String] URL
|
50
|
+
#
|
51
|
+
# @return [Boolean]
|
52
|
+
#
|
53
|
+
def self.detectSitecoreEditMode(url)
|
39
54
|
url += '/' unless url.to_s.end_with? '/'
|
40
55
|
res = sendHttpRequest("#{url}?sc_mode=edit")
|
41
56
|
|
@@ -48,6 +63,25 @@ class SitecoreScan
|
|
48
63
|
false
|
49
64
|
end
|
50
65
|
|
66
|
+
#
|
67
|
+
# Check if URL is running Sitecore using error redirect
|
68
|
+
#
|
69
|
+
# @param [String] URL
|
70
|
+
#
|
71
|
+
# @return [Boolean]
|
72
|
+
#
|
73
|
+
def self.detectSitecoreErrorRedirect(url)
|
74
|
+
url += '/' unless url.to_s.end_with? '/'
|
75
|
+
res = sendHttpRequest("#{url}#{('a'..'z').to_a.shuffle[0,8].join}.aspx")
|
76
|
+
|
77
|
+
return false unless res
|
78
|
+
|
79
|
+
return true if res['sitecore-item']
|
80
|
+
return true if res.code.to_i == 302 && res['location'].to_s.downcase.include?('sitecore/service/notfound.aspx')
|
81
|
+
|
82
|
+
false
|
83
|
+
end
|
84
|
+
|
51
85
|
#
|
52
86
|
# Retrieve Sitecore version from Login page
|
53
87
|
#
|
@@ -65,7 +99,11 @@ class SitecoreScan
|
|
65
99
|
|
66
100
|
return version if version
|
67
101
|
|
68
|
-
res.body.to_s.scan(%r{<iframe src="https://sdn.sitecore.net/startpage.aspx\?[^"]+v=([\d
|
102
|
+
version = res.body.to_s.scan(%r{<iframe src="https://sdn.sitecore.net/startpage.aspx\?[^"]+v=([\d.]+)"}).flatten.first
|
103
|
+
|
104
|
+
return version if version
|
105
|
+
|
106
|
+
nil
|
69
107
|
end
|
70
108
|
|
71
109
|
#
|
@@ -99,7 +137,29 @@ class SitecoreScan
|
|
99
137
|
|
100
138
|
return false unless res
|
101
139
|
return false unless res.code.to_i == 200
|
102
|
-
return false unless res.body.to_s.include?
|
140
|
+
return false unless res.body.to_s.include?('Visual Sitecore Service Web Service')
|
141
|
+
|
142
|
+
true
|
143
|
+
end
|
144
|
+
|
145
|
+
#
|
146
|
+
# Check if MVC Device Simulator allows file disclosure (SC2023-001-568150)
|
147
|
+
# https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB1002925
|
148
|
+
# https://blog.assetnote.io/2023/05/10/sitecore-round-two/
|
149
|
+
#
|
150
|
+
# @param [String] URL
|
151
|
+
#
|
152
|
+
# @return [Boolean]
|
153
|
+
#
|
154
|
+
def self.mvcDeviceSimulatorFileDisclosure(url)
|
155
|
+
url += '/' unless url.to_s.end_with? '/'
|
156
|
+
res = sendHttpRequest("#{url}api/sitecore/Sitecore.Mvc.DeviceSimulator.Controllers.SimulatorController,Sitecore.Mvc.DeviceSimulator.dll/Preview?previewPath=/App_Data/license.xml")
|
157
|
+
|
158
|
+
return false unless res
|
159
|
+
return false unless res.code.to_i == 200
|
160
|
+
return false unless res.body.to_s.include?('<?xml')
|
161
|
+
return false unless res.body.to_s.include?('sitecore')
|
162
|
+
return false unless res.body.to_s.include?('signedlicense')
|
103
163
|
|
104
164
|
true
|
105
165
|
end
|
@@ -118,7 +178,7 @@ class SitecoreScan
|
|
118
178
|
|
119
179
|
return false unless res
|
120
180
|
return false unless res.code.to_i == 200
|
121
|
-
return false unless res.body.to_s.include?
|
181
|
+
return false unless res.body.to_s.include?('Sitecore.Analytics.Reporting')
|
122
182
|
|
123
183
|
true
|
124
184
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sitecore_scan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brendan Coles
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logger
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.6'
|
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: '1.
|
26
|
+
version: '1.6'
|
27
27
|
description: A simple remote scanner for Sitecore CMS
|
28
28
|
email: bcoles@gmail.com
|
29
29
|
executables:
|
@@ -37,25 +37,23 @@ homepage: https://github.com/bcoles/sitecore_scan
|
|
37
37
|
licenses:
|
38
38
|
- MIT
|
39
39
|
metadata: {}
|
40
|
-
post_install_message:
|
40
|
+
post_install_message:
|
41
41
|
rdoc_options: []
|
42
42
|
require_paths:
|
43
43
|
- lib
|
44
44
|
required_ruby_version: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 2.
|
48
|
+
version: 2.5.0
|
49
49
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
|
-
|
56
|
-
|
57
|
-
signing_key:
|
55
|
+
rubygems_version: 3.3.26
|
56
|
+
signing_key:
|
58
57
|
specification_version: 4
|
59
58
|
summary: Sitecore scanner
|
60
59
|
test_files: []
|
61
|
-
has_rdoc:
|