1##
2# This file is part of WhatWeb and may be subject to
3# redistribution and commercial restrictions. Please see the WhatWeb
4# web site for more information on licensing and terms of use.
5# http://www.morningstarsecurity.com/research/whatweb
6##
7Plugin.define "Centreon" do
8    author "Brendan Coles <bcoles@gmail.com>" # 2011-11-09
9    version "0.2"
10    description "Centreon is a network, system, applicative supervision and monitoring tool, it is based upon Nagios."
11website "http://www.centreon.com/"
12
13    # Google results as at 2011-11-11 #
14    # 50 for intitle:"Centreon - IT & Network Monitoring" "Centreon Logo"
15    #  4 for inurl:"centreon/main.php"
16
17    # Dorks #
18    dorks [
19        'intitle:"Centreon - IT & Network Monitoring" "Centreon Logo"'
20    ]
21
22    # Matches #
23    matches [
24
25    # Login Page # Year Detection # Meta Generator
26        { :string=>/<meta name="Generator" content="Centreon - Copyright \(C\) 2005 - (20[\d]{2}) Open Source Matters\. All rights reserved\." \/>/ },
27
28    # Login Page # Year Detection # td id="LoginInvitcpy"
29        { :string=>/<td id="LoginInvitcpy" colspan="2"><br \/>&copy; 2005-(20[\d]{2}) <a href="mailto:infos@centreon\.com">Centreon<\/a><\/td>/ },
30
31    # Login Page # Logo HTML
32        { :text=>'<td class="LoginInvitLogo" colspan="2"><img src="img/centreon.gif" alt="Centreon Logo" title="Centreon Logo" style="" /></td>' },
33
34    # Login Page # Version Detection
35        { :version=>/<tr>[\s]+<td class="LoginInvitVersion"><br \/>[\s]+([^\s^<]+)[\s]+<\/td>[\s]+<td class="LoginInvitDate"><br \/>/ },
36
37    ]
38
39    def aggressive
40        m = []
41
42        versions = Hash[
43                        "1.4.1" =>
44                        [["include/common/javascript/functions.js",
45                          "09937072e56b15c00406cd463e408e78"],
46                         ["include/monitoring/status/templates/serviceSchedule.ihtml",
47                          "4b657d56eb66b6c76de6308fb7b6ed17"]],
48                        "1.4.2" =>
49                        [["include/monitoring/status/templates/serviceSchedule.ihtml",
50                          "4b657d56eb66b6c76de6308fb7b6ed17"]],
51                        "1.4.2.1" =>
52                        [["include/monitoring/status/templates/serviceSchedule.ihtml",
53                          "4b657d56eb66b6c76de6308fb7b6ed17"]],
54                        "1.4.2.2" =>
55                        [["include/monitoring/status/templates/serviceSchedule.ihtml",
56                          "4b657d56eb66b6c76de6308fb7b6ed17"]],
57                        "1.4.2.3" =>
58                        [["include/monitoring/status/templates/serviceSchedule.ihtml",
59                          "4b657d56eb66b6c76de6308fb7b6ed17"]],
60                        "1.4.2.4" =>
61                        [["include/monitoring/status/templates/serviceSchedule.ihtml",
62                          "9ecebc30b3796242eb1c971dd13eb5e3"]],
63                        "1.4.2.5" =>
64                        [["include/monitoring/status/templates/serviceSchedule.ihtml",
65                          "9ecebc30b3796242eb1c971dd13eb5e3"]],
66                        "1.4.2.6" =>
67                        [["include/monitoring/status/templates/serviceSchedule.ihtml",
68                          "9ecebc30b3796242eb1c971dd13eb5e3"]],
69                        "1.4.2.7" =>
70                        [["include/monitoring/status/templates/serviceSchedule.ihtml",
71                          "9ecebc30b3796242eb1c971dd13eb5e3"]],
72                        "1.4.2.8" =>
73                        [["include/views/graphs/graphODS/graphODSByHost.ihtml",
74                          "44c6fa0c23e3ec470ae0675e07a64711"]],
75                        "2.0" =>
76                        [["include/monitoring/status/status-ndo/templates/metaService.xsl",
77                          "ea4c470d4b394ad94a048892172a6e0d"]],
78                        "2.0.1" =>
79                        [["include/configuration/configResources/listResources.ihtml",
80                          "47a71373ea0ffc719f27df78d37b2673"]],
81                        "2.0.2" =>
82                        [["include/common/javascript/functions.js",
83                          "795243ce2f7c4ae08c1e441ee537ba65"]],
84                        "2.1" =>
85                        [["include/configuration/configObject/host/listHost.ihtml",
86                          "2dc3be403ade882bb329def8039c0dfb"]],
87                        "2.1.1" =>
88                        [["include/configuration/configObject/host/listHost.ihtml",
89                          "2dc3be403ade882bb329def8039c0dfb"]],
90                        "2.1.2" =>
91                        [["include/configuration/configObject/host/listHost.ihtml",
92                          "87e104f0287a280fef1194dd60cd2855"]],
93                        "2.1.3" =>
94                        [["include/monitoring/status/Services/xsl/service.xsl",
95                          "a91d4421eece22b984d52c2dde9da4fb"],
96                         ["include/configuration/configObject/host/listHost.ihtml",
97                          "87e104f0287a280fef1194dd60cd2855"]],
98                        "2.1.4" =>
99                        [["include/monitoring/status/Services/xsl/service.xsl",
100                          "301b8f822cad37711e8f6bdbbb01d27d"],
101                         ["include/configuration/configObject/host/listHost.ihtml",
102                          "87e104f0287a280fef1194dd60cd2855"]],
103                        "2.1.5" =>
104                        [["include/monitoring/objectDetails/template/serviceDetails.ihtml",
105                          "50545ce4bcd327be9cac22f0b76e9627"],
106                         ["include/configuration/configObject/host/listHost.ihtml",
107                          "87e104f0287a280fef1194dd60cd2855"]],
108                        "2.1.6" =>
109                        [["include/monitoring/objectDetails/template/serviceDetails.ihtml",
110                          "92a8fa33943a18aa87ad7c17b5357c81"],
111                         ["include/configuration/configObject/host/listHost.ihtml",
112                          "87e104f0287a280fef1194dd60cd2855"]],
113                        "2.1.7" =>
114                        [["include/configuration/configObject/host/listHost.ihtml",
115                          "87e104f0287a280fef1194dd60cd2855"]],
116                        "2.1.8" =>
117                        [["include/configuration/configObject/host/listHost.ihtml",
118                          "87e104f0287a280fef1194dd60cd2855"],
119                         ["Themes/Centreon-2/style.css",
120                          "c5ea4a47743e8296b7b2a833d2366b30"]],
121                        "2.1.9" =>
122                        [["include/configuration/configObject/service/listService.ihtml",
123                          "102dabd2a494e4c5a5813db808d98b6b"],
124                         ["include/configuration/configObject/host/listHost.ihtml",
125                          "87e104f0287a280fef1194dd60cd2855"],
126                         ["Themes/Centreon-2/style.css",
127                          "c5ea4a47743e8296b7b2a833d2366b30"]],
128                        "2.1.10" =>
129                        [["Themes/Centreon-2/style.css",
130                          "c5ea4a47743e8296b7b2a833d2366b30"],
131                         ["include/home/tacticalOverview/tacticalOverview.ihtml",
132                          "a2a13e046acb7e84dae8e1fe5f52e43e"]],
133                        "2.1.11" =>
134                        [["Themes/Centreon-2/style.css",
135                          "c5ea4a47743e8296b7b2a833d2366b30"],
136                         ["include/home/tacticalOverview/tacticalOverview.ihtml",
137                          "4071ef8a8f0a555ceedb43c850ae2e7a"]],
138                        "2.1.12" =>
139                        [["Themes/Centreon-2/style.css",
140                          "f81f143277155ea383276da090504e2b"]],
141                        "2.1.13" =>
142                        [["Themes/Centreon-2/style.css",
143                          "f81f143277155ea383276da090504e2b"]],
144                        "2.2.0" =>
145                        [["include/common/javascript/xslt.js",
146                          "747cf39e51507829fe7dfba73ae07bd6"]],
147                        "2.2.1" =>
148                        [["include/common/javascript/xslt.js",
149                          "6f24fcbbd09c0ecf8c0f32a9473ecbfc"]],
150                        "2.2.2" =>
151                        [["include/common/javascript/xslt.js",
152                          "6f24fcbbd09c0ecf8c0f32a9473ecbfc"]],
153                        "2.3.0" =>
154                        [["install/install.css",
155                          "cdda9ffedc1d9a8677ef852daf24353c"],
156                         ["include/configuration/configObject/service/listService.ihtml",
157                          "670398d91d02092025a1adc8ec3c552d"],
158                         ["include/options/accessLists/actionsACL/formActionsAccess.ihtml",
159                          "53ccb52eff95b5d16f8c0a3461484603"]],
160                        "2.3.1" =>
161                        [["include/configuration/configObject/service/listService.ihtml",
162                          "670398d91d02092025a1adc8ec3c552d"],
163                         ["include/options/accessLists/actionsACL/formActionsAccess.ihtml",
164                          "53ccb52eff95b5d16f8c0a3461484603"]],
165                        "2.3.2" =>
166                        [["include/configuration/configObject/service/listService.ihtml",
167                          "e24ae26743857397fb30436d4fde63c8"],
168                         ["include/configuration/configObject/service/listService.ihtml",
169                          "1229b0d0bb71137b6687801937133f4b"],
170                         ["include/configuration/configLoad/formLoadFiles.ihtml",
171                          "bd699e606bcc933ac5879279c1d4d2b8"]],
172                        "2.3.3" =>
173                        [["include/configuration/configObject/service/listService.ihtml",
174                          "e24ae26743857397fb30436d4fde63c8"],
175                         ["include/configuration/configLoad/formLoadFiles.ihtml",
176                          "bd699e606bcc933ac5879279c1d4d2b8"]],
177                        "2.3.4" =>
178                        [["include/configuration/configObject/service/formService.ihtml",
179                          "0ef9f37123c715e760f4159b6b5cff45"],
180                         ["include/configuration/configLoad/formLoadFiles.ihtml",
181                          "4a4968a7d3b14f73c364a1859167ef89"]],
182                        "2.3.8" =>
183                        [["include/configuration/configLoad/formLoadFiles.ihtml",
184                          "4a4968a7d3b14f73c364a1859167ef89"]],
185                        "2.3.9" =>
186                        [["include/views/graphs/graph.xsl",
187                          "7cb9c6a65ad914c90f2ab7434f39e381"],
188                         ["include/configuration/configLoad/formLoadFiles.ihtml",
189                          "4a4968a7d3b14f73c364a1859167ef89"]],
190                        ]
191        v = Version.new("Centreon", versions, @base_uri)
192
193        version = v.matches_format
194
195	    # Return version matches from md5 hashes, if present
196	    unless version.empty?
197            version.each { |ver|
198                m << {:name => "MD5 sums", :version => ver}
199            }
200	    end
201
202        # Return aggressive matches
203        m
204    end
205end
206
207