File: Spiceworks.rb

package info (click to toggle)
whatweb 0.4.8~git20120606-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,956 kB
  • sloc: ruby: 53,738; sh: 577; makefile: 34
file content (75 lines) | stat: -rw-r--r-- 2,436 bytes parent folder | download
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
63
64
65
66
67
68
69
70
71
72
73
74
75
##
# 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 "Spiceworks" do
author "Brendan Coles <bcoles@gmail.com>" # 2011-05-23
version "0.1"
description "Spiceworks' single, easy-to-use interface combines Network Inventory, Help Desk, Mapping, Reporting, Monitoring and Troubleshooting - Homepage: http://www.spiceworks.com/product/"

# ShodanHQ results as at 2011-05-23 #
# 2,101 for spiceworks_session
# 20 for -spiceworks_session spiceworks

# Examples #
examples %w|
75.150.83.164
204.97.253.84
64.197.246.50
69.95.6.106
63.229.182.22
130.179.4.93
150.203.23.49
207.212.143.229
62.215.220.234
|

# Matches #
matches [

# Meta Author
{ :text=>'<meta name="author" content="Spiceworks, Inc." />' },

# Login Page # compatible browsers message
{ :text=>'<p>Spiceworks is compatible with <a href="http://community.spiceworks.com/help/Spiceworks_Requirements#Browser">modern browsers</a>, and requires JavaScript, Cookies, and Stylesheets (CSS) to function correctly.</p>' },

# Login Page # Title
{ :text=>'<title>Spiceworks - Login Required</title>' },

]

# Passive #
def passive
	m=[]

	# spiceworks_session cookie
	# Session cookie format: URL encoded base64 string beginning with "BAh7"
	# Terminated by "--" then followed by a md5 hash
	m << { :name=>"spiceworks_session cookie" } if @headers["set-cookie"] =~ /spiceworks_session=BAh7[^\s]+--/

	# spiceworks cookie
	m << { :name=>"spiceworks cookie" } if @headers["set-cookie"] =~ /spiceworks=[a-f\d]{32}; path=\//

	# If a match was found
	unless m.empty?

		# Version Detection # Login Page # Logo HTML
		if @body =~ /<h1><img alt="Spiceworks" src="\/images\/logos\/large\.png\?([\d]{7})" \/><\/h1>/
			m << { :version=>@body.scan(/<h1><img alt="Spiceworks" src="\/images\/logos\/large\.png\?([\d]{7})" \/><\/h1>/)[0][0].insert(1, ".").insert(3, ".") } unless version.nil?
		end

		# Version Detection # General stylesheet
		if @body =~ /<link href="\/stylesheets\/general\.css\?([\d]{7}+)" media="screen" rel="stylesheet" type="text\/css" \/>/
			m << { :version=>@body.scan(/<link href="\/stylesheets\/general\.css\?([\d]{7})" media="screen" rel="stylesheet" type="text\/css" \/>/)[0][0].insert(1, ".").insert(3, ".") }
		end

	end

	# Return passive matches
	m
end

end