File: pharos-lpc.rb

package info (click to toggle)
whatweb 0.4.9-2
  • links: PTS
  • area: main
  • in suites: buster
  • size: 21,188 kB
  • sloc: ruby: 33,652; sh: 614; makefile: 42
file content (62 lines) | stat: -rw-r--r-- 2,106 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
##
# This file is part of WhatWeb and may be subject to
# redistribution and commercial restrictions. Please see the WhatWeb
# web site for more information on licensing and terms of use.
# http://www.morningstarsecurity.com/research/whatweb
##
Plugin.define "Pharos-LPC" do
author "Brendan Coles <bcoles@gmail.com>" # 2011-07-14
version "0.1"
description "Pharos LPC web interface - All-in-one control solution for entertainment and LED lighting installations."
website "http://www.pharoscontrols.com/products/lighting_controllers/lpc"

# Two LPC models available: LPC 1 (512 DMX channels) and LPC 2 (1024 DMX channels)

# Datasheets for LPC and LPC X #
# http://www.pharoscontrols.com/assets/files/datasheets/pharos_lpc_datasheet.pdf
# http://www.pharoscontrols.com/assets/files/datasheets/pharos_lpc_x_datasheet.pdf

# ShodanHQ results as at 2011-07-14 #
# 5 for pharos_lpc



# Passive #
def passive
	m=[]

	# Default Title
	if @body =~ /<title>Pharos LPC[^<]*<\/title>/

		# Firmware Detection
		if @body =~ /<td class = "header">Firmware Version:<\/td><td colspan = "4">([^<]+)<\/td>/
			m << { :firmware=>@body.scan(/<td class = "header">Firmware Version:<\/td><td colspan = "4">([^<]+)<\/td>/) }
		end
	
		# Module Detection
		if @body =~ /<td class = "header">Expansion Modules:<\/td><td>([^<]+)<\/td>/
			m << { :module=>@body.scan(/<td class = "header">Expansion Modules:<\/td><td>([^<]+)<\/td>/) }
		end

		# Model Detection
		if @body =~ /<td class = "header">Product Type:<\/td><td colspan = "4">([^<]+)<\/td>/
			m << { :model=>@body.scan(/<td class = "header">Product Type:<\/td><td colspan = "4">([^<]+)<\/td>/) }
		end
		if @body =~ /<title>Pharos (LPC[\d]) [\d]{6}[\s]*<\/title>/
			m << { :model=>@body.scan(/<title>Pharos (LPC[\d]) [\d]{6}[\s]*<\/title>/) }
		end

	end

	# Redirect Location
	m << { :certainty=>75, :name=>"Redirect Location" } if @headers["location"] =~ /^https?:\/\/[^\/]+\/pharos_lpc\/index\.asp$/

	# WWW-Authenticate Realm
	m << { :name=>"authenticate realm" } if @headers["www-authenticate"] =~ /Digest realm="PharosLPC"/

	# Return passive matches
	m
end

end